/// <summary> /// 队伍已解散 /// </summary> /// <param name="buf">协议内容</param> private void OnTeamDissove(KProtoBuf buf) { S2C_TEAM_DISSOVE msg = buf as S2C_TEAM_DISSOVE; TeamProxy teamProxy = GameFacade.Instance.RetrieveProxy(ProxyName.TeamProxy) as TeamProxy; teamProxy.SetCaptainID(0); teamProxy.UpdateMember(null); GameFacade.Instance.SendNotification(NotificationName.MSG_TEAM_MEMBER_UPDATE); }
/// <summary> /// 自已被离队 /// </summary> /// <param name="buf">协议内容</param> private void OnForcedToleaveTeam(KProtoBuf buf) { S2C_TEAM_MEMBER_FORCELEAVE msg = buf as S2C_TEAM_MEMBER_FORCELEAVE; Debug.Log("自己被踢出"); TeamProxy teamProxy = GetTeamProxy(); teamProxy.SetCaptainID(0); teamProxy.UpdateMember(null); GameFacade.Instance.SendNotification(NotificationName.MSG_TEAM_MEMBER_UPDATE); }
/// <summary> /// 离开队伍 /// </summary> public void LeaveTeam() { Debug.Log("离开======>"); C2S_TEAM_LEAVE msg = new C2S_TEAM_LEAVE(); msg.protocolID = (ushort)KC2S_Protocol.c2s_team_leave; NetworkManager.Instance.SendToGameServer(msg); TeamProxy teamProxy = GetTeamProxy(); teamProxy.SetCaptainID(0); teamProxy.UpdateMember(null); }
/// <summary> /// 队员离开 /// </summary> /// <param name="buf">协议内容</param> private void OnMemberLeave(KProtoBuf buf) { S2C_TEAM_MEMBER_LEAVE msg = buf as S2C_TEAM_MEMBER_LEAVE; if (msg.id == GetSeverListProxy().GetCurrentCharacterVO().UId) { Debug.Log("自己被踢出222"); TeamProxy teamProxy = GetTeamProxy(); teamProxy.SetCaptainID(0); teamProxy.UpdateMember(null); GameFacade.Instance.SendNotification(NotificationName.MSG_TEAM_MEMBER_UPDATE); } else { GetTeamProxy().DelMember(msg.id); } }