Пример #1
0
        public static void Initialize(SqlDatabaseClient MySqlClient)
        {
            mFlatCategories = new List<FlatCategory>();
            mOfficialItems = new List<NavigatorOfficialItem>();
            mEventSearchQueries = new Dictionary<string, int>();

            if ((bool)ConfigManager.GetValue("cache.navigator.enabled"))
            {
                mCacheController = new ResponseCacheController((int)ConfigManager.GetValue("cache.navigator.lifetime"));
            }

            ReloadFlatCategories(MySqlClient);
            ReloadOfficialItems(MySqlClient);

            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_CATEGORIES, new ProcessRequestCallback(GetCategories));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_OFFICIAL_ROOMS, new ProcessRequestCallback(GetOfficialRooms));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_EVENTS, new ProcessRequestCallback(GetEventRooms));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_FAVORITE_ROOMS, new ProcessRequestCallback(GetFavoriteRooms));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_FRIENDS_ROOMS, new ProcessRequestCallback(GetFriendsRooms));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_POPULAR_ROOMS, new ProcessRequestCallback(GetPopularRooms));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_RATED_ROOMS, new ProcessRequestCallback(GetRatedRooms));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_RECENT_ROOMS, new ProcessRequestCallback(GetRecentRooms));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_ROOMS_WITH_FRIENDS, new ProcessRequestCallback(GetRoomsWithFriends));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_USER_ROOMS, new ProcessRequestCallback(GetUserRooms));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_GET_POPULAR_TAGS, new ProcessRequestCallback(GetPopularTags));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_ADD_FAVORITE, new ProcessRequestCallback(AddFavorite));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_REMOVE_FAVORITE, new ProcessRequestCallback(RemoveFavorite));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_SEARCH, new ProcessRequestCallback(PerformSearch));
            DataRouter.RegisterHandler(OpcodesIn.NAVIGATOR_SEARCH_TAGS, new ProcessRequestCallback(PerformSearch));
            DataRouter.RegisterHandler(OpcodesIn.FRIEND_BAR_FIND_NEW_FRIENDS, new ProcessRequestCallback(FindNewFriends));
        }
Пример #2
0
        public static void Initialize(SqlDatabaseClient MySqlClient)
        {
            mPages = new Dictionary<int, CatalogPage>();
            mCatalogItems = new Dictionary<int, List<CatalogItem>>();
            mCatalogItemsIdIndex = new Dictionary<uint, CatalogItem>();
            mCatalogItemsNameIndex = new Dictionary<string, CatalogItem>();
            mClubOffers = new Dictionary<uint, CatalogClubOffer>();

            if ((bool)ConfigManager.GetValue("cache.catalog.enabled"))
            {
                mCacheController = new ResponseCacheController((int)ConfigManager.GetValue("cache.catalog.lifetime"));
            }

            RefreshCatalogData(MySqlClient, false);

            DataRouter.RegisterHandler(OpcodesIn.CATALOG_GET_INDEX, new ProcessRequestCallback(GetCatalogIndex));
            DataRouter.RegisterHandler(OpcodesIn.CATALOG_GET_PAGE, new ProcessRequestCallback(GetCatalogPage));
            DataRouter.RegisterHandler(OpcodesIn.CATALOG_GET_CLUB_OFFERS, new ProcessRequestCallback(GetClubOffers));
            DataRouter.RegisterHandler(OpcodesIn.CATALOG_REDEEM_VOUCHER, new ProcessRequestCallback(RedeemVoucher));
            DataRouter.RegisterHandler(OpcodesIn.CATALOG_GET_PET_DATA, new ProcessRequestCallback(GetPetData));
            DataRouter.RegisterHandler(OpcodesIn.CATALOG_VERIFY_PET_NAME, new ProcessRequestCallback(CheckPetName));
        }