Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case "ConquerPointsLog":
- {
- WindowsAPI.IniFile ini = new WindowsAPI.IniFile("");
- string logFilePath = "C:\\Users\\Administrator\\Desktop\\ConquerPointsLog.txt";
- List<Tuple<string, string, ulong>> conquerPointsList = new List<Tuple<string, string, ulong>>();
- foreach (string fname in System.IO.Directory.GetFiles(Program.ServerConfig.DbLocation + "\\Users\\"))
- {
- ini.FileName = fname;
- string UID = ini.ReadBigString("Character", "UID", "");
- string Name = ini.ReadBigString("Character", "Name", "");
- ulong ConquerPoints = ini.ReadUInt64("Character", "ConquerPoints", 0);
- if (ConquerPoints > 0)
- {
- conquerPointsList.Add(new Tuple<string, string, ulong>(UID, Name, ConquerPoints));
- }
- }
- conquerPointsList.Sort((x, y) => y.Item3.CompareTo(x.Item3));
- using (StreamWriter writer = new StreamWriter(logFilePath))
- {
- foreach (var entry in conquerPointsList)
- {
- string logMessage = string.Format("{0} >> {1} >> ConquerPoints {2:N0}", entry.Item1, entry.Item2, entry.Item3);
- writer.WriteLine(logMessage);
- }
- }
- MyConsole.WriteLine("ConquerPoints log saved to " + logFilePath, ConsoleColor.DarkGreen);
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement