private static void Load() { DSContents.QuestInfo = HeroesContentsLoader.GetTable <QuestInfo>().ToDictionary((QuestInfo x) => x.ID); DSContents.QuestLevelConstraint = (from x in HeroesContentsLoader.GetTable <QuestDifficultyInfo>() where ServiceCore.FeatureMatrix.IsEnable(x.Feature) && x.Difficulty == 2 select x).ToDictionary((QuestDifficultyInfo x) => x.QuestID, (QuestDifficultyInfo x) => x.MinLevel); }
public static void Init() { List <TodayMissionGoalInfo> list = HeroesContentsLoader.GetTable <TodayMissionGoalInfo>().ToList <TodayMissionGoalInfo>(); foreach (TodayMissionGoalInfo todayMissionGoalInfo in list) { Regex key = new Regex(todayMissionGoalInfo.MissionGoal, RegexOptions.IgnoreCase | RegexOptions.Compiled); if (!TodayMission.TodayMissionGoalInfo.ContainsKey(key)) { TodayMission.TodayMissionGoalInfo.Add(key, new List <TodayMissionGoalInfo>()); } TodayMission.TodayMissionGoalInfo[key].Add(todayMissionGoalInfo); } }
private static void Load() { GuildContents.GuildLevelUpInfoDic = (from x in HeroesContentsLoader.GetTable<GuildLevelUpInfo>() where ServiceCore.FeatureMatrix.IsEnable(x.Feature) select x).ToDictionary((GuildLevelUpInfo x) => x.Level, (GuildLevelUpInfo x) => x); foreach (GuildLevelUpInfo guildLevelUpInfo in GuildContents.GuildLevelUpInfoDic.Values) { guildLevelUpInfo.RequiredExp *= 10L; } GuildContents.LoadGuildDailyGPLimit(); if (ServiceCore.FeatureMatrix.IsEnable("GuildHeroesCore_v1")) { GuildContents.LoadGuildForbiddenWords(); return; } Log<GuildContents>.Logger.WarnFormat("doesn't need to load GuildForbiddenWords while using PlatformAPI(GuildHeroesCore_v1 feautre is off).", new object[0]); }
private static void LoadGuildForbiddenWords() { GuildContents.GuildForbiddenWords = new List<string>(); try { List<GuildForbiddenWords> list = (from x in HeroesContentsLoader.GetTable<GuildForbiddenWords>() where x.Language.Equals(ServiceCore.FeatureMatrix.GetString("LanguageTag"), StringComparison.OrdinalIgnoreCase) select x).ToList<GuildForbiddenWords>(); foreach (GuildForbiddenWords guildForbiddenWords in list) { GuildContents.GuildForbiddenWords.Add(guildForbiddenWords.ForbiddenName); } } catch (Exception ex) { Log<GuildContents>.Logger.ErrorFormat("No GuildForbidenWords. check LoadGuildForbiddenWords in code and data : error - {0}", ex.Message); } }
public void Initialize() { AllUserGoal.AllUserGoalDicByGoal.Clear(); AllUserGoal.AllUserGoalDicBySlotID.Clear(); AllUserGoal.AllUserGoalDicByID.Clear(); AllUserGoal.RefreshEventSlot.Clear(); List <AllUserGoalInfo> list = (from x in HeroesContentsLoader.GetTable <AllUserGoalInfo>() where ServiceCore.FeatureMatrix.IsEnable(x.Feature) && ServiceCore.FeatureMatrix.IsMatchServerCode(x.ServerCode) select x).ToList <AllUserGoalInfo>(); foreach (AllUserGoalInfo allUserGoalInfo in list) { Regex key = new Regex(allUserGoalInfo.Goal, RegexOptions.IgnoreCase | RegexOptions.Compiled); if (!AllUserGoal.AllUserGoalDicByGoal.ContainsKey(key)) { AllUserGoal.AllUserGoalDicByGoal.Add(key, new List <AllUserGoalData>()); } AllUserGoalData allUserGoalData = new AllUserGoalData(allUserGoalInfo); if (AllUserGoal.AllUserGoalDicByGoal.ContainsKey(key)) { AllUserGoal.AllUserGoalDicByGoal[key].Add(allUserGoalData); AllUserGoal.AllUserGoalDicByID.Add(allUserGoalData.GoalID, allUserGoalData); } if (!AllUserGoal.AllUserGoalDicBySlotID.ContainsKey(allUserGoalInfo.SlotID)) { AllUserGoal.AllUserGoalDicBySlotID.Add(allUserGoalInfo.SlotID, new List <AllUserGoalData>()); AllUserGoal.AllUserGoalDicBySlotID[allUserGoalInfo.SlotID].Add(allUserGoalData); } else { AllUserGoal.AllUserGoalDicBySlotID[allUserGoalInfo.SlotID].Add(allUserGoalData); } if (!AllUserGoal.RefreshEventSlot.ContainsKey(allUserGoalInfo.StartTime)) { AllUserGoal.RefreshEventSlot.Add(allUserGoalInfo.StartTime, new List <AllUserGoalData>()); AllUserGoal.RefreshEventSlot[allUserGoalInfo.StartTime].Add(allUserGoalData); } else { AllUserGoal.RefreshEventSlot[allUserGoalInfo.StartTime].Add(allUserGoalData); } } }
private static bool LoadFeatureMatrix() { bool result; lock (FeatureMatrix.featureLock) { if (FeatureMatrix.featureMatrixLoaded) { result = false; } else { FeatureMatrix.gameCodeMap = HeroesContentsLoader.GetGameCode(); FeatureMatrix.featureMap = HeroesContentsLoader.GetFeatureMatrix(FeatureMatrix.LangTag); FeatureMatrix.featureMatrixLoaded = true; if (FeatureMatrix.GetString("OverrideSetting").Length > 0) { Dictionary <string, string> featureMatrix = HeroesContentsLoader.GetFeatureMatrix(FeatureMatrix.GetString("OverrideSetting")); foreach (KeyValuePair <string, string> keyValuePair in featureMatrix) { string key = keyValuePair.Key; if (key != "GameCode" && key != "CurrentVer" && key != "OverrideSetting") { FeatureMatrix.featureMap[key] = keyValuePair.Value; } } } if (ServiceCoreSettings.Default.NGM_Disable != "-1") { FeatureMatrix.overrideMap["NGM_disable"] = ServiceCoreSettings.Default.NGM_Disable; } result = true; } } return(result); }
static ConnectionStringLoader() { Log <ConnectionStringLoader> .Logger.Info("Testing Contents DB Connection..."); HeroesContentsLoader.TestConnection(); }
private static void Load() { AdminContents.EventTemplate = HeroesContentsLoader.GetTable <EventTemplate>().ToDictionary((EventTemplate x) => x.Name); }
public static void Load() { MMOChannelContents.BurnJackpot = (from x in HeroesContentsLoader.GetTable <BurnJackpot>() where ServiceCore.FeatureMatrix.IsEnable(x.Feature) select x).ToList <BurnJackpot>(); }
public override void Initialize(JobProcessor thread) { ConnectionStringLoader.LoadFromServiceCore(Settings.Default); base.Initialize(thread, CashShopServiceOperations.TypeConverters); base.RegisterMessage(OperationMessages.TypeConverters); base.RegisterProcessor(typeof(NotifyCashShopUserInfo), (Operation x) => new NotifyCashShopUserInfoProcessor(this, x as NotifyCashShopUserInfo)); base.RegisterProcessor(typeof(NotifyCashShopCID), (Operation x) => new NotifyCashShopCIDProcessor(this, x as NotifyCashShopCID)); base.RegisterProcessor(typeof(QueryCashShopBalance), (Operation x) => new QueryCashShopBalanceProcessor(this, x as QueryCashShopBalance)); base.RegisterProcessor(typeof(QueryCashShopInventory), (Operation x) => new QueryCashShopInventoryProcessor(this, x as QueryCashShopInventory)); base.RegisterProcessor(typeof(QueryCashShopItemPickUp), (Operation x) => new QueryCashShopItemPickUpProcessor(this, x as QueryCashShopItemPickUp)); base.RegisterProcessor(typeof(QueryCashShopPurchaseItem), (Operation x) => new QueryCashShopPurchaseItemProcessor(this, x as QueryCashShopPurchaseItem)); base.RegisterProcessor(typeof(QueryCashShopProductList), (Operation x) => new QueryCashShopProductListProcessor(this, x as QueryCashShopProductList)); base.RegisterProcessor(typeof(StopCashShop), (Operation x) => new StopCashShopProcessor(this, x as StopCashShop)); base.RegisterProcessor(typeof(QueryCashShopPurchaseGift), (Operation x) => new QueryCashShopPurchaseGiftProcessor(this, x as QueryCashShopPurchaseGift)); base.RegisterProcessor(typeof(RequestGoddessProtection), (Operation x) => new RequestGoddessProtectionProcessor(this, x as RequestGoddessProtection)); base.RegisterProcessor(typeof(DirectPickUp), (Operation x) => new DirectPickUpProcessor(this, x as DirectPickUp)); base.RegisterProcessor(typeof(QueryCashShopGiftSender), (Operation x) => new QueryCashShopGiftSenderProcessor(this, x as QueryCashShopGiftSender)); base.RegisterProcessor(typeof(RollbackDirectPickUp), (Operation x) => new RollbackDirectPickUpProcessor(this, x as RollbackDirectPickUp)); base.RegisterProcessor(typeof(DirectPickUpByProductNo), (Operation x) => new DirectPickUpByProductNoProcessor(this, x as DirectPickUpByProductNo)); base.RegisterProcessor(typeof(QueryCashShopRefund), (Operation x) => new QueryCashShopRefundProcessor(this, x as QueryCashShopRefund)); base.RegisterProcessor(typeof(QueryBeautyShopInfo), (Operation x) => new QueryBeautyShopInfoProcessor(this, x as QueryBeautyShopInfo)); base.RegisterProcessor(typeof(QueryCashShopProductInfo), (Operation x) => new QueryCashShopProductInfoProcessor(this, x as QueryCashShopProductInfo)); base.RegisterProcessor(typeof(QueryCashShopProductInfoByCashShopKey), (Operation x) => new QueryCashShopProductInfoByCashShopKeyProcessor(this, x as QueryCashShopProductInfoByCashShopKey)); base.RegisterProcessor(typeof(WishListSelect), (Operation x) => new WishListSelectProcessor(this, x as WishListSelect)); base.RegisterProcessor(typeof(WishListInsert), (Operation x) => new WishListInsertProcessor(this, x as WishListInsert)); base.RegisterProcessor(typeof(WishListDelete), (Operation x) => new WishListDeleteProcessor(this, x as WishListDelete)); this.IsCashShopStopped = false; ServiceCore.FeatureMatrix.GetString(""); this.IsCashShopServiceUseable = (ServiceCore.FeatureMatrix.LangTag != "KO-KR-X-DEV"); string text = ServiceCore.FeatureMatrix.GetString("NISMSEncodingType"); if (text == "") { text = "Default"; Log <CashShopService> .Logger.WarnFormat("can't find NISMSEncodingType feature. EncodingType will set {0} type.", text); } this.Connection = new Connection(text); this.Connection.CategoryArrayChanged += this.Connection_CategoryArrayChanged; this.Connection.ProductArrayChanged += this.Connection_ProductArrayChanged; this.Connection.Disconnected += delegate(object sender, EventArgs e) { Log <CashShopService> .Logger.Fatal("CashShop Disconnected!"); if (this.IsCashShopServiceUseable) { Scheduler.Schedule(base.Thread, Job.Create <bool>(new Action <bool>(this.connectToCashShop), true), 60000); } }; this.Connection.ConnectionFail += delegate(object sender, EventArgs <Exception> e) { Log <CashShopService> .Logger.Fatal("CashShop Connection Failed..."); Scheduler.Schedule(base.Thread, Job.Create <bool>(new Action <bool>(this.connectToCashShop), true), 60000); }; this.Connection.ConnectionSucceed += delegate(object sender, EventArgs e) { Log <CashShopService> .Logger.Info("CashShop Connected."); this.IsCashShopServiceUseable = true; }; Scheduler.Schedule(base.Thread, Job.Create <bool>(new Action <bool>(this.connectToCashShop), false), 0); if (ServiceCore.FeatureMatrix.IsEnable("BeautyShopItemSyncNISMS")) { try { string cashShopType = ServiceCore.FeatureMatrix.GetString("LanguageTag"); this.CustomizeCouponInfoList = (from x in HeroesContentsLoader.GetTable <CustomizeItemInfo>() where (x.Weight == -1 || x.Weight == -2) && (x.CashShopType ?? cashShopType) == cashShopType select x).ToList <CustomizeItemInfo>(); foreach (CustomizeItemInfo customizeItemInfo in this.CustomizeCouponInfoList) { BeautyShopCouponListElement item = new BeautyShopCouponListElement(customizeItemInfo.Category, customizeItemInfo.ItemClass, customizeItemInfo.Weight); this.BeautyShopCouponList.Add(item); } this.ItemClassInfoDic = (from x in HeroesContentsLoader.GetTable <ItemClassInfo>() where ServiceCore.FeatureMatrix.IsEnable(x.Feature) select x).ToDictionary_OverwriteDuplicated((ItemClassInfo x) => x.ItemClass); } catch (Exception ex) { Log <CashShopService> .Logger.Error(ex); } } WishListManager function = new WishListManager(this); base.RegisterFunction <WishListManager>(function); }
private static void Load() { ServiceCoreContents.LocalizedTextDic = HeroesContentsLoader.GetTable <LocalizedText>().ToDoubleDictionary((LocalizedText x) => x.Lang.ToLower(), (LocalizedText x) => x.Key.ToLower(), (LocalizedText x) => x.Value); ServiceCoreContents.LocalizedText = HeroesContentsLoader.GetTable <LocalizedText>().ToList <LocalizedText>(); ServiceCoreContents.ServerConstants = HeroesContentsLoader.GetTable <ServerConstants>().ToDictionary((ServerConstants x) => x.Property); }