Exemplo n.º 1
0
        public Game(int conns)
        {
            ClientManager = new GameClientManager(conns);
            if (PhoenixEnvironment.GetConfig().data["client.ping.enabled"] == "1")
            {
                ClientManager.StartConnectionChecker();
            }
            DateTime Now = DateTime.Now;

            Logging.Write("Connecting to database...");
            using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
            {
                Logging.WriteLine("completed!");
                PhoenixEnvironment.GameInstance = this;
                LoadSettings(adapter);
                BanManager           = new ModerationBanManager();
                RoleManager          = new RoleManager();
                HelpTool             = new HelpTool();
                Catalog              = new Catalog();
                Navigator            = new Navigator();
                ItemManager          = new ItemManager();
                RoomManager          = new RoomManager();
                AdvertisementManager = new AdvertisementManager();
                PixelManager         = new PixelManager();
                AchievementManager   = new AchievementManager();
                ModerationTool       = new ModerationTool();
                BotManager           = new BotManager();
                Marketplace          = new Marketplace();
                QuestManager         = new QuestManager();
                TextManage           = new TextManager();
                Guilds = new GroupManager();
                TextManager.LoadTexts(adapter);
                BanManager.LoadBans(adapter);
                RoleManager.LoadRoles(adapter);
                HelpTool.LoadCategories(adapter);
                HelpTool.LoadTopics(adapter);
                ModerationTool.LoadMessagePresets(adapter);
                ModerationTool.LoadPendingTickets(adapter);
                ItemManager.LoadItems(adapter);
                Catalog.Initialize(adapter);
                Catalog.InitCache();
                Navigator.Initialize(adapter);
                RoomManager.LoadModels(adapter);
                RoomManager.LoadCache();
                NavigatorCache = new NavigatorCache();
                AdvertisementManager.LoadRoomAdvertisements(adapter);
                BotManager.LoadBots(adapter);
                AchievementManager.LoadAchievements(adapter);
                PixelManager.Start();
                ChatCommandHandler.InitFilter(adapter);
                QuestManager.InitQuests();
                GroupManager.LoadGroups(adapter);
                DatabaseCleanup(adapter, 1);
            }
            Task = new Task(new Action(LowPriorityWorker.Process));
            Task.Start();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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!");
        }