Exemple #1
0
    /// <summary>
    /// 发起挑战
    /// </summary>
    /// <param name="targetID"></param>
    /// <param name="name"></param>
    public void ReqChallengeInvite(uint targetID, string name, uint targetRank, bool onLine)
    {
        // 大v说了武斗场id不变151.
        if (!KHttpDown.Instance().SceneFileExists(151))
        {
            //打开下载界面
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.DownloadPanel);
            return;
        }

        MainPlayStop();
        IPlayer mainPlayer = ClientGlobal.Instance().MainPlayer;
        stChallengeInviteArenaUserCmd_CS cmd = new stChallengeInviteArenaUserCmd_CS();

        cmd.offensive_id   = mainPlayer.GetID();
        cmd.offensive_name = mainPlayer.GetName();
        cmd.offender_rank  = m_rank;
        cmd.defensive_id   = targetID;
        cmd.defensive_name = name;
        cmd.defendser_rank = targetRank;
        NetService.Instance.Send(cmd);

        if (onLine)  //在线,会弹出等待框
        {
            WaitPanelShowData waitData = new WaitPanelShowData();
            waitData.type       = WaitPanelType.ArenaChallenge;
            waitData.cdTime     = ChallengeRejectTime;
            waitData.des        = "挑战邀请中,请稍后...";
            waitData.timeOutDel = delegate { DataManager.Manager <UIPanelManager>().HidePanel(PanelID.CommonWaitingPanel); };
            waitData.useBoxMask = false;

            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.CommonWaitingPanel, data: waitData);
        }
    }
Exemple #2
0
 public void OnChallengeInviteRes(stChallengeInviteArenaUserCmd_CS cmd)
 {
     DataManager.Manager <FunctionPushManager>().AddSysMsg(new PushMsg()
     {
         msgType  = PushMsg.MsgType.Arena,
         senderId = cmd.offensive_id,
         //name = "",
         sendName = cmd.offensive_name,
         //groupId = cmd.o,
         sendTime = UnityEngine.Time.realtimeSinceStartup,
         cd       = (float)GameTableManager.Instance.GetGlobalConfig <int>("ArenaMsgCD"),
     });
 }