public void On_GM(GameClient client, string[] cmdFields) { if (cmdFields != null && cmdFields.Length >= 2) { if (cmdFields[1] == "reload") { SingletonTemplate <SevenDayActivityMgr> .Instance().LoadConfig(); } else if (cmdFields[1] == "get" && client != null) { if (cmdFields.Length >= 4) { this.HandleGetAward(client, 1311, null, new string[] { client.ClientData.RoleID.ToString(), cmdFields[2], cmdFields[3] }); } } else if (cmdFields[1] == "buy" && client != null) { if (cmdFields.Length >= 4) { this.HandleClientBuy(client, 1312, null, new string[] { client.ClientData.RoleID.ToString(), cmdFields[2], cmdFields[3] }); } } } }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(20319, SingletonTemplate <ZuoQiManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(20320, SingletonTemplate <ZuoQiManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(20321, SingletonTemplate <ZuoQiManager> .Instance()); return(true); }
public static void initialize() { ZhanMengShiJianManager.getInstance().initialize(); JingJiChangManager.getInstance().initialize(); WanMoTaManager.getInstance().initialize(); WingPaiHangManager.getInstance().initialize(); RingPaiHangManager.getInstance().initialize(); MerlinRankManager.getInstance().initialize(); CmdRegisterTriggerManager.getInstance().initialize(); TianTiDbCmdProcessor.getInstance().registerProcessor(); SingletonTemplate <SevenDayActivityManager> .Instance().initialize(); SingletonTemplate <FundManager> .Instance().initialize(); SingletonTemplate <UserReturnManager> .Instance().initialize(); SingletonTemplate <OlympicsManager> .Instance().initialize(); SingletonTemplate <ShenJiManager> .Instance().initialize(); SingletonTemplate <TradeBlackManager> .Instance().initialize(); SingletonTemplate <KingRoleDataManager> .Instance().initialize(); SingletonTemplate <AlchemyManager> .Instance().initialize(); SingletonTemplate <ZhengBaManager> .Instance().initialize(); SingletonTemplate <CoupleArenaDbManager> .Instance().initialize(); SingletonTemplate <AllyManager> .Instance().initialize(); SingletonTemplate <AoYunDaTiManager> .Instance().initialize(); SingletonTemplate <YaoSaiBossManager> .Instance().initialize(); SingletonTemplate <RoleManager> .Instance().initialize(); SingletonTemplate <YaoSaiMissionManager> .Instance().initialize(); SingletonTemplate <HongBaoManager> .Instance().initialize(); SingletonTemplate <HuiJiManager> .Instance().initialize(); SingletonTemplate <ShenShiManager> .Instance().initialize(); SingletonTemplate <JueXingManager> .Instance().initialize(); SingletonTemplate <ZuoQiManager> .Instance().initialize(); SingletonTemplate <ArmorManager> .Instance().initialize(); SingletonTemplate <JingLingYuanSuJueXingManager> .Instance().initialize(); SingletonTemplate <BianShenManager> .Instance().initialize(); AssemblyPatchManager.getInstance().initialize(); GlodAuctionMsgProcess.getInstance().initialize(); BoCaiManager.getInstance().initialize(); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(13230, SingletonTemplate <KingRoleDataManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13231, SingletonTemplate <KingRoleDataManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13232, SingletonTemplate <KingRoleDataManager> .Instance()); return(true); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(13220, SingletonTemplate <SevenDayActivityManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13221, SingletonTemplate <SevenDayActivityManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13222, SingletonTemplate <SevenDayActivityManager> .Instance()); return(true); }
public void Update(GameClient client) { if (client != null) { int currDay; if (SingletonTemplate <SevenDayActivityMgr> .Instance().IsInActivityTime(client, out currDay)) { Dictionary <int, SevenDayItemData> actData = SingletonTemplate <SevenDayActivityMgr> .Instance().GetActivityData(client, ESevenDayActType.Login); lock (actData) { if (!actData.ContainsKey(currDay)) { SevenDayItemData itemData = new SevenDayItemData(); itemData.AwardFlag = 0; itemData.Params1 = 1; if (SingletonTemplate <SevenDayActivityMgr> .Instance().UpdateDb(client.ClientData.RoleID, ESevenDayActType.Login, currDay, itemData, client.ServerId)) { actData[currDay] = itemData; } } } } } }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(20311, SingletonTemplate <YaoSaiMissionManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(20312, SingletonTemplate <YaoSaiMissionManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(20313, SingletonTemplate <YaoSaiMissionManager> .Instance()); return(true); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(1382, SingletonTemplate <CoupleArenaDbManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(1371, SingletonTemplate <CoupleArenaDbManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(1383, SingletonTemplate <CoupleArenaDbManager> .Instance()); return(true); }
public void LoadDatabase(MySQLConnectionString connstr, int MaxConns, int codePage) { TianMaCharSet.ConvertToCodePage = codePage; this._DBConns.BuidConnections(connstr, MaxConns); MySQLConnection conn = this._DBConns.PopDBConnection(); try { GameDBManager.BulletinMsgMgr.LoadBulletinMsgFromDB(this); GameDBManager.GameConfigMgr.LoadGameConfigFromDB(this); LiPinMaManager.LoadLiPinMaDB(this); PreNamesManager.LoadPremNamesFromDB(this); FuBenHistManager.LoadFuBenHist(this); PaiHangManager.ProcessPaiHang(this, true); GameDBManager.BangHuiJunQiMgr.LoadBangHuiJunQiItemFromDB(this); GameDBManager.PreDelRoleMgr.LoadPreDeleteRoleFromDB(this); GameDBManager.BangHuiLingDiMgr.LoadBangHuiLingDiItemsDictFromDB(this); HuangDiTeQuanMgr.LoadHuangDiTeQuan(this); GameDBManager.MarryPartyDataC.LoadPartyList(this); SingletonTemplate <NameUsedMgr> .Instance().LoadFromDatabase(this); GameDBManager.BangHuiListMgr.RefreshBangHuiListData(this); BanManager.GmBanCheckClear(this); FuMoMailManager.getInstance().LoadFuMoInfoFromDB(this); RebornStampManager.InitRebornYinJi(this); GlodAuctionMsgProcess.getInstance().LoadDataFromDB(this); BoCaiManager.getInstance().LoadDataFromDB(this); } finally { this._DBConns.PushDBConnection(conn); } this.CreateMemTables(); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessorEx(1310, 2, 2, SingletonTemplate <SevenDayActivityMgr> .Instance(), TCPCmdFlags.IsStringArrayParams); TCPCmdDispatcher.getInstance().registerProcessorEx(1311, 3, 3, SingletonTemplate <SevenDayActivityMgr> .Instance(), TCPCmdFlags.IsStringArrayParams); TCPCmdDispatcher.getInstance().registerProcessorEx(1312, 3, 3, SingletonTemplate <SevenDayActivityMgr> .Instance(), TCPCmdFlags.IsStringArrayParams); GlobalEventSource.getInstance().registerListener(32, SingletonTemplate <SevenDayActivityMgr> .Instance()); return(true); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(14123, SingletonTemplate <RebornEquip> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(14124, SingletonTemplate <RebornEquip> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(14125, SingletonTemplate <RebornEquip> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(14126, SingletonTemplate <RebornEquip> .Instance()); return(true); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(10230, SingletonTemplate <RoleManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(10232, SingletonTemplate <RoleManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(10233, SingletonTemplate <RoleManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(694, SingletonTemplate <RoleManager> .Instance()); return(true); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(13116, SingletonTemplate <FundManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13117, SingletonTemplate <FundManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13118, SingletonTemplate <FundManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13119, SingletonTemplate <FundManager> .Instance()); return(true); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(20306, SingletonTemplate <YaoSaiBossManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(20307, SingletonTemplate <YaoSaiBossManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(20308, SingletonTemplate <YaoSaiBossManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(20309, SingletonTemplate <YaoSaiBossManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(20310, SingletonTemplate <YaoSaiBossManager> .Instance()); return(true); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(13124, SingletonTemplate <OlympicsManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13125, SingletonTemplate <OlympicsManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13126, SingletonTemplate <OlympicsManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13127, SingletonTemplate <OlympicsManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13128, SingletonTemplate <OlympicsManager> .Instance()); return(true); }
public bool showdown() { GlobalEventSource4Scene.getInstance().removeListener(10000, 29, SingletonTemplate <MoRiJudgeManager> .Instance()); GlobalEventSource4Scene.getInstance().removeListener(10001, 29, SingletonTemplate <MoRiJudgeManager> .Instance()); GlobalEventSource4Scene.getInstance().removeListener(10004, 29, SingletonTemplate <MoRiJudgeManager> .Instance()); GlobalEventSource4Scene.getInstance().removeListener(10005, 29, SingletonTemplate <MoRiJudgeManager> .Instance()); GlobalEventSource.getInstance().removeListener(11, SingletonTemplate <MoRiJudgeManager> .Instance()); return(true); }
public bool NotifyUserEnter(LoginWaitLogic.UserInfo userInfo) { try { if (null == userInfo) { return(true); } if (userInfo.socket == null || !userInfo.socket.Connected) { return(true); } this.AddToAllow(userInfo.userID, this.GetConfig(LoginWaitLogic.UserType.Normal, LoginWaitLogic.ConfigType.AllowMSeconds)); if (!userInfo.socket.IsKuaFuLogin) { ChangeNameInfo info = SingletonTemplate <NameManager> .Instance().GetChangeNameInfo(userInfo.userID, userInfo.zoneID, userInfo.socket.ServerId); if (info != null) { Global._TCPManager.MySocketListener.SendData(userInfo.socket, DataHelper.ObjectToTCPOutPacket <ChangeNameInfo>(info, Global._TCPManager.TcpOutPacketPool, 14002), true); } } } catch (Exception ex) { DataHelper.WriteExceptionLogEx(ex, string.Format("LoginWaitLogic::NotifyUserEnter userID={0} zoneID={1}", userInfo.userID, userInfo.zoneID)); return(false); } string strData = ""; try { string strcmd = string.Format("{0}:{1}", userInfo.userID, userInfo.zoneID); byte[] bytesData = Global.SendAndRecvData <string>(101, strcmd, userInfo.socket.ServerId, 0); int length = BitConverter.ToInt32(bytesData, 0); strData = new UTF8Encoding().GetString(bytesData, 6, length - 2); } catch (Exception ex) { DataHelper.WriteExceptionLogEx(ex, string.Format("LoginWaitLogic::NotifyUserEnter 向db请求角色列表 faild! userID={0} zoneID={1}", userInfo.userID, userInfo.zoneID)); strData = "-1:"; } try { TCPOutPacket tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(Global._TCPManager.TcpOutPacketPool, strData, 101); Global._TCPManager.MySocketListener.SendData(userInfo.socket, tcpOutPacket, true); this.m_LastEnterSecs = (TimeUtil.NOW() - userInfo.startTick) / 1000L; this.m_LastEnterFromFirstSecs = (TimeUtil.NOW() - userInfo.firstTick) / 1000L; } catch (Exception ex) { DataHelper.WriteExceptionLogEx(ex, string.Format("LoginWaitLogic::NotifyUserEnter 发送角色列表Faild userID={0} zoneID={1}", userInfo.userID, userInfo.zoneID)); return(false); } return(true); }
private void UserReturnCheckWorker_DoWork(object sender, DoWorkEventArgs e) { try { SingletonTemplate <UserReturnManager> .Instance().ScanLastUserReturn(this._DBManger); } catch (Exception ex) { DataHelper.WriteFormatExceptionLog(ex, "updateFacebook_DoWork", false, false); } }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessorEx(1390, 1, 1, SingletonTemplate <CoupleWishManager> .Instance(), TCPCmdFlags.IsStringArrayParams); TCPCmdDispatcher.getInstance().registerProcessorEx(1391, 1, 1, SingletonTemplate <CoupleWishManager> .Instance(), TCPCmdFlags.IsStringArrayParams); TCPCmdDispatcher.getInstance().registerStreamProcessorEx(1392, SingletonTemplate <CoupleWishManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessorEx(1394, 1, 1, SingletonTemplate <CoupleWishManager> .Instance(), TCPCmdFlags.IsStringArrayParams); TCPCmdDispatcher.getInstance().registerProcessorEx(1395, 3, 3, SingletonTemplate <CoupleWishManager> .Instance(), TCPCmdFlags.IsStringArrayParams); TCPCmdDispatcher.getInstance().registerProcessorEx(1396, 1, 1, SingletonTemplate <CoupleWishManager> .Instance(), TCPCmdFlags.IsStringArrayParams); TCPCmdDispatcher.getInstance().registerProcessorEx(1397, 2, 2, SingletonTemplate <CoupleWishManager> .Instance(), TCPCmdFlags.IsStringArrayParams); return(true); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(14014, SingletonTemplate <ZhengBaManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(14013, SingletonTemplate <ZhengBaManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(14015, SingletonTemplate <ZhengBaManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(14012, SingletonTemplate <ZhengBaManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(14011, SingletonTemplate <ZhengBaManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(14016, SingletonTemplate <ZhengBaManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(14017, SingletonTemplate <ZhengBaManager> .Instance()); return(true); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessorEx(1301, 1, 1, SingletonTemplate <MoRiJudgeManager> .Instance(), TCPCmdFlags.IsStringArrayParams); TCPCmdDispatcher.getInstance().registerProcessorEx(1302, 1, 1, SingletonTemplate <MoRiJudgeManager> .Instance(), TCPCmdFlags.IsStringArrayParams); TCPCmdDispatcher.getInstance().registerProcessorEx(1304, 2, 2, SingletonTemplate <MoRiJudgeManager> .Instance(), TCPCmdFlags.IsStringArrayParams); GlobalEventSource4Scene.getInstance().registerListener(10000, 29, SingletonTemplate <MoRiJudgeManager> .Instance()); GlobalEventSource4Scene.getInstance().registerListener(10001, 29, SingletonTemplate <MoRiJudgeManager> .Instance()); GlobalEventSource4Scene.getInstance().registerListener(10004, 29, SingletonTemplate <MoRiJudgeManager> .Instance()); GlobalEventSource4Scene.getInstance().registerListener(10005, 29, SingletonTemplate <MoRiJudgeManager> .Instance()); GlobalEventSource.getInstance().registerListener(11, SingletonTemplate <MoRiJudgeManager> .Instance()); return(true); }
public bool startup() { TCPCmdDispatcher.getInstance().registerProcessor(13100, SingletonTemplate <UserReturnManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13101, SingletonTemplate <UserReturnManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13102, SingletonTemplate <UserReturnManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13103, SingletonTemplate <UserReturnManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13104, SingletonTemplate <UserReturnManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13105, SingletonTemplate <UserReturnManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13106, SingletonTemplate <UserReturnManager> .Instance()); TCPCmdDispatcher.getInstance().registerProcessor(13107, SingletonTemplate <UserReturnManager> .Instance()); return(true); }
public static void startup() { ZhanMengShiJianManager.getInstance().startup(); JingJiChangManager.getInstance().startup(); LiXianBaiTanManager.getInstance().startup(); LiXianGuaJiManager.getInstance().startup(); CmdRegisterTriggerManager.getInstance().startup(); SendCmdManager.getInstance().startup(); BossAIManager.getInstance().startup(); SaleManager.getInstance().startup(); LianZhiManager.GetInstance().startup(); ChengJiuManager.GetInstance().startup(); UserReturnManager.getInstance().startup(); OlympicsManager.getInstance().startup(); TalentManager.getInstance().startup(); TodayManager.getInstance().startup(); FundManager.getInstance().startup(); WarnManager.getInstance().startup(); PrestigeMedalManager.getInstance().startup(); UnionPalaceManager.getInstance().startup(); UserActivateManager.getInstance().startup(); PetSkillManager.getInstance().startup(); BuildingManager.getInstance().startup(); OnePieceManager.getInstance().startup(); TenManager.getInstance().startup(); SingletonTemplate <SevenDayActivityMgr> .Instance().startup(); SingletonTemplate <SoulStoneManager> .Instance().startup(); lock (GlobalServiceManager.Scene2ManagerDict) { foreach (List <IManager> list in GlobalServiceManager.Scene2ManagerDict.Values) { foreach (IManager i in list) { try { bool success = i.startup(); if (GameManager.ServerStarting && !success) { LogManager.WriteLog(LogTypes.Fatal, string.Format("初始化{0}.startup()失败,按任意键忽略此错误并继续启动服务器!", i.GetType()), null, true); Console.ReadKey(); } } catch (Exception ex) { LogManager.WriteException(ex.ToString()); } } } } FaceBookManager.getInstance().startup(); }
public bool HasAnyAwardCanGet(GameClient client) { bool result; if (client == null) { result = false; } else if (!SingletonTemplate <SevenDayActivityMgr> .Instance().IsInActivityTime(client)) { result = false; } else { Dictionary <int, SevenDayChargeAct._DayAward> tmpDayAwardDict = null; lock (this.ConfigMutex) { tmpDayAwardDict = this.DayAwardDict; } if (tmpDayAwardDict == null) { result = false; } else { Dictionary <int, SevenDayItemData> itemDict = SingletonTemplate <SevenDayActivityMgr> .Instance().GetActivityData(client, ESevenDayActType.Charge); if (itemDict == null) { result = false; } else { lock (itemDict) { foreach (KeyValuePair <int, SevenDayItemData> kvp in itemDict) { int day = kvp.Key; SevenDayItemData itemData = kvp.Value; SevenDayChargeAct._DayAward award = null; if (tmpDayAwardDict.TryGetValue(day, out award) && itemData.Params1 * GameManager.GameConfigMgr.GetGameConfigItemInt("money-to-yuanbao", 10) >= award.NeedCharge && itemData.AwardFlag != 1) { return(true); } } } result = false; } } } return(result); }
public static void destroy() { ZhanMengShiJianManager.getInstance().destroy(); JingJiChangManager.getInstance().destroy(); LiXianBaiTanManager.getInstance().destroy(); LiXianGuaJiManager.getInstance().destroy(); CmdRegisterTriggerManager.getInstance().destroy(); SendCmdManager.getInstance().destroy(); BossAIManager.getInstance().destroy(); SaleManager.getInstance().destroy(); LianZhiManager.GetInstance().destroy(); ChengJiuManager.GetInstance().destroy(); PrestigeMedalManager.getInstance().destroy(); UnionPalaceManager.getInstance().destroy(); UserActivateManager.getInstance().destroy(); PetSkillManager.getInstance().destroy(); UserReturnManager.getInstance().destroy(); OlympicsManager.getInstance().destroy(); TalentManager.getInstance().destroy(); TodayManager.getInstance().destroy(); FundManager.getInstance().destroy(); WarnManager.getInstance().destroy(); MarryFuBenMgr.getInstance().destroy(); BuildingManager.getInstance().destroy(); OnePieceManager.getInstance().destroy(); TenManager.getInstance().destroy(); SingletonTemplate <SevenDayActivityMgr> .Instance().destroy(); SingletonTemplate <SoulStoneManager> .Instance().destroy(); lock (GlobalServiceManager.Scene2ManagerDict) { foreach (List <IManager> list in GlobalServiceManager.Scene2ManagerDict.Values) { foreach (IManager i in list) { try { i.destroy(); } catch (Exception ex) { LogManager.WriteException(ex.ToString()); } } } } FaceBookManager.getInstance().destroy(); }
public bool processCmd(GameClient client, string[] cmdParams) { int nID = 618; int nRoleID = Global.SafeConvertToInt32(cmdParams[0]); WanMotaInfo data = WanMotaCopySceneManager.GetWanMoTaDetail(client, false); bool result; if (null == data) { string strCmd = string.Format("{0}:{1}:{2}:{3}:{4}:{5}:{6}", new object[] { -1, nRoleID, 0, 0, 0, 0, 0 }); client.sendCmd(nID, strCmd, false); result = true; } else { if (data.nPassLayerCount != client.ClientData.WanMoTaNextLayerOrder) { LogManager.WriteLog(LogTypes.Error, string.Format("角色roleid={0} 万魔塔层数不一致 nPassLayerCount={1}, WanMoTaNextLayerOrder={2}", client.ClientData.RoleID, data.nPassLayerCount, client.ClientData.WanMoTaNextLayerOrder), null, true); client.ClientData.WanMoTaNextLayerOrder = data.nPassLayerCount; GameManager.ClientMgr.SaveWanMoTaPassLayerValue(client, data.nPassLayerCount, true); } string strCmd = string.Format("{0}:{1}:{2}:{3}:{4}:{5}:{6}", new object[] { 0, nRoleID, data.nPassLayerCount, data.nTopPassLayerCount, SweepWanMotaManager.GetSweepCount(client), data.nSweepLayer, WanMotaCopySceneManager.WanmotaIsSweeping(client) }); SingletonTemplate <WanMoTaTopLayerManager> .Instance().CheckNeedUpdate(data.nTopPassLayerCount); client.sendCmd(nID, strCmd, false); result = true; } return(result); }
public bool HasAnyCanBuy(GameClient client) { int currDay; bool result; if (!SingletonTemplate <SevenDayActivityMgr> .Instance().IsInActivityTime(client, out currDay)) { result = false; } else { Dictionary <int, SevenDayBuyAct._BuyGoodsData> tmpConfigDict = null; lock (this.ConfigMutex) { if ((tmpConfigDict = this._BuyGoodsDict) == null || tmpConfigDict.Count <= 0) { return(false); } } Dictionary <int, SevenDayItemData> itemDict = SingletonTemplate <SevenDayActivityMgr> .Instance().GetActivityData(client, ESevenDayActType.Buy); lock (itemDict) { foreach (KeyValuePair <int, SevenDayBuyAct._BuyGoodsData> kvp in tmpConfigDict) { SevenDayBuyAct._BuyGoodsData goodsConfig = kvp.Value; if (goodsConfig != null && goodsConfig.Day <= currDay) { int hasBuy = 0; SevenDayItemData itemData = null; if (itemDict.TryGetValue(kvp.Key, out itemData)) { hasBuy = itemData.Params1; } if (goodsConfig.MaxBuyCount > hasBuy) { return(true); } } } } result = false; } return(result); }
public void Update(GameClient client) { if (client != null) { int currDay; if (SingletonTemplate <SevenDayActivityMgr> .Instance().IsInActivityTime(client, out currDay)) { DateTime startDate = Global.GetRegTime(client.ClientData); startDate -= startDate.TimeOfDay; DateTime endDate = startDate.AddDays((double)(currDay - 1)).AddHours(23.0).AddMinutes(59.0).AddSeconds(59.0); StringBuilder sb = new StringBuilder(); sb.Append(client.ClientData.RoleID); sb.Append(':').Append(startDate.ToString("yyyy-MM-dd HH:mm:ss").Replace(':', '$')); sb.Append(':').Append(endDate.ToString("yyyy-MM-dd HH:mm:ss").Replace(':', '$')); Dictionary <string, int> eachDayChargeDict = Global.sendToDB <Dictionary <string, int>, string>(13222, sb.ToString(), client.ServerId); if (eachDayChargeDict != null) { Dictionary <int, SevenDayItemData> itemDict = SingletonTemplate <SevenDayActivityMgr> .Instance().GetActivityData(client, ESevenDayActType.Charge); lock (itemDict) { for (int i = 0; i < 7; i++) { string szKey = startDate.AddDays((double)i).ToString("yyyy-MM-dd"); int charge; if (eachDayChargeDict.TryGetValue(szKey, out charge)) { SevenDayItemData itemData; if (!itemDict.TryGetValue(i + 1, out itemData) || itemData.Params1 != charge) { SevenDayItemData tmpData = new SevenDayItemData(); tmpData.AwardFlag = ((itemData != null) ? itemData.AwardFlag : 0); tmpData.Params1 = charge; if (SingletonTemplate <SevenDayActivityMgr> .Instance().UpdateDb(client.ClientData.RoleID, ESevenDayActType.Charge, i + 1, tmpData, client.ServerId)) { itemDict[i + 1] = tmpData; } } } } } } } } }
public static void destroy() { ZhanMengShiJianManager.getInstance().destroy(); JingJiChangManager.getInstance().destroy(); WanMoTaManager.getInstance().destroy(); WingPaiHangManager.getInstance().destroy(); MerlinRankManager.getInstance().destroy(); CmdRegisterTriggerManager.getInstance().destroy(); SingletonTemplate <SevenDayActivityManager> .Instance().destroy(); SingletonTemplate <FundManager> .Instance().destroy(); SingletonTemplate <UserReturnManager> .Instance().destroy(); SingletonTemplate <OlympicsManager> .Instance().destroy(); SingletonTemplate <ShenJiManager> .Instance().destroy(); SingletonTemplate <TradeBlackManager> .Instance().showdown(); SingletonTemplate <AlchemyManager> .Instance().showdown(); SingletonTemplate <KingRoleDataManager> .Instance().destroy(); SingletonTemplate <ZhengBaManager> .Instance().destroy(); SingletonTemplate <CoupleArenaDbManager> .Instance().destroy(); SingletonTemplate <AllyManager> .Instance().destroy(); SingletonTemplate <RoleManager> .Instance().destroy(); SingletonTemplate <HongBaoManager> .Instance().destroy(); SingletonTemplate <HuiJiManager> .Instance().destroy(); SingletonTemplate <ArmorManager> .Instance().destroy(); SingletonTemplate <JingLingYuanSuJueXingManager> .Instance().destroy(); SingletonTemplate <BianShenManager> .Instance().destroy(); GlodAuctionMsgProcess.getInstance().destroy(); BoCaiManager.getInstance().destroy(); }
public DBRoleInfo GetDBRoleInfo(ref int roleID) { int tempRoleID = 0; if (roleID < 200000) { tempRoleID = roleID; roleID = SingletonTemplate <RoleMapper> .Instance().GetLocalRoleIDByTempID(tempRoleID); } DBRoleInfo result; if (roleID <= 0) { result = null; } else { DBRoleInfo dbRoleInfo = this._DBRoleMgr.FindDBRoleInfo(ref roleID); if (null == dbRoleInfo) { dbRoleInfo = new DBRoleInfo(); MySQLConnection conn = this._DBConns.PopDBConnection(); try { if (!dbRoleInfo.Query(conn, roleID, false, tempRoleID)) { return(null); } } catch (Exception ex) { LogManager.WriteException(ex.ToString()); } finally { this._DBConns.PushDBConnection(conn); } DBQuery.QueryDJPointData(this, dbRoleInfo); dbRoleInfo = this._DBRoleMgr.AddDBRoleInfo(dbRoleInfo); } result = dbRoleInfo; } return(result); }