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 OnMsgOtherPlayerInfo(byte[] buffer) { PPlayerInfo ret = Net.Deserialize <PPlayerInfo>(buffer); if (!Net.CheckErrorCode(ret.errorCode, eCommand.OTHER_PLAYER_INFO)) { return; } PVPPlayerInfo info = PVPManager.Instance.GetPlayer(ret.roleAttrs.userId); if (info != null) { info.Deserialize(ret); } UIManager.Instance.RefreshWindow <UIPVPPlayerInfoView>(); }