Пример #1
0
        public Game()
        {
            ClientManager = new GameClientManager();

            if (UberEnvironment.GetConfig().data["client.ping.enabled"] == "1")
            {
                ClientManager.StartConnectionChecker();
            }

            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();

            BanManager.LoadBans();
            RoleManager.LoadRoles();
            RoleManager.LoadRights();
            HelpTool.LoadCategories();
            HelpTool.LoadTopics();
            Catalog.Initialize();
            Navigator.Initialize();
            ItemManager.LoadItems();
            RoomManager.LoadModels();
            AdvertisementManager.LoadRoomAdvertisements();
            PixelManager.Start();
            AchievementManager.LoadAchievements();
            ModerationTool.LoadMessagePresets();
            ModerationTool.LoadPendingTickets();
            BotManager.LoadBots();

            DatabaseCleanup(1);

            StatisticsThread = new Thread(LowPriorityWorker.Process);
            StatisticsThread.Name = "Low Priority Worker";
            StatisticsThread.Priority = ThreadPriority.Lowest;
            StatisticsThread.Start();

               // UberEnvironment.GetLogging().WriteLine("Initialized - " + Version);
        }
Пример #2
0
        public void Destroy()
        {
            if (StatisticsThread != null)
            {
                try
                {
                    StatisticsThread.Abort();
                }

                catch (ThreadAbortException) { }

                StatisticsThread = null;
            }

            DatabaseCleanup(0);

            if (GetClientManager() != null)
            {
                GetClientManager().Clear();
                GetClientManager().StopConnectionChecker();
            }

            if (GetPixelManager() != null)
            {
                PixelManager.KeepAlive = false;
            }

            ClientManager = null;
            BanManager = null;
            RoleManager = null;
            HelpTool = null;
            Catalog = null;
            Navigator = null;
            ItemManager = null;
            RoomManager = null;
            AdvertisementManager = null;
            PixelManager = null;

            UberEnvironment.GetLogging().WriteLine("Destroyed.");
        }