/// <summary> /// 加载参数配置文件 /// </summary> /// <returns></returns> private static int ReloadXmlFile_config_systemparams() { int ret = GameManager.systemParamsList.ReloadLoadParamsList(); //解析插旗战的日期和时间 JunQiManager.ParseWeekDaysTimes(); if (GameManager.OPT_ChengZhanType == 0) { //解析皇城战的日期和时间 HuangChengManager.ParseWeekDaysTimes(); //解析王城战的日期和时间 WangChengManager.ParseWeekDaysTimes(); } //重新读取罗兰城战配置文件 LuoLanChengZhanManager.getInstance().InitConfig(); //重置皇城地图编号 Global.ResetHuangChengMapCode(); //重置皇宫的地图编号 Global.ResetHuangGongMapCode(); //坐骑的名称 Global.HorseNamesList = null; //坐骑的速度 Global.HorseSpeedList = null; //生肖竞猜配置 GameManager.ShengXiaoGuessMgr.ReloadConfig(); //古墓配置 Global.InitGuMuMapCodes(); Global.InitVipGumuExpMultiple(); //充值限制掉落的时间项 GameManager.GoodsPackMgr.ResetLimitTimeRange(); //缓存的二锅头物品列表 Global.ErGuoTouGoodsIDList = null; //绑定铜钱符每日使用次数列表缓存 Global._VipUseBindTongQianGoodsIDNum = null; //自动给予的物品的 GameManager.AutoGiveGoodsIDList = null; //加载采集配置 CaiJiLogic.LoadConfig(); // 加载魔剑士静态数据 [XSea 2015/4/14] GameManager.MagicSwordMgr.LoadMagicSwordData(); // 加载梅林魔法书静态数据 [XSea 2015/6/19] GameManager.MerlinMagicBookMgr.LoadMerlinSystemParamsConfigData(); // LogGoods Global.LoadItemLogMark(); // logTradeGoods Global.LoadLogTradeGoods(); //强化最大等级相关配置 Global.LoadForgeSystemParams(); // 副本惩罚时间 KuaFuManager.getInstance().InitCopyTime(); // 魂石精华的经验配置 SoulStoneManager.Instance().LoadJingHuaExpConfig(); // 加载需要记录日志的怪物 MonsterAttackerLogManager.Instance().LoadRecordMonsters(); // 玩家创建角色限制管理 CreateRoleLimitManager.Instance().LoadConfig(); SpeedUpTickCheck.Instance().LoadConfig(); NameManager.Instance().LoadConfig(); CoupleArenaManager.Instance().InitSystenParams(); return(ret); }
// 允许玩家进入 public bool NotifyUserEnter(UserInfo userInfo) { try { if (null == userInfo) { return(true); } if (null == userInfo.socket || !userInfo.socket.Connected) { return(true); } // 加进免排队列表 AddToAllow(userInfo.userID, GetConfig(UserType.Normal, ConfigType.AllowMSeconds)); if (!userInfo.socket.IsKuaFuLogin) { ChangeNameInfo info = NameManager.Instance().GetChangeNameInfo(userInfo.userID, userInfo.zoneID, userInfo.socket.ServerId); if (info != null) { Global._TCPManager.MySocketListener.SendData(userInfo.socket, DataHelper.ObjectToTCPOutPacket(info, Global._TCPManager.TcpOutPacketPool, (int)TCPGameServerCmds.CMD_NTF_EACH_ROLE_ALLOW_CHANGE_NAME)); } } } catch (Exception ex) { DataHelper.WriteExceptionLogEx(ex, string.Format("LoginWaitLogic::NotifyUserEnter userID={0} zoneID={1}", userInfo.userID, userInfo.zoneID)); return(false); } string strData = ""; // 替玩家向db请求角色列表 try { string strcmd = string.Format("{0}:{1}", userInfo.userID, userInfo.zoneID); byte[] bytesData = Global.SendAndRecvData <string>((int)TCPGameServerCmds.CMD_ROLE_LIST, strcmd, userInfo.socket.ServerId); string[] fieldsData = null; Int32 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)); //return false; //获取异常则通知客户端重新排队,防止客户端始终卡在那里 strData = "-1:"; } try { //SysConOut.WriteLine(strData); TCPOutPacket tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(Global._TCPManager.TcpOutPacketPool, strData, (int)TCPGameServerCmds.CMD_ROLE_LIST); Global._TCPManager.MySocketListener.SendData(userInfo.socket, tcpOutPacket); m_LastEnterSecs = (TimeUtil.NOW() - userInfo.startTick) / 1000; m_LastEnterFromFirstSecs = (TimeUtil.NOW() - userInfo.firstTick) / 1000; } catch (Exception ex) { DataHelper.WriteExceptionLogEx(ex, string.Format("LoginWaitLogic::NotifyUserEnter 发送角色列表Faild userID={0} zoneID={1}", userInfo.userID, userInfo.zoneID)); return(false); } return(true); }