예제 #1
0
 private void WillReset()
 {
     this.m_dialog = null;
     this.ClearReconnectData();
     this.m_timeoutListeners.Clear();
     this.m_pendingReconnectNotice = null;
 }
예제 #2
0
    public bool ReconnectFromLogin()
    {
        NetCache.ProfileNoticeDisconnectedGame dCGameNotice = this.GetDCGameNotice();
        if (dCGameNotice == null)
        {
            return(false);
        }
        if (!this.IsReconnectEnabled())
        {
            return(false);
        }
        if (dCGameNotice.GameResult != ProfileNoticeDisconnectedGameResult.GameResult.GR_PLAYING)
        {
            this.OnGameResult(dCGameNotice);
            return(false);
        }
        if (dCGameNotice.GameType == GameType.GT_UNKNOWN)
        {
            return(false);
        }
        this.m_pendingReconnectNotice = dCGameNotice;
        ReconnectType lOGIN = ReconnectType.LOGIN;

        this.StartReconnecting(lOGIN);
        NetCache.Get().RegisterReconnectMgr(new NetCache.NetCacheCallback(this.OnNetCacheReady));
        return(true);
    }
예제 #3
0
    public bool ShowDisconnectedGameResult(NetCache.ProfileNoticeDisconnectedGame dcGame)
    {
        object[]             objArray1;
        AlertPopup.PopupInfo info;
        string str;

        if (GameUtils.IsMatchmadeGameType(dcGame.GameType))
        {
            switch (dcGame.GameResult)
            {
            case ProfileNoticeDisconnectedGameResult.GameResult.GR_WINNER:
            case ProfileNoticeDisconnectedGameResult.GameResult.GR_TIE:
                if (dcGame.GameType != GameType.GT_UNKNOWN)
                {
                    info = new AlertPopup.PopupInfo {
                        m_headerText = GameStrings.Get("GLUE_RECONNECT_RESULT_HEADER")
                    };
                    str = null;
                    if (dcGame.GameResult == ProfileNoticeDisconnectedGameResult.GameResult.GR_TIE)
                    {
                        str = "GLUE_RECONNECT_RESULT_TIE";
                        goto Label_00EA;
                    }
                    switch (dcGame.YourResult)
                    {
                    case ProfileNoticeDisconnectedGameResult.PlayerResult.PR_WON:
                        str = "GLUE_RECONNECT_RESULT_WIN";
                        goto Label_00EA;

                    case ProfileNoticeDisconnectedGameResult.PlayerResult.PR_LOST:
                    case ProfileNoticeDisconnectedGameResult.PlayerResult.PR_QUIT:
                        str = "GLUE_RECONNECT_RESULT_LOSE";
                        goto Label_00EA;

                    case ProfileNoticeDisconnectedGameResult.PlayerResult.PR_DISCONNECTED:
                        str = "GLUE_RECONNECT_RESULT_DISCONNECT";
                        goto Label_00EA;
                    }
                    Debug.LogError(string.Format("ReconnectMgr.ShowDisconnectedGameResult() - unhandled player result {0}", dcGame.YourResult));
                }
                return(false);
            }
            Debug.LogError(string.Format("ReconnectMgr.ShowDisconnectedGameResult() - unhandled game result {0}", dcGame.GameResult));
        }
        return(false);

Label_00EA:
        objArray1              = new object[] { this.GetGameTypeName(dcGame.GameType, dcGame.MissionId) };
        info.m_text            = GameStrings.Format(str, objArray1);
        info.m_responseDisplay = AlertPopup.ResponseDisplay.OK;
        info.m_showAlertIcon   = true;
        DialogManager.Get().ShowPopup(info);
        return(true);
    }
예제 #4
0
 private void OnReconnectTimeout()
 {
     this.ClearReconnectData();
     this.ChangeDialogToTimeout();
     if (this.m_pendingReconnectNotice != null)
     {
         this.AckNotice(this.m_pendingReconnectNotice);
         this.m_pendingReconnectNotice = null;
     }
     this.FireTimeoutEvent();
 }
예제 #5
0
    private NetCache.ProfileNoticeDisconnectedGame GetDCGameNotice()
    {
        NetCache.NetCacheProfileNotices netObject = NetCache.Get().GetNetObject <NetCache.NetCacheProfileNotices>();
        if (((netObject == null) || (netObject.Notices == null)) || (netObject.Notices.Count == 0))
        {
            return(null);
        }
        NetCache.ProfileNoticeDisconnectedGame game = null;
        foreach (NetCache.ProfileNotice notice in netObject.Notices)
        {
            NetCache.ProfileNoticeDisconnectedGame game2 = notice as NetCache.ProfileNoticeDisconnectedGame;
            if (game2 != null)
            {
                if (game == null)
                {
                    game = game2;
                }
                else if (game2.NoticeID > game.NoticeID)
                {
                    game = game2;
                }
            }
        }
        List <NetCache.ProfileNoticeDisconnectedGame> list = new List <NetCache.ProfileNoticeDisconnectedGame>();

        foreach (NetCache.ProfileNotice notice2 in netObject.Notices)
        {
            NetCache.ProfileNoticeDisconnectedGame item = notice2 as NetCache.ProfileNoticeDisconnectedGame;
            if ((item != null) && (notice2.NoticeID != game.NoticeID))
            {
                list.Add(item);
            }
        }
        foreach (NetCache.ProfileNoticeDisconnectedGame game4 in list)
        {
            this.AckNotice(game4);
        }
        return(game);
    }
예제 #6
0
    private bool OnFindGameEvent(FindGameEventData eventData, object userData)
    {
        switch (eventData.m_state)
        {
        case FindGameState.SERVER_GAME_STARTED:
            if (this.IsReconnecting())
            {
                this.m_timeoutListeners.Clear();
                this.ChangeDialogToReconnected();
                this.ClearReconnectData();
                this.m_pendingReconnectNotice = null;
            }
            break;

        case FindGameState.SERVER_GAME_CANCELED:
            if (this.IsReconnecting())
            {
                this.OnReconnectTimeout();
                return(true);
            }
            break;
        }
        return(false);
    }
예제 #7
0
 public void AckNotice(NetCache.ProfileNoticeDisconnectedGame notice)
 {
     object[] objArray1 = new object[] { notice };
     base.method_8("AckNotice", objArray1);
 }
예제 #8
0
 public bool ShowDisconnectedGameResult(NetCache.ProfileNoticeDisconnectedGame dcGame)
 {
     object[] objArray1 = new object[] { dcGame };
     return(base.method_11 <bool>("ShowDisconnectedGameResult", objArray1));
 }
예제 #9
0
 public void OnGameResult(NetCache.ProfileNoticeDisconnectedGame dcGameNotice)
 {
     object[] objArray1 = new object[] { dcGameNotice };
     base.method_8("OnGameResult", objArray1);
 }
예제 #10
0
 private void OnGameResult(NetCache.ProfileNoticeDisconnectedGame dcGameNotice)
 {
     this.ShowDisconnectedGameResult(dcGameNotice);
     this.AckNotice(dcGameNotice);
 }
예제 #11
0
 private void AckNotice(NetCache.ProfileNoticeDisconnectedGame notice)
 {
     Network.AckNotice(notice.NoticeID);
 }