public JieriPlatChargeKingEverydayData BuildQueryDataForClient(GameClient client) { DateTime startTime = DateTime.Parse(this.FromDate); DateTime endTime = DateTime.Parse(this.ToDate); DateTime now = TimeUtil.NowDateTime(); JieriPlatChargeKingEverydayData myData = new JieriPlatChargeKingEverydayData(); bool needHasGetTimes = false; lock (this.Mutex) { myData.PaiHangDict = new Dictionary <int, List <InputKingPaiHangData> >(this._realRankDict); foreach (KeyValuePair <int, List <InputKingPaiHangData> > kvp in myData.PaiHangDict) { if (!(now < startTime.AddDays((double)kvp.Key))) { needHasGetTimes = kvp.Value.Exists((InputKingPaiHangData x) => 0 == string.Compare(x.UserID, client.strUserID, true)); if (needHasGetTimes) { break; } } } } if (needHasGetTimes) { string huoDongKeyStr = Global.GetHuoDongKeyString(this.FromDate, this.ToDate); myData.hasgettimes = KFCopyRpcClient.getInstance().QueryHuodongAwardUserHist(77, huoDongKeyStr, client.strUserID); } return(myData); }
public void Update() { if (this.InActivityTime() || this.InAwardTime()) { DateTime now = TimeUtil.NowDateTime(); if (!(now < this.lastUpdateTime.AddSeconds(15.0))) { this.lastUpdateTime = now; InputKingPaiHangDataEx tmpRankEx = KFCopyRpcClient.getInstance().GetPlatChargeKing(); if (tmpRankEx != null) { List <InputKingPaiHangData> tmpRankList = tmpRankEx.ListData; if (tmpRankEx.StartTime != this.FromDate || tmpRankEx.EndTime != this.ToDate) { } if (tmpRankList != null) { bool bNeedSort = false; int i; for (i = 1; i < tmpRankList.Count <InputKingPaiHangData>(); i++) { if (tmpRankList[i].PaiHangValue > tmpRankList[i - 1].PaiHangValue) { bNeedSort = true; break; } } if (bNeedSort) { tmpRankList.Sort((InputKingPaiHangData _left, InputKingPaiHangData _right) => _right.PaiHangValue - _left.PaiHangValue); } tmpRankList.ForEach(delegate(InputKingPaiHangData _item) { _item.PaiHangValue = Global.TransMoneyToYuanBao(_item.PaiHangValue); }); int procListIdx = 0; i = 0; while (i < this.chargeItemList.Count && procListIdx < tmpRankList.Count) { if (tmpRankList[procListIdx].PaiHangValue >= this.chargeItemList[i].NeedChargeYB) { tmpRankList[procListIdx].PaiHang = this.chargeItemList[i].Rank; procListIdx++; } i++; } if (procListIdx < tmpRankList.Count) { tmpRankList.RemoveRange(procListIdx, tmpRankList.Count - procListIdx); } } this.RealRankList = tmpRankList; } } } else { this.RealRankList = null; } }
public void Update() { if (!this.InActivityTime() && !this.InAwardTime()) { this._realRankDict.Clear(); this._kfRankDict.Clear(); } else { DateTime now = TimeUtil.NowDateTime(); if (!(now < this.lastUpdateTime.AddSeconds(15.0))) { this.lastUpdateTime = now; DateTime startTime = DateTime.Parse(this.FromDate); DateTime endTime = DateTime.Parse(this.ToDate); List <InputKingPaiHangDataEx> tmpRankExList = KFCopyRpcClient.getInstance().GetPlatChargeKingEveryDay(startTime, endTime); if (tmpRankExList != null) { for (int dayLoop = 0; dayLoop < tmpRankExList.Count; dayLoop++) { List <InputKingPaiHangData> tmpRankList = (tmpRankExList[dayLoop] != null) ? tmpRankExList[dayLoop].ListData : null; if (null != tmpRankList) { this.HandleCenterPaiHang(dayLoop + 1, tmpRankList); lock (this.Mutex) { this._realRankDict[dayLoop + 1] = tmpRankList; this._kfRankDict[dayLoop + 1] = tmpRankExList[dayLoop]; } } } } } } }
/// <summary> /// 删除副本, 检测是否是跨服,是否需要上报中心 /// </summary> /// <param name="FuBenSeqId"></param> public void OnCopyRemove(int FuBenSeqId) { long teamId = -1; lock (Mutex) { if (!this.FuBenSeq2TeamId.TryGetValue(FuBenSeqId, out teamId)) { return; } FuBenSeq2TeamId.Remove(FuBenSeqId); CopyTeamData td; if (!TeamDict.TryGetValue(teamId, out td)) { return; } OnTeamDestroy(new CopyTeamDestroyData() { TeamId = teamId }); if (IsKuaFuCopy(td.FuBenId)) { KFCopyRpcClient.getInstance().KFCopyTeamRemove(teamId); } } }
public bool HandleKuaFuLogin(KuaFuServerLoginData data) { if (data == null) { return(false); } lock (Mutex) { CopyTeamData td = null; if (!this.TeamDict.TryGetValue(data.GameId, out td) || td.StartTime <= 0) { // 防止本跨服服务器保存的队伍信息不是最新的,从中心取一下 td = KFCopyRpcClient.getInstance().GetTeamData(data.GameId); if (td == null) { return(false); } this.TeamDict[td.TeamID] = td; HashSet <long> teamList = null; if (this.FuBenId2Teams.TryGetValue(td.FuBenId, out teamList) && !teamList.Contains(td.TeamID)) { teamList.Add(td.TeamID); } } if (td == null) { return(false); } if (td.KFServerId != ThisServerId) { return(false); } if (td.StartTime <= 0) { return(false); } if (!td.TeamRoles.Exists(_role => _role.RoleID == data.RoleId)) { return(false); } if (td.FuBenSeqID <= 0) { td.FuBenSeqID = GameCoreInterface.getinstance().GetNewFuBenSeqId(); } data.FuBenSeqId = td.FuBenSeqID; FuBenSeq2TeamId[td.FuBenSeqID] = td.TeamID; return(true); } }
public bool initialize(ICoreInterface coreInterface) { try { this.CoreInterface = coreInterface; if (!this.InitConfig()) { return(false); } RemotingConfiguration.Configure(Process.GetCurrentProcess().MainModule.FileName + ".config", false); if (!HuanYingSiYuanClient.getInstance().initialize(coreInterface)) { return(false); } if (!TianTiClient.getInstance().initialize(coreInterface)) { return(false); } if (!YongZheZhanChangClient.getInstance().initialize(coreInterface)) { return(false); } if (!KFCopyRpcClient.getInstance().initialize(coreInterface)) { return(false); } if (!SpreadClient.getInstance().initialize(coreInterface)) { return(false); } if (!AllyClient.getInstance().initialize(coreInterface)) { return(false); } if (!IPStatisticsClient.getInstance().initialize(coreInterface)) { return(false); } if (!JunTuanClient.getInstance().initialize(coreInterface)) { return(false); } if (!KuaFuWorldClient.getInstance().initialize(coreInterface)) { return(false); } GlobalEventSource.getInstance().registerListener(12, KuaFuManager.getInstance()); } catch (Exception ex) { return(false); } return(true); }
public override bool GiveAward(GameClient client, int _params) { DateTime startTime = DateTime.Parse(this.FromDate); DateTime endTime = DateTime.Parse(this.ToDate); JieriPlatChargeKingEveryDay.ChargeItem ci = null; bool result; if (!this.IdVsChargeItemDict.TryGetValue(_params, out ci)) { result = false; } else { string huoDongKeyStr = Global.GetHuoDongKeyString(this.FromDate, this.ToDate); int ret = KFCopyRpcClient.getInstance().UpdateHuodongAwardUserHist(77, huoDongKeyStr, client.strUserID, ci.Day); if (ret < 0) { result = false; } else { AwardItem allItem = ci.allAwardGoodsOne; AwardItem occItem = ci.occAwardGoodsTwo; AwardEffectTimeItem timeItem = ci.timeAwardGoodsThr; if (!base.GiveAward(client, allItem) || !base.GiveAward(client, occItem) || !base.GiveEffectiveTimeAward(client, timeItem.ToAwardItem())) { string errLogMsg = string.Format("发送节日每日平台充值王奖励的时候,发送失败,但是已经设置为领取成功, roleid={0}, rolename={1}, id={3}", client.ClientData.RoleID, client.ClientData.RoleName, _params); LogManager.WriteLog(LogTypes.Error, errLogMsg, null, true); result = false; } else { if (client._IconStateMgr.CheckJieRiPCKingEveryDay(client)) { client._IconStateMgr.SendIconStateToClient(client); } result = true; } } } return(result); }
public override bool CheckCondition(GameClient client, int extTag) { bool result; try { JieriPlatChargeKingEveryDay.ChargeItem ci = null; if (!this.IdVsChargeItemDict.TryGetValue(extTag, out ci)) { result = false; } else { DateTime startTime = DateTime.Parse(this.FromDate); DateTime endTime = DateTime.Parse(this.ToDate); DateTime now = TimeUtil.NowDateTime(); lock (this.Mutex) { if (now < startTime.AddDays((double)ci.Day)) { return(false); } InputKingPaiHangDataEx kfpaihangData = null; if (this._kfRankDict == null || !this._kfRankDict.TryGetValue(ci.Day, out kfpaihangData)) { return(false); } DateTime rankTm; DateTime.TryParse(kfpaihangData.RankTime, out rankTm); if (rankTm < startTime.AddDays((double)ci.Day)) { return(false); } List <InputKingPaiHangData> paihangDataList = null; if (this._realRankDict == null || !this._realRankDict.TryGetValue(ci.Day, out paihangDataList)) { return(false); } InputKingPaiHangData myData = paihangDataList.Find((InputKingPaiHangData x) => 0 == string.Compare(x.UserID, client.strUserID, true)); if (myData == null || myData.PaiHang != ci.Rank) { return(false); } string huoDongKeyStr = Global.GetHuoDongKeyString(this.FromDate, this.ToDate); long hasgettimes = KFCopyRpcClient.getInstance().QueryHuodongAwardUserHist(77, huoDongKeyStr, client.strUserID); if (hasgettimes < 0L) { return(false); } int bitVal = Global.GetBitValue(ci.Day); if ((hasgettimes & (long)bitVal) == (long)bitVal) { return(false); } } result = true; } } catch (Exception ex) { LogManager.WriteLog(LogTypes.Fatal, string.Format("{0}解析出现异常, {1}", this.CfgFile, ex.Message), null, true); result = false; } return(result); }
public bool startup() { try { ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("HuanYingSiYuanClient.TimerProc", new EventHandler(HuanYingSiYuanClient.getInstance().TimerProc)), 2000, 2857); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("TianTiClient.TimerProc", new EventHandler(TianTiClient.getInstance().TimerProc)), 2000, 2857); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("YongZheZhanChangClient.TimerProc", new EventHandler(YongZheZhanChangClient.getInstance().TimerProc)), 2000, 3389); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("KFCopyRpcClient.TimerProc", new EventHandler(KFCopyRpcClient.getInstance().TimerProc)), 2000, 2732); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("SpreadClient.TimerProc", new EventHandler(SpreadClient.getInstance().TimerProc)), 2000, 4285); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("AllyClient.TimerProc", new EventHandler(AllyClient.getInstance().TimerProc)), 2000, 5714); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("IPStatisticsClient.TimerProc", new EventHandler(IPStatisticsClient.getInstance().TimerProc)), 2000, 5000); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("JunTuanClient.TimerProc", new EventHandler(JunTuanClient.getInstance().TimerProc)), 2000, 2500); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("KuaFuWorldClient.TimerProc", new EventHandler(KuaFuWorldClient.getInstance().TimerProc)), 2000, 3389); lock (this.RuntimeData.Mutex) { if (null == this.RuntimeData.BackGroundThread) { this.RuntimeData.BackGroundThread = new Thread(new ThreadStart(this.BackGroudThreadProc)); this.RuntimeData.BackGroundThread.IsBackground = true; this.RuntimeData.BackGroundThread.Start(); } } } catch (Exception ex) { return(false); } return(true); }
public bool initialize(ICoreInterface coreInterface) { try { CoreInterface = coreInterface; if (!InitConfig()) { return(false); } System.Runtime.Remoting.RemotingConfiguration.Configure(Process.GetCurrentProcess().MainModule.FileName + ".config", false); if (!HuanYingSiYuanClient.getInstance().initialize(coreInterface)) { return(false); } if (!TianTiClient.getInstance().initialize(coreInterface)) { return(false); } if (!YongZheZhanChangClient.getInstance().initialize(coreInterface)) { return(false); } if (!KFCopyRpcClient.getInstance().initialize(coreInterface)) { return(false); } /* * if (!MoRiJudgeClient.getInstance().initialize(coreInterface)) * { * return false; * } * * if (!ElementWarClient.getInstance().initialize(coreInterface)) * { * return false; * }*/ if (!SpreadClient.getInstance().initialize(coreInterface)) { return(false); } if (!AllyClient.getInstance().initialize(coreInterface)) { return(false); } GlobalEventSource.getInstance().registerListener((int)EventTypes.PlayerLogout, getInstance()); } catch (System.Exception ex) { return(false); } return(true); }
public bool OnUserLogin(TMSKSocket socket, int verSign, string userID, string userName, string lastTime, string userToken, string isadult, string signCode, int serverId, string ip, int port, int roleId, int gameType, long gameId) { KuaFuServerLoginData kuaFuServerLoginData = socket.ClientKuaFuServerLoginData; kuaFuServerLoginData.ServerId = serverId; kuaFuServerLoginData.ServerIp = ip; kuaFuServerLoginData.ServerPort = port; kuaFuServerLoginData.RoleId = roleId; kuaFuServerLoginData.GameType = gameType; kuaFuServerLoginData.GameId = gameId; if (kuaFuServerLoginData.WebLoginToken == null) { kuaFuServerLoginData.WebLoginToken = new WebLoginToken() { VerSign = verSign, UserID = userID, UserName = userName, LastTime = lastTime, Isadult = isadult, SignCode = signCode, }; } if (roleId > 0) { // 跨服服务器的两个ID相等,如果不想等,则配置错误; // 如果想要去掉这个限制,允许区游戏服务器兼作跨服活动服务器(混合使用),必须先修改GameManager.ServerLineID相关的逻辑,使其可以兼容 // 完成修改前,这个限制不可取消. if (GameManager.ServerLineID != GameManager.ServerId) { LogManager.WriteLog(LogTypes.Error, "GameManager.ServerLineID未配置,禁止跨服登录"); return(false); } //跨服登录,限制rid if (!string.IsNullOrEmpty(ip) && port > 0 && gameType > 0 && gameId > 0 /* && HuanYingSiYuanClient.getInstance().CanKuaFuLogin()*/) { string dbIp = ""; int dbPort = 0; string logDbIp = ""; int logDbPort = 0; socket.ServerId = serverId; switch (gameType) { case (int)GameTypes.HuanYingSiYuan: { if (!HuanYingSiYuanClient.getInstance().CanKuaFuLogin()) { return(false); } socket.IsKuaFuLogin = HuanYingSiYuanClient.getInstance().KuaFuLogin(kuaFuServerLoginData); if (!HuanYingSiYuanClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort)) { LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId)); return(false); } } break; case (int)GameTypes.TianTi: { if (!TianTiClient.getInstance().CanKuaFuLogin()) { return(false); } socket.IsKuaFuLogin = TianTiClient.getInstance().KuaFuLogin(kuaFuServerLoginData); if (!TianTiClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort)) { LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId)); return(false); } } break; case (int)GameTypes.KingOfBattle: case (int)GameTypes.YongZheZhanChang: case (int)GameTypes.KuaFuBoss: { if (!YongZheZhanChangClient.getInstance().CanKuaFuLogin()) { return(false); } socket.IsKuaFuLogin = YongZheZhanChangClient.getInstance().KuaFuLogin(kuaFuServerLoginData); if (!YongZheZhanChangClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort)) { LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId)); return(false); } } break; case (int)GameTypes.KuaFuMap: { if (!YongZheZhanChangClient.getInstance().CanKuaFuLogin()) { return(false); } socket.IsKuaFuLogin = YongZheZhanChangClient.getInstance().CanEnterKuaFuMap(kuaFuServerLoginData); if (!YongZheZhanChangClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort)) { LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId)); return(false); } } break; case (int)GameTypes.LangHunLingYu: { if (!YongZheZhanChangClient.getInstance().CanKuaFuLogin()) { return(false); } socket.IsKuaFuLogin = LangHunLingYuManager.getInstance().CanEnterKuaFuMap(kuaFuServerLoginData); if (!YongZheZhanChangClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort)) { LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId)); return(false); } } break; case (int)GameTypes.KuaFuCopy: { if (!KFCopyRpcClient.getInstance().CanKuaFuLogin()) { return(false); } socket.IsKuaFuLogin = CopyTeamManager.Instance().HandleKuaFuLogin(kuaFuServerLoginData); if (!KFCopyRpcClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort)) { LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId)); return(false); } } break; case (int)GameTypes.ZhengBa: { if (!TianTiClient.getInstance().CanKuaFuLogin()) { return(false); } socket.IsKuaFuLogin = ZhengBaManager.Instance().CanKuaFuLogin(kuaFuServerLoginData); if (!TianTiClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort)) { LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId)); return(false); } } break; case (int)GameTypes.CoupleArena: { if (!TianTiClient.getInstance().CanKuaFuLogin()) { return(false); } socket.IsKuaFuLogin = CoupleArenaManager.Instance().CanKuaFuLogin(kuaFuServerLoginData); if (!TianTiClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort)) { LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId)); return(false); } } break; } if (socket.IsKuaFuLogin && serverId != 0) { if (serverId != 0) { if (!InitGameDbConnection(serverId, dbIp, dbPort, logDbIp, logDbPort)) { LogManager.WriteLog(LogTypes.Error, string.Format("连接角色{0}的原服务器的GameDBServer和LogDBServer失败", kuaFuServerLoginData.RoleId)); return(false); } } return(socket.IsKuaFuLogin); } } else { LogManager.WriteLog(LogTypes.Error, string.Format("角色{0}未能在服务器列表中找本服务器,作为跨服服务器", kuaFuServerLoginData.RoleId)); return(false); } } else { //非跨服登录 if (HuanYingSiYuanClient.getInstance().LocalLogin(userID)) { kuaFuServerLoginData.RoleId = 0; kuaFuServerLoginData.GameId = 0; kuaFuServerLoginData.GameType = 0; kuaFuServerLoginData.ServerId = 0; socket.ServerId = 0; socket.IsKuaFuLogin = false; return(true); } } LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的跨服活动或副本信息", kuaFuServerLoginData.RoleId)); return(false); }
public bool startup() { try { ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("HuanYingSiYuanClient.TimerProc", HuanYingSiYuanClient.getInstance().TimerProc), 2000, 2857); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("TianTiClient.TimerProc", TianTiClient.getInstance().TimerProc), 2000, 1357); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("YongZheZhanChangClient.TimerProc", YongZheZhanChangClient.getInstance().TimerProc), 2000, 3389); //ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("MoRiJudgeClient.TimerProc", MoRiJudgeClient.getInstance().TimerProc), 2000, 1732); //ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("ElementWarClient.TimerProc", ElementWarClient.getInstance().TimerProc), 2000, 1732); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("KFCopyRpcClient.TimerProc", KFCopyRpcClient.getInstance().TimerProc), 2000, 1732); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("SpreadClient.TimerProc", SpreadClient.getInstance().TimerProc), 2000, 1732); ScheduleExecutor2.Instance.scheduleExecute(new NormalScheduleTask("AllyClient.TimerProc", AllyClient.getInstance().TimerProc), 2000, 1732); lock (RuntimeData.Mutex) { if (null == RuntimeData.BackGroundThread) { RuntimeData.BackGroundThread = new Thread(BackGroudThreadProc); RuntimeData.BackGroundThread.IsBackground = true; RuntimeData.BackGroundThread.Start(); } } } catch (System.Exception ex) { return(false); } return(true); }
/// <summary> /// 开始游戏 回调 /// </summary> private void OnTeamStart(CopyTeamStartData data) { if (data == null) { return; } lock (Mutex) { CopyTeamData td = null; if (!this.TeamDict.TryGetValue(data.TeamId, out td)) { return; } td.StartTime = data.StartMs; td.KFServerId = data.ToServerId; td.FuBenSeqID = data.FuBenSeqId; bool isKuaFuCopy = IsKuaFuCopy(td.FuBenId); string toServerIp = string.Empty; int toServerPort = 0; if (isKuaFuCopy) { if (!KFCopyRpcClient.getInstance().GetKuaFuGSInfo(data.ToServerId, out toServerIp, out toServerPort)) { LogManager.WriteLog(LogTypes.Error, string.Format("跨服副本CopyType={0}, RoomId={1}被分配到服务器ServerId={2}, 但是找不到该跨服活动服务器", td.FuBenId, data.TeamId, data.ToServerId)); return; } } else { FuBenSeq2TeamId[td.FuBenSeqID] = td.TeamID; } foreach (var member in td.TeamRoles) { if (member.ServerId == ThisServerId) { GameClient client = GameManager.ClientMgr.FindClient(member.RoleID); if (client == null) { continue; } if (isKuaFuCopy) { client.ClientSocket.ClientKuaFuServerLoginData.RoleId = member.RoleID; client.ClientSocket.ClientKuaFuServerLoginData.GameId = td.TeamID; client.ClientSocket.ClientKuaFuServerLoginData.GameType = (int)GameTypes.KuaFuCopy; client.ClientSocket.ClientKuaFuServerLoginData.EndTicks = 0; client.ClientSocket.ClientKuaFuServerLoginData.ServerId = ThisServerId; client.ClientSocket.ClientKuaFuServerLoginData.ServerIp = toServerIp; client.ClientSocket.ClientKuaFuServerLoginData.ServerPort = toServerPort; client.ClientSocket.ClientKuaFuServerLoginData.FuBenSeqId = data.FuBenSeqId; } // 通知倒计时 GameManager.ClientMgr.NotifyTeamMemberFuBenEnterMsg(client, td.LeaderRoleID, td.FuBenId, td.FuBenSeqID); } } NotifyTeamListChange(td); } }
public void Update() { if (InActivityTime() || InAwardTime()) { DateTime now = TimeUtil.NowDateTime(); if (now < lastUpdateTime.AddSeconds(updateIntervalSec)) { return; } lastUpdateTime = now; InputKingPaiHangDataEx tmpRankEx = KFCopyRpcClient.getInstance().GetPlatChargeKing(); if (tmpRankEx == null) { return; } List <InputKingPaiHangData> tmpRankList = tmpRankEx.ListData; if (tmpRankEx.StartTime != FromDate || tmpRankEx.EndTime != ToDate) { // tmpRankList = null; } if (tmpRankList != null) { // 排下序,防止意外 // 排序这里要注意:老陶那边会排序,充值金额相同的按照时间排序 // 所以这里做一个检查,如果顺序ok就不排序了,防止打乱时间顺序 bool bNeedSort = false; for (int i = 1; i < tmpRankList.Count(); ++i) { if (tmpRankList[i].PaiHangValue > tmpRankList[i - 1].PaiHangValue) { bNeedSort = true; break; } } if (bNeedSort) { tmpRankList.Sort((_left, _right) => { return(_right.PaiHangValue - _left.PaiHangValue); }); } tmpRankList.ForEach(_item => _item.PaiHangValue = Global.TransMoneyToYuanBao(_item.PaiHangValue)); int procListIdx = 0; for (int i = 0; i < chargeItemList.Count && procListIdx < tmpRankList.Count; ++i) { if (tmpRankList[procListIdx].PaiHangValue >= chargeItemList[i].NeedChargeYB) { tmpRankList[procListIdx].PaiHang = chargeItemList[i].Rank; ++procListIdx; } } if (procListIdx < tmpRankList.Count) { tmpRankList.RemoveRange(procListIdx, tmpRankList.Count - procListIdx); } } RealRankList = tmpRankList; } else { RealRankList = null; } }