Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case "rnob":
- {
- WindowsAPI.IniFile ini = new WindowsAPI.IniFile("");
- string usersDirectory = Program.ServerConfig.DbLocation + "\\Users\\";
- string[] userFiles = System.IO.Directory.GetFiles(usersDirectory);
- int totalUsers = userFiles.Length;
- int resetUsers = 0;
- foreach (string fname in userFiles)
- {
- ini.FileName = fname;
- ulong nobility = ini.ReadUInt64("Character", "DonationNobility", 0);
- if (nobility > 0)
- {
- ini.Write<ulong>("Character", "DonationNobility", 0);
- resetUsers++;
- string playerId = System.IO.Path.GetFileNameWithoutExtension(fname);
- Console.WriteLine($"DonationNobility reset for user ID: {playerId}, previous DonationNobility: {nobility}");
- }
- }
- Console.WriteLine($"Total users: {totalUsers}");
- Console.WriteLine($"Users with DonationNobility reset: {resetUsers}");
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement