using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using Blizzard.HabboHotel.Users; using Blizzard.HabboHotel.Rooms; namespace Blizzard { public static class StaticGame { public static Dictionary TheardSystem; public static Dictionary VirtualUser; public static List VirtualIds; public static Dictionary VirtualRooms; public static Dictionary UsersAtRoom; public static Dictionary Command; public static Dictionary RoomCycles; public static Dictionary CounterSystem; public static Dictionary WalkingSystem; public static Dictionary FreezeSystem; public static Dictionary FreezeToGetSystem; public static Dictionary FreezeShieldsSystem; public static Dictionary FreezeWaitSystem; public static Dictionary FreezeMoveSystem; public static Dictionary WiredMoveSystem; public static Dictionary WiredMoveItemsSystem; public static Dictionary WiredUpdateItemsSystem; public static Dictionary WiredPeriodicallySystem; public static void InitStaticGame() { TheardSystem = new Dictionary(); VirtualUser = new Dictionary(); VirtualIds = new List(); VirtualRooms = new Dictionary(); UsersAtRoom = new Dictionary(); RoomCycles = new Dictionary(); CounterSystem = new Dictionary(); WalkingSystem = new Dictionary(); Command = new Dictionary(); FreezeSystem = new Dictionary(); FreezeToGetSystem = new Dictionary(); FreezeShieldsSystem = new Dictionary(); FreezeWaitSystem = new Dictionary(); FreezeMoveSystem = new Dictionary(); WiredMoveSystem = new Dictionary(); WiredMoveItemsSystem = new Dictionary(); WiredUpdateItemsSystem = new Dictionary(); WiredPeriodicallySystem = new Dictionary(); } public static void SendPacketToAllRoom(int CurrentId, ServerMessage Packet) { List UserList = new List(); RoomsData D = RoomsData.Rooms[CurrentId]; foreach (Habbo User in D.UserList) { User.SendMessage(Packet); } } public static void SendPacketToAllRoom(Habbo ZUser, ServerMessage Packet) { List UserList = new List(); RoomsData D = RoomsData.Rooms[ZUser.CurrentRoomId]; foreach (Habbo User in D.UserList) { User.SendMessage(Packet); } } public static void SSendPacketToAllRoom(int RoomId, ServerMessage Packet) { List UserList = new List(); RoomsData D = RoomsData.Rooms[RoomId]; foreach (Habbo User in D.UserList) { User.SendMessage(Packet); } } internal static Habbo GetHabboForName(string Name) { foreach (KeyValuePair zUser in StaticGame.VirtualUser) { Habbo sUser = zUser.Value; if (sUser.UserName == Name) return sUser; else continue; } return null; } internal static void SendCPacketToAllRoom(Habbo HUser, ServerMessage Packet) { int RoomId = HUser.CurrentRoomId; List UserList = new List(); if (VirtualUser.Count > 0) { foreach (KeyValuePair VirtualUs in VirtualUser) { int UserId = VirtualUs.Key; Habbo User = VirtualUs.Value; if (RoomId == User.CurrentRoomId) { UserList.Add(VirtualUser[UserId]); } } } foreach (Habbo UserINRoom in UserList) { UserINRoom.SendMessage(Packet); } } } }