コード例 #1
0
        private void OnVerificationKey(MobaMessage msg)
        {
            OperationResponse operationResponse = msg.Param as OperationResponse;
            int num  = (int)operationResponse.Parameters[6];
            int num2 = num;

            if (num2 != 1)
            {
                if (num != 2)
                {
                    ClientLogger.Assert(false, null);
                }
                NetWorkHelper.Instance.DisconnectFromGateServer(true);
                this._connectState = GateReconnection.ConnectState.ConnectLogin;
                if (NetWorkHelper.Instance.MasterServerFlag)
                {
                    this.OnLoginConnected();
                }
                else
                {
                    NetWorkHelper.Instance.ConnectToMasterServer();
                }
            }
            else
            {
                this.End(true);
            }
        }
コード例 #2
0
        private void SyncFightInfo(InBattleRuntimeInfo fightInfo)
        {
            if (Singleton <PvpManager> .Instance.LoadStatus != LoadSceneStatus.Finished)
            {
                return;
            }
            if (fightInfo == null)
            {
                this.TryStartObserving();
                PvpStateBase.LogState("no fight info");
                return;
            }
            RoomState roomState = (RoomState)fightInfo.roomState;

            PvpStateBase.LogState("roomstate " + roomState);
            switch (roomState)
            {
            case RoomState.Wait:
                this.TryStartObserving();
                break;

            case RoomState.Fighting:
            case RoomState.LogicStart:
                PvpProtocolTools.SyncFightInfo(fightInfo);
                this.TryStartObserving();
                PvpStateManager.Instance.ChangeState(new PvpStateStart(PvpStateCode.PvpStart));
                break;

            case RoomState.End:
                Singleton <PvpManager> .Instance.AbandonGame(PvpErrorCode.StateError);

                break;

            default:
                ClientLogger.Assert(false, "unknown roomstate " + roomState);
                break;
            }
        }