/// <summary> /// Reloaditemses this instance. /// </summary> internal void Reloaditems() { using (var queryReactor = Plus.GetDatabaseManager().GetQueryReactor()) { _itemManager.LoadItems(queryReactor); _globalInventory = new InventoryGlobal(); } }
internal void reloaditems() { using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor()) { ItemManager.LoadItems(dbClient); globalInventory = new InventoryGlobal(); } }
internal void reloaditems() { using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { this.ItemManager.LoadItems(queryreactor); this.globalInventory = new InventoryGlobal(); } }
internal void start() { using (IQueryAdapter queryReactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { uint itemsLoaded = 0; uint catalogPageLoaded = 0; uint navigatorLoaded = 0; uint roomModelLoaded = 0; uint videoPlaylistLoaded = 0; uint achievementLoaded = 0; uint pollLoaded = 0; this.BanManager.LoadBans(queryReactor); this.RoleManager.LoadRights(queryReactor); this.ItemManager.LoadItems(queryReactor, out itemsLoaded); Logging.WriteLine("Loaded a total of " + itemsLoaded + " item definition(s)."); this.PinataHandler.Initialize(queryReactor); this.globalInventory = new InventoryGlobal(); this.VideoManager.Load(queryReactor, out videoPlaylistLoaded); Logging.WriteLine("Loaded a total of " + videoPlaylistLoaded + " video playlist(s)."); this.Catalog.Initialize(queryReactor, out catalogPageLoaded); Logging.WriteLine("Loaded a total of " + catalogPageLoaded + " catalogue page(s)."); this.Navigator.Initialize(queryReactor, out navigatorLoaded); Logging.WriteLine("Loaded a total of " + navigatorLoaded + " official room(s)."); this.RoomManager.LoadModels(queryReactor, out roomModelLoaded); Logging.WriteLine("Loaded a total of " + roomModelLoaded + " room model(s)."); this.RoomManager.InitVotedRooms(queryReactor); this.AchievementManager = new AchievementManager(queryReactor, out achievementLoaded); Logging.WriteLine("Loaded a total of " + achievementLoaded + " achievement(s)."); this.questManager.Initialize(queryReactor); this.PollManager.Init(queryReactor, out pollLoaded); Logging.WriteLine("Loaded a total of " + pollLoaded + " poll(s)."); this.talentManager.Initialize(queryReactor); this.ModerationTool.LoadMessagePresets(queryReactor); this.ModerationTool.LoadPendingTickets(queryReactor); PetRace.Init(queryReactor); AntiPublicistas.Load(queryReactor); this.GetGroupManager().InitGroups(); SongManager.Initialize(); LowPriorityWorker.Init(queryReactor); } this.StartGameLoop(); PixelManager.StartPixelTimer(); }
internal void Init(GameClient client, UserData data) { this.mClient = client; this.SubscriptionManager = new SubscriptionManager(Id, data); this.BadgeComponent = new BadgeComponent(Id, data); this.InventoryComponent = InventoryGlobal.GetInventory(Id, client, data); this.InventoryComponent.SetActiveState(client); this.AvatarEffectsInventoryComponent = new AvatarEffectsInventoryComponent(Id, client, data); this.quests = data.quests; this.chatMessageManager = new ChatMessageManager(); this.Messenger = new HabboMessenger(Id); this.Messenger.Init(data.friends, data.requests); this.SpectatorMode = false; this.Disconnected = false; this.UsersRooms = data.rooms; }
internal void Init(GameClient client, UserData data) { this.mClient = client; this.SubscriptionManager = new SubscriptionManager(this.Id, data); this.BadgeComponent = new BadgeComponent(this.Id, data); this.InventoryComponent = InventoryGlobal.GetInventory(this.Id, client, data); this.InventoryComponent.SetActiveState(client); this.CommandHandler = new ChatCommandHandler(client); this.AvatarEffectsInventoryComponent = new AvatarEffectsInventoryComponent(this.Id, client, data); this.quests = data.quests; this.Messenger = new HabboMessenger(this.Id); this.Messenger.Init(data.friends, data.requests); this.FriendCount = Convert.ToUInt32(data.friends.Count); this.SpectatorMode = false; this.Disconnected = false; this.UsersRooms = data.rooms; this.MinimailUnreadMessages = data.miniMailCount; this.Relationships = data.Relations; this.AnsweredPolls = data.suggestedPolls; }
/// <summary> /// Initializes the specified client. /// </summary> /// <param name="client">The client.</param> /// <param name="data">The data.</param> internal void Init(GameClient client, UserData data) { _mClient = client; _subscriptionManager = new SubscriptionManager(Id, data); _badgeComponent = new BadgeComponent(Id, data); _inventoryComponent = InventoryGlobal.GetInventory(Id, client, data); _inventoryComponent.SetActiveState(client); _avatarEffectsInventoryComponent = new AvatarEffectsInventoryComponent(Id, client, data); Quests = data.Quests; _messenger = new HabboMessenger(Id); _messenger.Init(data.Friends, data.Requests); FriendCount = Convert.ToUInt32(data.Friends.Count); SpectatorMode = false; Disconnected = false; UsersRooms = data.Rooms; MinimailUnreadMessages = data.MiniMailCount; Relationships = data.Relations; AnsweredPolls = data.SuggestedPolls; _clothingManager = new UserClothing(Id); Preferences = new UserPreferences(Id); _youtubeManager = new YoutubeManager(Id); }
internal void ContinueLoading() { DateTime Start; TimeSpan TimeUsed; using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { Start = DateTime.Now; BanManager.LoadBans(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Ban manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; //RoleManager.LoadRoles(dbClient); RoleManager.LoadRights(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Role manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; HelpTool.LoadCategories(dbClient); HelpTool.LoadTopics(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Help tool -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; Catalog.Initialize(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Catacache -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; Navigator.Initialize(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Navigator -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; ItemManager.LoadItems(dbClient); globalInventory = new InventoryGlobal(); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Item manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; RoomManager.LoadModels(dbClient); RoomManager.InitRoomLinks(dbClient); RoomManager.InitVotedRooms(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Room manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; AdvertisementManager.LoadRoomAdvertisements(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Adviserment manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; AchievementManager = new AchievementManager(dbClient); questManager.Initialize(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Achievement manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; ModerationTool.LoadMessagePresets(dbClient); ModerationTool.LoadPendingTickets(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Moderation tool -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; BotManager.LoadBots(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Bot manager manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; Catalog.InitCache(); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Catalogue manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; SongManager.Initialize(); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Sound manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; DatabaseCleanup(dbClient); LowPriorityWorker.Init(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Database -> Cleanup performed! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); } StartGameLoop(); Logging.WriteLine("Game manager -> READY!"); DataSocket.SetupListener(42); DataSocket.Start(); }
/// <summary> /// Initializes a new instance of the <see cref="Game"/> class. /// </summary> /// <param name="conns">The conns.</param> internal Game(int conns) { Console.WriteLine(); Console.WriteLine(@" ╔═╗╔╗╔╗──── ╔═╗╔═╗ ", @""); Console.WriteLine(@" ║╔╝╠╣║╚╗╔╦╗ ║╬║║╬║ ", @""); Console.WriteLine(@" ║╚╗║║║╔╣║║║ ║╗╣║╔╝", @""); Console.WriteLine(@" ╚═╝╚╝╚═╝╠╗║ ╚╩╝╚╝─ ", @""); Console.WriteLine(@" ────────╚═╝ ────── ", @""); Console.WriteLine(); Out.WriteLine(@"Mereos Developer", @"", ConsoleColor.Red); Out.WriteLine(@"Emulador desenvolvido para CityRP.", @"", ConsoleColor.Red); Console.WriteLine(); Out.WriteLine(@"CityRP Emulador está inicializando...", @"", ConsoleColor.Green); Console.WriteLine(); _clientManager = new GameClientManager(); using (var queryReactor = Plus.GetDatabaseManager().GetQueryReactor()) { AbstractBar bar = new AnimatedBar(); const int wait = 15, end = 5; uint itemsLoaded; uint navigatorLoaded; uint roomModelLoaded; uint achievementLoaded; uint pollLoaded; Progress(bar, wait, end, "Loading Bans..."); _banManager = new ModerationBanManager(); _banManager.Init(); Progress(bar, wait, end, "Loading Roles..."); _roleManager = new RoleManager(); _roleManager.LoadRights(queryReactor); Progress(bar, wait, end, "Loading Items..."); _itemManager = new ItemManager(); _itemManager.LoadItems(queryReactor, out itemsLoaded); Progress(bar, wait, end, "Loading Catalog..."); _catalog = new Catalog(); Progress(bar, wait, end, "Loading Clothing..."); _clothingManager = new ClothingManager(); _clothingManager.Initialize(queryReactor); Progress(bar, wait, end, "Loading Crafting..."); _craftingManager = new CraftingManager(); _craftingManager.Initialize(queryReactor); Progress(bar, wait, end, "Loading Rooms..."); _roomManager = new RoomManager(); _roomManager.LoadModels(queryReactor, out roomModelLoaded); Progress(bar, wait, end, "Loading Navigator..."); _navigator = new Navigator(); _navigator.Initialize(queryReactor, out navigatorLoaded); Progress(bar, wait, end, "Loading Groups..."); _groupManager = new GroupManager(); _groupManager.InitGroups(); _globalInventory = new InventoryGlobal(); Progress(bar, wait, end, "Loading HotelView..."); _hotelView = new HotelView(); Progress(bar, wait, end, "Loading ModerationTool..."); _moderationTool = new ModerationTool(); _moderationTool.LoadMessagePresets(queryReactor); _moderationTool.LoadPendingTickets(queryReactor); Progress(bar, wait, end, "Loading Bots..."); _botManager = new BotManager(); Progress(bar, wait, end, "Loading Quests..."); _questManager = new QuestManager(); _questManager.Initialize(queryReactor); Progress(bar, wait, end, "Loading Events..."); _events = new RoomEvents(); Progress(bar, wait, end, "Loading Ranks..."); _roomRankConfig = new RoomRankConfig(); _roomRankConfig.Initialize(); Progress(bar, wait, end, "Loading Talents..."); _talentManager = new TalentManager(); _talentManager.Initialize(queryReactor); Progress(bar, wait, end, "Loading Pinata..."); _pinataHandler = new PinataHandler(); _pinataHandler.Initialize(queryReactor); Progress(bar, wait, end, "Loading Crackable Eggs..."); _crackableEggHandler = new CrackableEggHandler(); _crackableEggHandler.Initialize(queryReactor); Progress(bar, wait, end, "Loading Polls..."); _pollManager = new PollManager(); _pollManager.Init(queryReactor, out pollLoaded); Progress(bar, wait, end, "Loading Achievements..."); _achievementManager = new AchievementManager(queryReactor, out achievementLoaded); Progress(bar, wait, end, "Loading StaticMessages ..."); StaticMessagesManager.Load(); Progress(bar, wait, end, "Loading Guides ..."); _guideManager = new GuideManager(); #region Roleplay Console.Write("[" + DateTime.Now.ToString("HH:mm:ss") + "] >> Lista de procurados gerada!"); Console.WriteLine(" -> READY!"); RoleplayManager.GenerateWantedList(); JobManager.init(); Console.Write("[" + DateTime.Now.ToString("HH:mm:ss") + "] >> " + JobManager.JobData.Count + " Trabalhos carregados"); Console.WriteLine(" -> READY!"); GetGroupManager().InitGroups(); GangManager.init(); Console.Write("[" + DateTime.Now.ToString("HH:mm:ss") + "] >> " + GangManager.GangData.Count + " Gangues carregadas"); Console.WriteLine(" -> READY!"); WeaponManager.init(); Console.Write("[" + DateTime.Now.ToString("HH:mm:ss") + "] >> " + WeaponManager.WeaponsData.Count + " Armas carregadas"); Console.WriteLine(" -> READY!"); ColourManager.Initialize(); MafiaWars = new MafiaWarManager(); Console.Write("[" + DateTime.Now.ToString("HH:mm:ss") + "] >> Mini Games iniciados!"); Console.WriteLine(" -> READY!"); RoleplayManager.init(); #endregion Manager.Cache.StartProcess(); using (var dbCleanUp = Plus.GetDatabaseManager().GetQueryReactor()) DatabaseCleanup(dbCleanUp); Console.Write("\r".PadLeft(Console.WindowWidth - Console.CursorLeft - 1)); } }
internal void ContinueLoading() { DateTime Start; TimeSpan TimeUsed; using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor()) { Start = DateTime.Now; BanManager.LoadBans(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Ban manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; //RoleManager.LoadRoles(dbClient); RoleManager.LoadRights(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Role manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; Catalog.Initialize(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Catacache -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; Navigator.Initialize(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Navigator -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; ItemManager.LoadItems(dbClient); globalInventory = new InventoryGlobal(); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Item manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; RoomManager.LoadModels(dbClient); RoomManager.InitVotedRooms(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Room manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; Ranking.initRankings(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("User rankings -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; AdvertisementManager.LoadRoomAdvertisements(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Adviserment manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; AchievementManager = new AchievementManager(dbClient); questManager.Initialize(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Achievement manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; ModerationTool.LoadMessagePresets(dbClient); ModerationTool.LoadPendingTickets(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Moderation tool -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; BotManager.LoadBots(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Bot manager manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; PetRace.Init(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Pet system -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; Catalog.InitCache(); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Catalogue manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); Start = DateTime.Now; SongManager.Initialize(); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Sound manager -> READY! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); //GuildsPartsData.InitGroups(); //groupManager = new GroupManager(dbClient); Start = DateTime.Now; DatabaseCleanup(dbClient); LowPriorityWorker.Init(dbClient); TimeUsed = DateTime.Now - Start; Logging.WriteLine("Database -> Cleanup performed! (" + TimeUsed.Seconds + " s, " + TimeUsed.Milliseconds + " ms)"); } StartGameLoop(); Logging.WriteLine("Game manager -> READY!"); }