Beispiel #1
0
    /// <summary>
    /// 踢出队员 通知客户端删除队员(所有客户端都要接收)
    /// </summary>
    /// <param name="cmd"></param>
    public void OnRemoveTeamMember(GameCmd.stRemoveTeamMemberRelationUserCmd_S cmd)
    {
        Engine.Utility.Log.LogGroup(GameDefine.LogGroup.User_LCY, "---7 >>>通知客户端删除队员id = {0}", cmd.dwUserID);

        if (Client.ClientGlobal.Instance().IsMainPlayer(cmd.dwUserID)) //是玩家
        {
            if (cmd.rmType == (uint)GameCmd.TeamRemoveType.TeamRemoveType_Leave)
            {
                TipsManager.Instance.ShowTips(LocalTextType.Team_My_likaichenggong);//离开成功
            }
            else if (cmd.rmType == (uint)GameCmd.TeamRemoveType.TeamRemoveType_Kick)
            {
                TipsManager.Instance.ShowTips(LocalTextType.Team_My_nibeitichuliaodongwu);//你被踢出了队伍
            }

            ClearTeamData();//清除队伍数据
            if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.TeamPanel))
            {
                DataManager.Manager <UIPanelManager>().HidePanel(PanelID.TeamPanel);
            }
        }
        else
        {
            TeamMemberInfo member = m_listTeamMember.Find((TeamMemberInfo data) => { return(data.id == cmd.dwUserID); });
            if (member == null)
            {
                return;
            }

            if (cmd.rmType == (uint)GameCmd.TeamRemoveType.TeamRemoveType_Leave)
            {
                TipsManager.Instance.ShowLocalFormatTips(LocalTextType.Team_Member_Xlikailiaodongwu, member.name);//{0}离开了队伍
            }
            else if (cmd.rmType == (uint)GameCmd.TeamRemoveType.TeamRemoveType_Kick)
            {
                TipsManager.Instance.ShowLocalFormatTips(LocalTextType.Team_Member_Xbeitichuliaodongwu, member.name);//{0}被踢出了队伍
            }

            DeleteTeamMember(cmd.dwUserID);//删除队员
        }



        if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.TeamPanel))
        {
            DataManager.Manager <UIPanelManager>().SendMsg(PanelID.TeamPanel, UIMsgID.eUpdateMyTeamList, null);
        }

        if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.MissionAndTeamPanel))
        {
            DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MissionAndTeamPanel, UIMsgID.eUpdateMyTeamList, null);
        }
    }
Beispiel #2
0
 public void Execute(GameCmd.stRemoveTeamMemberRelationUserCmd_S cmd)
 {
     DataManager.Manager <TeamDataManager>().OnRemoveTeamMember(cmd);
 }