static void GetWorldByID(Client client, Packet msg) { try { uint id = BitConverter.ToUInt32(msg.Bytes, 0); World world = DataBase.GetWorld(id).Value; client.Send(new Packet(PacketCode.GetWorldByID, PacketInfo.Success, world.ToCompressed())); } catch (Exception) { client.Send(new Packet(PacketCode.GetWorldByID, PacketInfo.Error)); } }
static void PrintWorlds() { int count = 0; foreach (uint id in DataBase.GetWorldIDs()) { World world = DataBase.GetWorld(id) ?? new World(); Console.WriteLine($"World {++count}:"); Console.WriteLine($" ID: {world.ID.ToID().ToUpper()}"); Console.WriteLine($" Uploader: {world.Uploader.ToID().ToUpper()}"); Console.WriteLine($" UploadTime: {world.UploadTime}"); Console.WriteLine($" Levels: {world.Levels.Count}"); Console.WriteLine($" Title: {world.Title}"); } }