Пример #1
0
 public override bool OnUse(GameClient session, string[] args)
 {
     if (session.GetHabbo().HasPermission("cmd_update_filter"))
     {
         using (DatabaseClient dbClient = Skylight.GetDatabaseManager().GetClient())
         {
             TextUtilies.LoadWordfilter(dbClient);
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Пример #2
0
        public void Init()
        {
            using (DatabaseClient dbClient = Skylight.GetDatabaseManager().GetClient())
            {
                ServerConfiguration.LoadConfigsFromDB(dbClient);

                this.GameClientManager = new GameClientManager();

                this.NavigatorManager = new NavigatorManager();
                this.NavigatorManager.LoadPublicRooms(dbClient);
                this.NavigatorManager.LoadFlatCats(dbClient);

                this.RoomManager = new RoomManager();
                this.RoomManager.LoadRoomModels(dbClient);
                this.RoomManager.LoadNewbieRooms(dbClient);

                this.ItemManager = new ItemManager();
                this.ItemManager.LoadItems(dbClient);
                this.ItemManager.LoadSoundtracks(dbClient);
                this.ItemManager.LoadNewbieRoomItems(dbClient);

                this.CatalogManager = new CatalogManager();
                this.CatalogManager.LoadCatalogItems(dbClient);
                this.CatalogManager.LoadCatalogPages(dbClient);
                this.CatalogManager.LoadPetRaces(dbClient);
                this.CatalogManager.LoadPresents(dbClient);

                this.CatalogManager.GetMarketplaceManager().LoadMarketplaceOffers(dbClient);

                this.PermissionManager = new PermissionManager();
                this.PermissionManager.LoadRanks(dbClient);

                this.BanManager = new BanManager();
                this.BanManager.LoadBans(dbClient);

                this.ModerationToolManager = new ModerationToolManager();
                this.ModerationToolManager.LoadIssues(dbClient);
                this.ModerationToolManager.LoadPresents(dbClient);
                this.ModerationToolManager.LoadSupportTickets(dbClient);

                this.CautionManager = new CautionManager();
                this.CautionManager.LoadCauctions(dbClient);

                this.HelpManager = new HelpManager();
                this.HelpManager.LoadFAQs(dbClient);

                this.ChatlogManager = new ChatlogManager();

                this.RoomvisitManager = new RoomvisitManager();

                this.AchievementManager = new AchievementManager();
                this.AchievementManager.LoadAchievements(dbClient);

                this.BotManager = new BotManager();
                this.BotManager.LoadBots(dbClient);
                this.BotManager.LoadNewbieBotActions(dbClient);

                TextUtilies.LoadWordfilter(dbClient);

                this.QuestManager = new QuestManager();
                this.QuestManager.LoadQuests(dbClient);

                this.TalentManager = new TalentManager();
                this.TalentManager.LoadTalents(dbClient);

                this.FastFoodManager = new FastFoodManager();
                this.FastFoodManager.CreateNewConnection();

                this.UserProfileManager = new UserProfileManager();

                this.GuideManager = new GuideManager();
            }

            this.ClientPingEnabled = TextUtilies.StringToBool(Skylight.GetConfig()["client.ping.enabled"]);

            this.AutoRestartEnabled = TextUtilies.StringToBool(Skylight.GetConfig()["auto.restart.enabled"]);
            if (this.AutoRestartEnabled)
            {
                this.AutoRestartBackup         = TextUtilies.StringToBool(Skylight.GetConfig()["auto.restart.backup"]);
                this.AutoRestartBackupCompress = TextUtilies.StringToBool(Skylight.GetConfig()["auto.restart.backup.compress"]);
                this.AutoRestartTime           = DateTime.ParseExact(Skylight.GetConfig()["auto.restart.time"], "HH:mm", CultureInfo.InvariantCulture);
            }

            this.LastUpdateEmulatorStatus = Stopwatch.StartNew();
            this.LastActivityBonusesCheck = Stopwatch.StartNew();
            this.LastTimeoutCheck         = Stopwatch.StartNew();

            this.GameCycleTimer           = new System.Timers.Timer();
            this.GameCycleTimer.Elapsed  += this.GameCycle;
            this.GameCycleTimer.AutoReset = true;
            this.GameCycleTimer.Interval  = 1; //moved from 25ms, 40 times in a second to 1ms, 1000 times in second to help keep everything be in sync
            this.GameCycleTimer.Start();
            GC.KeepAlive(this.GameCycleTimer); //IK timer adds itself to the gc already, but just for sure ;P
        }