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 void processCmd(GameServerClient client, int nID, byte[] cmdParams, int count) { int roleId = DataHelper.BytesToObject <int>(cmdParams, 0, count); WanMotaInfo data = WanMoTaManager.getInstance().getWanMoTaData(roleId); client.sendCmd <WanMotaInfo>(10159, data); }
public void processCmd(GameServerClient client, byte[] cmdParams, int count) { int roleId = DataHelper.BytesToObject <int>(cmdParams, 0, count); WanMotaInfo data = WanMoTaManager.getInstance().getWanMoTaData(roleId); client.sendCmd <WanMotaInfo>((int)TCPGameServerCmds.CMD_DB_GET_WANMOTA_DETAIL, data); }
public static void destroy() { //战盟事件管理器 ZhanMengShiJianManager.getInstance().destroy(); // 竞技场管理器 JingJiChangManager.getInstance().destroy(); // 万魔塔管理 WanMoTaManager.getInstance().destroy(); // 翅膀排行管理 WingPaiHangManager.getInstance().destroy(); //指令管理器 CmdRegisterTriggerManager.getInstance().destroy(); }
public static void OnChangeName(int roleid, string oldName, string newName) { if (!string.IsNullOrEmpty(oldName) && !string.IsNullOrEmpty(newName)) { Action <List <PaiHangItemData> > _nameUpdater = delegate(List <PaiHangItemData> _itemList) { if (_itemList != null) { try { List <PaiHangItemData> items = _itemList.FindAll((PaiHangItemData _item) => _item.RoleID == roleid); if (items != null) { foreach (PaiHangItemData item in items) { item.RoleName = newName; } } } catch (Exception) { } } }; _nameUpdater(PaiHangManager.RoleEquipPaiHangList); _nameUpdater(PaiHangManager.RoleXueWeiNumPaiHangList); _nameUpdater(PaiHangManager.RoleSkillLevelPaiHangList); _nameUpdater(PaiHangManager.RoleHorseJiFenPaiHangList); _nameUpdater(PaiHangManager.RoleLevelPaiHangList); _nameUpdater(PaiHangManager.RoleYinLiangPaiHangList); _nameUpdater(PaiHangManager.RoleLianZhanPaiHangList); _nameUpdater(PaiHangManager.RoleKillBossPaiHangList); _nameUpdater(PaiHangManager.RoleBattleNumPaiHangList); _nameUpdater(PaiHangManager.RoleHeroIndexPaiHangList); _nameUpdater(PaiHangManager.RoleGoldPaiHangList); _nameUpdater(PaiHangManager.CombatForcePaiHangList); _nameUpdater(PaiHangManager.RoleChengJiuPaiHangList); _nameUpdater(PaiHangManager.RoleShengWangPaiHangList); PaiHangManager._UpdateName_t_huodongpaihang(roleid, oldName, newName); JingJiChangManager.getInstance().OnChangeName(roleid, oldName, newName); WanMoTaManager.getInstance().OnChangeName(roleid, oldName, newName); WingPaiHangManager.getInstance().OnChangeName(roleid, oldName, newName); RingPaiHangManager.getInstance().OnChangeName(roleid, oldName, newName); MerlinRankManager.getInstance().OnChangeName(roleid, oldName, newName); } }
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 void processCmd(GameServerClient client, int nID, byte[] cmdParams, int count) { try { ModifyWanMotaData modifyData = DataHelper.BytesToObject <ModifyWanMotaData>(cmdParams, 0, count); if (null == modifyData) { LogManager.WriteLog(LogTypes.Error, string.Format("指令参数传输错误, CMD={0}, CmdData={2}", TCPGameServerCmds.CMD_DB_MODIFY_WANMOTA, cmdParams), null, true); client.sendCmd(10158, string.Format("{0}:{1}", 0, -1)); } else { string cmd = modifyData.strParams; string[] fields = cmd.Split(new char[] { ':' }); if (fields.Length != 6) { LogManager.WriteLog(LogTypes.Error, string.Format("指令参数个数错误, CMD={0}, Recv={1}, CmdData={2}", TCPGameServerCmds.CMD_DB_MODIFY_WANMOTA, fields.Length, cmdParams), null, true); client.sendCmd(10158, string.Format("{0}:{1}", 0, -1)); } else { fields[4] = modifyData.strSweepReward; int roleID = Convert.ToInt32(fields[0]); WanMotaInfo dataWanMota = WanMoTaManager.getInstance().getWanMoTaData(roleID); if (null == dataWanMota) { LogManager.WriteLog(LogTypes.Error, string.Format("没有找到相应的万魔塔信息,CMD={0}, RoleID={1}", TCPGameServerCmds.CMD_DB_MODIFY_WANMOTA, roleID), null, true); client.sendCmd(10158, string.Format("{0}:{1}", 0, -1)); } else { int ret = WanMoTaManager.getInstance().updateWanMoTaData(roleID, fields, 1); if (ret < 0) { LogManager.WriteLog(LogTypes.Error, string.Format("数据库更新万魔塔数据失败,CMD={0}, RoleID={1}", TCPGameServerCmds.CMD_DB_MODIFY_WANMOTA, roleID), null, true); } else { bool bPassLayerCountChange = false; lock (dataWanMota) { dataWanMota.lFlushTime = DataHelper.ConvertToInt64(fields[1], dataWanMota.lFlushTime); int nPassLayerCount = DataHelper.ConvertToInt32(fields[2], dataWanMota.nPassLayerCount); dataWanMota.nSweepLayer = DataHelper.ConvertToInt32(fields[3], dataWanMota.nSweepLayer); dataWanMota.strSweepReward = DataHelper.ConvertToStr(fields[4], dataWanMota.strSweepReward); dataWanMota.lSweepBeginTime = DataHelper.ConvertToInt64(fields[5], dataWanMota.lSweepBeginTime); if (nPassLayerCount != dataWanMota.nPassLayerCount) { dataWanMota.nPassLayerCount = nPassLayerCount; bPassLayerCountChange = true; } } if (bPassLayerCountChange) { WanMoTaManager.getInstance().ModifyWanMoTaPaihangData(dataWanMota, false); } } string strcmd = string.Format("{0}:{1}", roleID, ret); client.sendCmd(10158, strcmd); } } } } catch (Exception ex) { DataHelper.WriteFormatExceptionLog(ex, "", false, false); string strcmd = string.Format("{0}:{1}", 0, -1); } }
public static PaiHangData GetPaiHangData(int paiHangType, int pageShowNum = -1) { List <PaiHangItemData> paiHangItemList = null; switch (paiHangType) { case 1: paiHangItemList = PaiHangManager.RoleEquipPaiHangList; break; case 2: paiHangItemList = PaiHangManager.RoleXueWeiNumPaiHangList; break; case 3: paiHangItemList = PaiHangManager.RoleSkillLevelPaiHangList; break; case 4: paiHangItemList = PaiHangManager.RoleHorseJiFenPaiHangList; break; case 5: paiHangItemList = PaiHangManager.RoleLevelPaiHangList; break; case 6: paiHangItemList = PaiHangManager.RoleYinLiangPaiHangList; break; case 7: paiHangItemList = PaiHangManager.RoleLianZhanPaiHangList; break; case 8: paiHangItemList = PaiHangManager.RoleKillBossPaiHangList; break; case 9: paiHangItemList = PaiHangManager.RoleBattleNumPaiHangList; break; case 10: paiHangItemList = PaiHangManager.RoleHeroIndexPaiHangList; break; case 11: paiHangItemList = PaiHangManager.RoleGoldPaiHangList; break; case 12: paiHangItemList = PaiHangManager.CombatForcePaiHangList; break; case 13: paiHangItemList = JingJiChangManager.getInstance().getRankingList(0); break; case 14: paiHangItemList = WanMoTaManager.getInstance().getRankingList(0); break; case 15: paiHangItemList = WingPaiHangManager.getInstance().getRankingList(0, pageShowNum); break; case 16: paiHangItemList = RingPaiHangManager.getInstance().getRankingList(0, pageShowNum); break; case 17: paiHangItemList = MerlinRankManager.getInstance().getRankingList(0, pageShowNum); break; case 18: paiHangItemList = PaiHangManager.UserMoneyPaiHangList; break; case 19: paiHangItemList = PaiHangManager.RoleChengJiuPaiHangList; break; case 20: paiHangItemList = PaiHangManager.RoleShengWangPaiHangList; break; case 21: paiHangItemList = PaiHangManager.RoleGuardStatuePaiHangList; break; case 22: paiHangItemList = PaiHangManager.RoleHolyItemPaiHangList; break; } return(new PaiHangData { PaiHangType = paiHangType, PaiHangList = paiHangItemList }); }
/// <summary> /// 获取排行列表数据 /// </summary> /// <param name="paiHangType"></param> /// <returns></returns> public static PaiHangData GetPaiHangData(int paiHangType) { List <PaiHangItemData> paiHangItemList = null; switch (paiHangType) { case (int)PaiHangTypes.EquipJiFen: { paiHangItemList = RoleEquipPaiHangList; } break; case (int)PaiHangTypes.XueWeiNum: { paiHangItemList = RoleXueWeiNumPaiHangList; } break; case (int)PaiHangTypes.SkillLevel: { paiHangItemList = RoleSkillLevelPaiHangList; } break; case (int)PaiHangTypes.HorseJiFen: { paiHangItemList = RoleHorseJiFenPaiHangList; } break; case (int)PaiHangTypes.RoleLevel: { paiHangItemList = RoleLevelPaiHangList; } break; case (int)PaiHangTypes.RoleYinLiang: { paiHangItemList = RoleYinLiangPaiHangList; } break; case (int)PaiHangTypes.LianZhan: { paiHangItemList = RoleLianZhanPaiHangList; } break; case (int)PaiHangTypes.KillBoss: { paiHangItemList = RoleKillBossPaiHangList; } break; case (int)PaiHangTypes.BattleNum: { paiHangItemList = RoleBattleNumPaiHangList; } break; case (int)PaiHangTypes.HeroIndex: { paiHangItemList = RoleHeroIndexPaiHangList; } break; case (int)PaiHangTypes.RoleGold: { paiHangItemList = RoleGoldPaiHangList; } break; case (int)PaiHangTypes.CombatForceList: { paiHangItemList = CombatForcePaiHangList; } break; case (int)PaiHangTypes.JingJi: { paiHangItemList = JingJiChangManager.getInstance().getRankingList(0); } break; case (int)PaiHangTypes.WanMoTa: { paiHangItemList = WanMoTaManager.getInstance().getRankingList(0); } break; case (int)PaiHangTypes.Wing: { paiHangItemList = WingPaiHangManager.getInstance().getRankingList(0); } break; default: { ; // } break; } ; return(new PaiHangData() { PaiHangType = paiHangType, PaiHangList = paiHangItemList, }); }