servuo/Scripts/Commands/AccountGoldCheck.cs
TrueUO fb1802305f Bug Fixes
- Removed unneeded usings
- World chat log now has a Config option. Turned off by default now.
- Added two new timer priorities.
- Fixed a crash with box of ropes.
- Consolidation of the Pathing movements and algorithms.
- Correctly makes sure you are inside the house you are trying to place addons in.
2020-09-21 09:53:44 -04:00

40 lines
No EOL
1.6 KiB
C#

using Server.Accounting;
using Server.Commands;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Server.Items
{
public static class AccountGoldCheck
{
public static void Initialize()
{
CommandSystem.Register("CheckAccountGold", AccessLevel.Administrator, e =>
{
double currency = 0.0;
Dictionary<string, long> table = new Dictionary<string, long>();
foreach (Account account in Accounts.GetAccounts().OfType<Account>())
{
table[account.Username] = (long)(account.TotalCurrency * Account.CurrencyThreshold);
currency += account.TotalCurrency;
}
using (StreamWriter op = new StreamWriter("TotalAccountGold.txt", true))
{
foreach (KeyValuePair<string, long> kvp in table.OrderBy(k => -k.Value))
{
op.WriteLine(
string.Format("{0} currency: {1}", kvp.Key, kvp.Value.ToString("N0", System.Globalization.CultureInfo.GetCultureInfo("en-US"))));
}
op.WriteLine("");
op.WriteLine("Total Accounts: {0}", table.Count);
op.WriteLine("Total Shard Gold: {0}", (currency * Account.CurrencyThreshold).ToString("N0", System.Globalization.CultureInfo.GetCultureInfo("en-US")));
}
});
}
}
}