private void OnMsgAthteclicList(byte[] buffer) { PAthleticsList ret = Net.Deserialize <PAthleticsList>(buffer); if (!Net.CheckErrorCode(ret.errorCode, eCommand.ATHTECLIC_LIST)) { return; } PVPManager.Instance.AttackCount = ret.freeTimes; // 剩余次数 PVPManager.Instance.AttackRemainTime.SetTimeMilliseconds(ret.nextAthlecticTime); // 攻击冷却时间 PVPManager.Instance.MyRank = ret.rank; // 我的排名 PVPManager.Instance.MyHighRank = ret.maxRank; // 我的最高排名 // 对手 PVPManager.Instance.PlayerList.Clear(); foreach (var item in ret.athletics) { PVPPlayerInfo info = new PVPPlayerInfo(); info.Deserialize(item); PVPManager.Instance.PlayerList.Add(info); } PVPManager.Instance.SortPlayer(); // 刷新ui UIManager.Instance.RefreshWindow <UIPVPView>(); }
private void OnMsgAthteclicRankList(byte[] buffer) { PAthleticsList ret = Net.Deserialize <PAthleticsList>(buffer); if (!Net.CheckErrorCode(ret.errorCode, eCommand.ATHTECLIC_RANK_LIST)) { return; } // 对手 PVPManager.Instance.RankList.Clear(); foreach (var item in ret.athletics) { PVPRankInfo info = new PVPRankInfo(); info.Deserialize(item); PVPManager.Instance.RankList.Add(info); } // 刷新ui UIManager.Instance.RefreshWindow <UIPVPRankView>(); }