Пример #1
0
    /// <summary>
    /// 创建队伍
    /// </summary>
    public void ReqCreateTeam()
    {
        Engine.Utility.Log.LogGroup(GameDefine.LogGroup.User_LCY, "创建队伍");

        GameCmd.stRequestTeamRelationUserCmd_CS cmd = new GameCmd.stRequestTeamRelationUserCmd_CS();

        IPlayer mainPlayer = ClientGlobal.Instance().MainPlayer;

        if (mainPlayer != null)
        {
            cmd.dwAnswerUserID = mainPlayer.GetID();
            cmd.byAnswerName   = mainPlayer.GetName();
            NetService.Instance.Send(cmd);
        }
    }
Пример #2
0
 /// <summary>
 /// 邀请组队(1、 队长组队邀请  2、队员邀请其他人入队)
 /// </summary>
 public void ReqInviteTeam(uint answerId, string answerName = null)
 {
     if (m_listTeamMember.Count < 5)
     {
         //无队伍情况创建队伍
         if (IsJoinTeam == false)
         {
             GameCmd.stRequestTeamRelationUserCmd_CS cmd = new GameCmd.stRequestTeamRelationUserCmd_CS();
             cmd.dwAnswerUserID = answerId;
             cmd.byAnswerName   = answerName;
             cmd.byTeamName     = "";
             NetService.Instance.Send(cmd);
         }
         //有队伍
         else if (IsJoinTeam == true)
         {
             // 1、队长组队邀请
             if (MainPlayerIsLeader())
             {
                 GameCmd.stRequestTeamRelationUserCmd_CS cmd = new GameCmd.stRequestTeamRelationUserCmd_CS();
                 cmd.dwAnswerUserID = answerId;
                 cmd.byAnswerName   = answerName;
                 cmd.byTeamName     = "";
                 NetService.Instance.Send(cmd);
             }
             // 2、 队员邀请其他人。先要其他人同意,再走一个申请入队流程
             else
             {
                 GameCmd.stTeamMemReqInviteRelationUserCmd_C cmd = new GameCmd.stTeamMemReqInviteRelationUserCmd_C();
                 cmd.id = answerId;
                 NetService.Instance.Send(cmd);
             }
         }
     }
     else
     {
         TipsManager.Instance.ShowTips(LocalTextType.Team_Limit_nindedongwurenshuyiman);//您的队伍人数已满
     }
 }
Пример #3
0
    public void Execute(GameCmd.stRequestTeamRelationUserCmd_CS cmd)
    {
        if (DataManager.Manager <TeamDataManager>().AutoRefuseTeamInvite == false)
        {
            Engine.Utility.Log.LogGroup(GameDefine.LogGroup.User_LCY, "---5 >>>收到:{0}组队邀请信息", cmd.byAnswerName);

            DataManager.Manager <FunctionPushManager>().AddSysMsg(new PushMsg()
            {
                msgType  = PushMsg.MsgType.TeamLeaderInvite,
                senderId = cmd.dwAnswerUserID,
                name     = cmd.byTeamName,
                sendName = cmd.byAnswerName,
                sendTime = UnityEngine.Time.realtimeSinceStartup,
                cd       = (float)GameTableManager.Instance.GetGlobalConfig <int>("TeamLeaderInviteMsgCD"),
            });
        }
        else  //自动拒绝组队邀请
        {
            GameCmd.stAnswerTeamRelationUserCmd_CS sendCmd = new GameCmd.stAnswerTeamRelationUserCmd_CS();
            sendCmd.dwRequestUserID = cmd.dwAnswerUserID;
            sendCmd.byAgree         = 0;
            NetService.Instance.Send(sendCmd);
        }
    }