Exemplo n.º 1
0
        /// <summary>
        /// Constructs a Habbo Hotel environment and tries to initialize it.
        /// </summary>
        public HabboHotel()
        {
            // Try to parse version
            AleedaEnvironment.Configuration.TryParseUInt32("projects.habbo.client.version", out mVersion);

            // Initialize HabboHotel project modules
            mExternalTexts      = new KeyValueDictionary("external_texts", "xkey", "xvalue");
            mExternalVariables  = new KeyValueDictionary("external_variables", "xkey", "xvalue");
            mClientManager      = new GameClientManager();
            mHabboManager       = new HabboManager();
            mAuthenticator      = new HabboAuthenticator();
            mAchievementManager = new AchievementManager();
            mMessengerManager   = new MessengerManager();
            mCatalog            = new Catalog.Catalog();
            mRoomUser           = new RoomUser();

            // Start connection checker for clients
            mClientManager.StartConnectionChecker();

            // Load external texts and external variables
            mExternalTexts.Reload();
            mExternalVariables.Reload();


            // Print that we are done!
            Console.WriteLine(string.Format(" [**] --> Initialized project 'Habbo Hotel' for version R{0}.", mVersion));
        }
Exemplo n.º 2
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();
        }