예제 #1
0
 bool OnStatusMatchAck(ERandomwarsMatchErrorCode errorCode, string playerSessionId, string ipAddress, int port)
 {
     if (string.IsNullOrEmpty(playerSessionId))
     {
         if (NetMatchStep != Global.E_MATCHSTEP.MATCH_CANCEL)
         {
             if (matchSendCount < 30)
             {
                 StartCoroutine(WaitForMatch());
             }
             else
             {
                 UI_SearchingPopup searchingPopup = FindObjectOfType <UI_SearchingPopup>();
                 searchingPopup.ClickSearchingCancelResult();
                 UI_Main.Get().ShowMessageBox("매칭 실패", "매칭에 실패했습니다. 다시 시도해주세요.");
             }
         }
     }
     else
     {
         NetMatchStep = Global.E_MATCHSTEP.MATCH_CONNECT;
         ConnectServer(playType, ipAddress, port, playerSessionId);
     }
     return(true);
 }
예제 #2
0
    public void StopMatchReq(string ticketId)
    {
        if (NetMatchStep == Global.E_MATCHSTEP.MATCH_CANCEL)
        {
            return;
        }

        NetMatchStep = Global.E_MATCHSTEP.MATCH_CANCEL;
        session.MatchTemplate.MatchCancelReq(session.HttpClient, ticketId, OnStopMatchAck);
    }
예제 #3
0
 bool OnStopMatchAck(ERandomwarsMatchErrorCode errorCode)
 {
     if (errorCode == ERandomwarsMatchErrorCode.Success)
     {
         UI_Main.Get().searchingPopup.ClickSearchingCancelResult();
     }
     else
     {
         NetMatchStep = Global.E_MATCHSTEP.MATCH_START;
     }
     return(true);
 }
예제 #4
0
    public bool OnStartMatchAck(ERandomwarsMatchErrorCode errorCode, string ticketId)
    {
        if (string.IsNullOrEmpty(ticketId))
        {
            UnityUtil.Print("ticket id null");
            return(false);
        }

        NetMatchStep = Global.E_MATCHSTEP.MATCH_NONE;
        UserInfoManager.Get().SetTicketId(ticketId);
        StartCoroutine(WaitForMatch());
        return(true);
    }
예제 #5
0
    public void StartMatchReq(EGameMode gameMode, int deckIndex)
    {
        if (NetMatchStep == Global.E_MATCHSTEP.MATCH_START ||
            NetMatchStep == Global.E_MATCHSTEP.MATCH_CONNECT)
        {
            // 매칭 중이면 요청할 수 없다.
            return;
        }

        matchSendCount = 0;
        NetMatchStep   = Global.E_MATCHSTEP.MATCH_START;


        session.MatchTemplate.MatchRequestReq(session.HttpClient, (int)gameMode, deckIndex, OnStartMatchAck);
    }