/// <summary> /// 匹配队伍同步 /// </summary> /// <returns>The matchind sync handle.</returns> /// <param name="dataBuffer">Data buffer.</param> /// <param name="socketID">Socket I.</param> CommandCallbackType PvpMatchindSyncHandle(byte[] dataBuffer, int socketID) { SMsgPVPMathingSynInfo_SC sMsgConfirmMatching_SC = SMsgPVPMathingSynInfo_SC.ParsePackage(dataBuffer); PvpDataManager.Instance.SetGroupMeberInfo(sMsgConfirmMatching_SC); return(CommandCallbackType.Continue); }
public static SMsgPVPMathingSynInfo_SC ParsePackage(byte[] dataBuffer) { SMsgPVPMathingSynInfo_SC sMsgPVPMathingSynInfo_SC = new SMsgPVPMathingSynInfo_SC(); int of = 0; of += PackageHelper.ReadData(dataBuffer.Skip(of).ToArray(), out sMsgPVPMathingSynInfo_SC.byNum); sMsgPVPMathingSynInfo_SC.GroupMemberInfo = new SGroupMemberInfo[sMsgPVPMathingSynInfo_SC.byNum]; for (int i = 0; i < sMsgPVPMathingSynInfo_SC.byNum; i++) { sMsgPVPMathingSynInfo_SC.GroupMemberInfo[i] = new SGroupMemberInfo(); of += PackageHelper.ReadData(dataBuffer.Skip(of).ToArray(), out sMsgPVPMathingSynInfo_SC.GroupMemberInfo[i].dwActorID); of += PackageHelper.ReadData(dataBuffer.Skip(of).ToArray(), out sMsgPVPMathingSynInfo_SC.GroupMemberInfo[i].dwVocation); of += PackageHelper.ReadData(dataBuffer.Skip(of).ToArray(), out sMsgPVPMathingSynInfo_SC.GroupMemberInfo[i].dwLevel); of += PackageHelper.ReadData(dataBuffer.Skip(of).ToArray(), out sMsgPVPMathingSynInfo_SC.GroupMemberInfo[i].dwFighting); of += PackageHelper.ReadData(dataBuffer.Skip(of).ToArray(), out sMsgPVPMathingSynInfo_SC.GroupMemberInfo[i].szName, 19); of += PackageHelper.ReadData(dataBuffer.Skip(of).ToArray(), out sMsgPVPMathingSynInfo_SC.GroupMemberInfo[i].dwFashion); of += PackageHelper.ReadData(dataBuffer.Skip(of).ToArray(), out sMsgPVPMathingSynInfo_SC.GroupMemberInfo[i].dwWEAPON); } return(sMsgPVPMathingSynInfo_SC); }
public void SetGroupMeberInfo(SMsgPVPMathingSynInfo_SC sMsgPVPMathingSynInfo_SC) { ///如果自己在队伍中要弹出提示有人加入队伍 if (IfGroupmeberInfoListContain((uint)MyActorID)) { ShowMessage(PVPMessageType.JoinTeam, sMsgPVPMathingSynInfo_SC.GroupMemberInfo[0].dwActorID); } //如果没有在队伍中则加入本地队伍缓存 sMsgPVPMathingSynInfo_SC.GroupMemberInfo.ApplyAllItem(c => { if (!IfGroupmeberInfoListContain(c.dwActorID)) { GroupmeberInfoList.Add(c); } }); UIEventManager.Instance.TriggerUIEvent(UIEventType.pvpSyncTeam, null); ///如果当前是默认状态则当前状态改变成组队状态 if (CurrentMatchState == PVPMatchState.defult) { CurrentMatchState = PVPMatchState.Team; } }