Esempio n. 1
0
 public override void Update()
 {
     if (this.mAsyncOp != null)
     {
         if (this.mAsyncOp.canBeActivated)
         {
             this.mAsyncOp.ActivateScene();
         }
         if (!this.mAsyncOp.isDone)
         {
             return;
         }
         if (this.FadeIn)
         {
             GameUtility.FadeIn(this.FadeInTime);
         }
         CriticalSection.Leave(CriticalSections.SceneChange);
         this.mAsyncOp = (SceneRequest)null;
     }
     else
     {
         if (this.WaitFadeIn && GameUtility.IsScreenFading && this.FadeIn)
         {
             return;
         }
         this.ActivateNext();
     }
 }
Esempio n. 2
0
        private void Update()
        {
            if (this.mMutex == null)
            {
                return;
            }
            this.mMutex.WaitOne();
            bool flag = this.mResult != 0;

            this.mMutex.ReleaseMutex();
            if (!flag)
            {
                return;
            }
            this.mMutex.Close();
            this.mMutex = (Mutex)null;
            if (this.mResult < 0)
            {
                DebugUtility.LogError("Failed to load MasterParam");
            }
            ((Behaviour)this).set_enabled(false);
            CriticalSection.Leave(CriticalSections.Default);
            MonoSingleton <GameManager> .Instance.MasterParam.DumpLoadedLog();

            this.ActivateOutputLinks(100);
        }
Esempio n. 3
0
 public void OnMultiMaintenance()
 {
     ((Behaviour)this).set_enabled(false);
     CriticalSection.Leave(CriticalSections.SceneChange);
     Network.RemoveAPI();
     this.ActivateOutputLinks(4);
 }
Esempio n. 4
0
 public void OnMismatchVersion()
 {
     ((Behaviour)this).set_enabled(false);
     CriticalSection.Leave(CriticalSections.SceneChange);
     Network.RemoveAPI();
     Network.ResetError();
     this.ActivateOutputLinks(3);
 }
Esempio n. 5
0
 private void OnGachaSceneLoad(GameObject scene)
 {
     this.mGachaScene = (GachaScene)scene.GetComponent <GachaScene>();
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mGachaScene, (UnityEngine.Object)null))
     {
         SceneAwakeObserver.RemoveListener(new SceneAwakeObserver.SceneEvent(this.OnGachaSceneLoad));
     }
     CriticalSection.Leave(CriticalSections.SceneChange);
 }
Esempio n. 6
0
        public bool Error()
        {
            if (!Network.IsError)
            {
                return(false);
            }
            if (Network.ErrCode == Network.EErrCode.NotExist_tower)
            {
                if (this.mResume)
                {
                    GlobalVars.BtlID.Set(this.btlID);
                    CriticalSection.Leave(CriticalSections.SceneChange);
                    Network.RequestResult = Network.RequestResults.Back;
                    if (Network.IsImmediateMode)
                    {
                        return(true);
                    }
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(7);
                    return(true);
                }
                this.OnFailed();
                return(true);
            }
            Network.EErrCode errCode = Network.ErrCode;
            switch (errCode)
            {
            case Network.EErrCode.UnSelectable:
                this.OnBack();
                return(true);

            case Network.EErrCode.OutOfDateQuest:
                this.OnBack();
                return(true);

            case Network.EErrCode.ChallengeLimit:
                this.OnBack();
                return(true);

            default:
                if (errCode != Network.EErrCode.QuestEnd)
                {
                    if (errCode != Network.EErrCode.NoBtlInfo)
                    {
                        return(TowerErrorHandle.Error((FlowNode_Network)this));
                    }
                    this.OnFailed();
                    return(true);
                }
                this.OnFailed();
                return(true);
            }
        }
Esempio n. 7
0
            public void OnSceneAwake(GameObject scene)
            {
                SceneReplay component = (SceneReplay)scene.GetComponent <SceneReplay>();

                if (!Object.op_Inequality((Object)component, (Object)null))
                {
                    return;
                }
                CriticalSection.Leave(CriticalSections.SceneChange);
                SceneAwakeObserver.RemoveListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake));
                component.StartQuest(this.mQuestParam.iname);
            }
Esempio n. 8
0
            public void OnSceneAwake(GameObject scene)
            {
                SceneBattle component = (SceneBattle)scene.GetComponent <SceneBattle>();

                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    return;
                }
                CriticalSection.Leave(CriticalSections.SceneChange);
                CriticalSection.Leave(CriticalSections.SceneChange);
                SceneAwakeObserver.RemoveListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake));
                component.StartQuest(this.Quest.iname, this.InitData);
            }
Esempio n. 9
0
        public void OnVersusNoPlayer()
        {
            MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance, (UnityEngine.Object)null) && instance.IsOldestPlayer())
            {
                instance.OpenRoom(true, false);
            }
            ((Behaviour)this).set_enabled(false);
            CriticalSection.Leave(CriticalSections.SceneChange);
            Network.RemoveAPI();
            this.ActivateOutputLinks(2);
        }
Esempio n. 10
0
        public void OnColoRankModify()
        {
            CriticalSection.Leave(CriticalSections.SceneChange);
            string errMsg = Network.ErrMsg;

            Network.RemoveAPI();
            Network.ResetError();
            SRPG_TouchInputModule.LockInput();
            UIUtility.SystemMessage((string)null, errMsg, (UIUtility.DialogResultEvent)(go =>
            {
                SRPG_TouchInputModule.UnlockInput(false);
                ((Behaviour)this).set_enabled(false);
                this.ActivateOutputLinks(6);
            }), (GameObject)null, true, -1);
        }
Esempio n. 11
0
        private void OnSceneAwake(GameObject scene)
        {
            SceneBattle component = (SceneBattle)scene.GetComponent <SceneBattle>();

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
            {
                return;
            }
            CriticalSection.Leave(CriticalSections.SceneChange);
            CriticalSection.Leave(CriticalSections.SceneChange);
            SceneAwakeObserver.RemoveListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake));
            component.StartQuest(this.mStartingQuest.iname, this.mQuestData);
            ((Behaviour)this).set_enabled(false);
            this.ActivateOutputLinks(1);
        }
Esempio n. 12
0
        public override void OnActivate(int pinID)
        {
            switch (pinID)
            {
            case 0:
                CriticalSection.Enter(this.Mask);
                this.ActivateOutputLinks(10);
                break;

            case 1:
                CriticalSection.Leave(this.Mask);
                this.ActivateOutputLinks(10);
                break;

            case 2:
                ((Behaviour)this).set_enabled(true);
                break;
            }
        }
Esempio n. 13
0
 public void Finished(bool is_replay = false)
 {
     if (this.hBGMVolume != null)
     {
         this.hBGMVolume.Discard();
         this.hBGMVolume = (MySound.VolumeHandle)null;
     }
     if (this.hVoiceVolume != null)
     {
         this.hVoiceVolume.Discard();
         this.hVoiceVolume = (MySound.VolumeHandle)null;
     }
     if (this.AutoFade)
     {
         SRPG_TouchInputModule.UnlockInput(false);
         CriticalSection.Leave(CriticalSections.Default);
         FadeController.Instance.FadeTo(Color.get_clear(), this.FadeTime, 0);
     }
     this.ActivateNext();
 }
Esempio n. 14
0
        public static void RemoveAPI()
        {
            if (MonoSingleton <Network> .Instance.mImmediateMode)
            {
                MonoSingleton <Network> .Instance.mImmediateMode = false;
            }
            else if (MonoSingleton <Network> .Instance.mRequests.Count <= 0)
            {
                DebugUtility.LogWarning("Instance.mRequests.Count <= 0");
            }
            else
            {
                MonoSingleton <Network> .Instance.mRequests.Remove(MonoSingleton <Network> .Instance.mCurrentRequest);

                if (MonoSingleton <Network> .Instance.mRequests.Count != 0)
                {
                    return;
                }
                CriticalSection.Leave(CriticalSections.Network);
            }
        }
Esempio n. 15
0
        protected override void Start()
        {
            CriticalSection.Enter(CriticalSections.SceneChange);
            SectionParam homeWorld = HomeUnitController.GetHomeWorld();

            if (homeWorld == null)
            {
                Debug.LogError((object)"home world is null.");
            }
            else
            {
                UnitData unitDataByUnitId = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUnitID(homeWorld.unit);

                if (unitDataByUnitId == null)
                {
                    CriticalSection.Leave(CriticalSections.SceneChange);
                }
                else
                {
                    this.SetupUnit(unitDataByUnitId, -1);
                    base.Start();
                }
            }
        }
Esempio n. 16
0
 public override void Update(HomeWindow self)
 {
     if (this.state == 0)
     {
         self.mFadingOut = true;
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 11);
         this.state = 1;
     }
     if (this.state == 1)
     {
         if (!AssetDownloader.isDone)
         {
             return;
         }
         if (AssetManager.IsAssetBundle(self.mDesiredSceneName))
         {
             AssetManager.PrepareAssets(self.mDesiredSceneName);
             if (self.mDesiredSceneIsHome)
             {
                 foreach (string resourcePath in FlowNode_PlayBGM.GetHomeBGM())
                 {
                     AssetManager.PrepareAssets(resourcePath);
                 }
             }
             if (!AssetDownloader.isDone)
             {
                 ProgressWindow.OpenGenericDownloadWindow();
                 AssetDownloader.StartDownload(false, true, ThreadPriority.Normal);
                 this.state = 2;
                 return;
             }
         }
         this.state = 3;
     }
     if (this.state == 2)
     {
         if (!AssetDownloader.isDone)
         {
             return;
         }
         ProgressWindow.Close();
         this.state = 3;
     }
     if (this.state == 3)
     {
         if (self.mDesiredSceneIsHome)
         {
             FlowNode_PlayBGM.PlayHomeBGM();
         }
         self.mLastSceneName = self.mDesiredSceneName;
         this.req            = AssetManager.LoadSceneAsync(self.mDesiredSceneName, true);
         this.state          = 4;
     }
     if (this.state == 4)
     {
         if (!this.req.canBeActivated || self.mFadingOut || MonoSingleton <GameManager> .Instance.IsImportantJobRunning)
         {
             return;
         }
         if (!string.IsNullOrEmpty(self.UnloadTrigger))
         {
             GlobalEvent.Invoke(self.UnloadTrigger, (object)this);
         }
         SceneAwakeObserver.AddListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake));
         this.req.ActivateScene();
         if (!string.IsNullOrEmpty(self.mLastSceneName))
         {
             AssetManager.UnloadScene(self.mLastSceneName);
         }
         this.state = 5;
     }
     if (this.state == 5)
     {
         if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mNewScene, (UnityEngine.Object)null) || !this.req.isDone)
         {
             return;
         }
         CriticalSection.Leave(CriticalSections.SceneChange);
         this.state = 6;
     }
     if (this.state == 6)
     {
         if (CriticalSection.IsActive)
         {
             return;
         }
         this.asyncOp = AssetManager.UnloadUnusedAssets();
         this.state   = 7;
     }
     if (this.state != 7 || this.asyncOp != null && !this.asyncOp.get_isDone())
     {
         return;
     }
     FlowNode_GameObject.ActivateOutputLinks((Component)self, 10);
     GameUtility.FadeIn(0.5f);
     self.mDesirdSceneSet = false;
     if (!self.mIgnorePopups && !self.mNewsShown && !GlobalVars.IsTitleStart.Get() && (MonoSingleton <GameManager> .Instance.Player.IsFirstLogin || GameUtility.isLoginInfoDisplay()))
     {
         self.mNewsShown = true;
         GlobalVars.IsTitleStart.Set(true);
         self.mStateMachine.GotoState <HomeWindow.State_LoginBonus>();
     }
     else if (!self.mIgnorePopups && !GlobalVars.IsTitleStart.Get() && !self.mBeginnerShown)
     {
         self.mBeginnerShown = true;
         self.mStateMachine.GotoState <HomeWindow.State_BeginnerNotify>();
     }
     else
     {
         self.MiscBeforeDefaultState();
         self.mStateMachine.GotoState <HomeWindow.State_Default>();
     }
     if (self.mDesiredSceneIsHome)
     {
         self.UnlockContents();
         self.FgGIDLoginCheck();
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 15);
     }
     else
     {
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 16);
     }
 }
Esempio n. 17
0
 public override void Update(HomeWindow self)
 {
     if (this.state == 0)
     {
         self.mFadingOut = true;
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 11);
         this.state = 1;
     }
     if (this.state == 1)
     {
         if (!AssetDownloader.isDone)
         {
             return;
         }
         if (AssetManager.IsAssetBundle(self.mDesiredSceneName))
         {
             AssetManager.PrepareAssets(self.mDesiredSceneName);
             if (!AssetDownloader.isDone)
             {
                 ProgressWindow.OpenGenericDownloadWindow();
                 AssetDownloader.StartDownload(false, true, ThreadPriority.Normal);
                 this.state = 2;
                 return;
             }
         }
         this.state = 3;
     }
     if (this.state == 2)
     {
         if (!AssetDownloader.isDone)
         {
             return;
         }
         ProgressWindow.Close();
         this.state = 3;
     }
     if (this.state == 3)
     {
         self.mLastSceneName = self.mDesiredSceneName;
         this.req            = AssetManager.LoadSceneAsync(self.mDesiredSceneName, true);
         this.state          = 4;
     }
     if (this.state == 4)
     {
         if (!this.req.canBeActivated || self.mFadingOut || MonoSingleton <GameManager> .Instance.IsImportantJobRunning)
         {
             return;
         }
         if (!string.IsNullOrEmpty(self.UnloadTrigger))
         {
             GlobalEvent.Invoke(self.UnloadTrigger, (object)this);
         }
         SceneAwakeObserver.AddListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake));
         this.req.ActivateScene();
         if (!string.IsNullOrEmpty(self.mLastSceneName))
         {
             AssetManager.UnloadScene(self.mLastSceneName);
         }
         this.state = 5;
     }
     if (this.state == 5)
     {
         if (Object.op_Equality((Object)this.mNewScene, (Object)null) || !this.req.isDone)
         {
             return;
         }
         CriticalSection.Leave(CriticalSections.SceneChange);
         this.state = 6;
     }
     if (this.state == 6)
     {
         if (CriticalSection.IsActive)
         {
             return;
         }
         GC.Collect();
         this.asyncOp = AssetManager.UnloadUnusedAssets();
         this.state   = (MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L ? 7 : 101;
     }
     if (this.state == 7)
     {
         if (this.asyncOp != null && !this.asyncOp.get_isDone())
         {
             return;
         }
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 10);
         GameUtility.FadeIn(0.5f);
         self.mDesirdSceneSet = false;
         if (!self.mIgnorePopups && !self.mNewsShown && !GlobalVars.IsTitleStart.Get() && (MonoSingleton <GameManager> .Instance.Player.IsFirstLogin || GameUtility.isLoginInfoDisplay()))
         {
             self.mNewsShown = true;
             GlobalVars.IsTitleStart.Set(true);
             self.mStateMachine.GotoState <HomeWindow.State_LoginBonus>();
         }
         else
         {
             self.NotifyNewFriendRequests();
             if (HomeWindow.EnterHomeCount == 0)
             {
                 self.CheckTrophies();
             }
             if (!self.mNewsShown && !GlobalVars.IsTitleStart.Get() && (MonoSingleton <GameManager> .Instance.Player.IsFirstLogin || self.DebugLoginBonus))
             {
                 self.mNewsShown = true;
                 Json_LoginBonus recentLoginBonus = MonoSingleton <GameManager> .Instance.Player.RecentLoginBonus;
                 if (recentLoginBonus != null)
                 {
                     string iname;
                     int    num;
                     if (recentLoginBonus.coin > 0)
                     {
                         iname = "$COIN";
                         num   = recentLoginBonus.coin;
                     }
                     else
                     {
                         iname = recentLoginBonus.iname;
                         num   = recentLoginBonus.num;
                     }
                     ItemData data = new ItemData();
                     if (data.Setup(0L, iname, num))
                     {
                         NotifyList.PushLoginBonus(data);
                     }
                 }
                 self.NotifySupportResult();
             }
             self.mStateMachine.GotoState <HomeWindow.State_Default>();
         }
         if (self.mDesiredSceneIsHome)
         {
             self.UnlockContents();
             self.FgGIDLoginCheck();
             FlowNode_GameObject.ActivateOutputLinks((Component)self, 15);
         }
         else
         {
             FlowNode_GameObject.ActivateOutputLinks((Component)self, 16);
         }
     }
     if (this.state != 101)
     {
         return;
     }
     DebugUtility.LogWarning("TUTORIAL: HERE");
     FlowNode_GameObject.ActivateOutputLinks((Component)self, 16);
     FlowNode_GameObject.ActivateOutputLinks((Component)self, 10);
     GameUtility.FadeIn(0.5f);
     self.mDesirdSceneSet = false;
     self.mStateMachine.GotoState <HomeWindow.State_Tutorial>();
 }
Esempio n. 18
0
 private void OnSceneLoad(GameObject sceneRoot)
 {
     SceneAwakeObserver.RemoveListener(new SceneAwakeObserver.SceneEvent(this.OnSceneLoad));
     CriticalSection.Leave(CriticalSections.SceneChange);
 }
        public override void OnActivate(int pinID)
        {
            switch (pinID)
            {
            case 200:
                if (Network.Mode != Network.EConnectMode.Online)
                {
                    this.Failure();
                    break;
                }
                ((Behaviour)this).set_enabled(true);
                this.ExecRequest((WebAPI) new ReqMultiPlayResume((long)GlobalVars.BtlID, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                break;

            case 201:
                CriticalSection.Enter(CriticalSections.SceneChange);
                this.mStartingQuest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                if (!string.IsNullOrEmpty(this.QuestID))
                {
                    GlobalVars.SelectedQuestID  = this.QuestID;
                    GlobalVars.SelectedFriendID = string.Empty;
                }
                if (FlowNode_MultiPlayResume.BtlInfo == null)
                {
                    break;
                }
                MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance;
                if (Object.op_Inequality((Object)instance, (Object)null))
                {
                    MyPhoton.MyRoom currentRoom = instance.GetCurrentRoom();
                    if (currentRoom != null && !currentRoom.battle)
                    {
                        this.Failure();
                        CriticalSection.Leave(CriticalSections.SceneChange);
                        break;
                    }
                    instance.IsMultiPlay   = true;
                    instance.IsMultiVersus = this.mType == FlowNode_MultiPlayResume.RESUME_TYPE.VERSUS;
                }
                this.StartCoroutine(this.StartScene(new BattleCore.Json_Battle()
                {
                    btlinfo = (BattleCore.Json_BtlInfo)FlowNode_MultiPlayResume.BtlInfo,
                    btlid   = (long)GlobalVars.BtlID
                }));
                break;

            case 202:
                if (Network.Mode != Network.EConnectMode.Online)
                {
                    this.Failure();
                    break;
                }
                ((Behaviour)this).set_enabled(true);
                this.ExecRequest((WebAPI) new ReqVersusResume((long)GlobalVars.BtlID, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                break;

            case 203:
                if (Network.Mode != Network.EConnectMode.Online)
                {
                    this.Failure();
                    break;
                }
                if ((long)GlobalVars.BtlID != 0L && GlobalVars.QuestType == QuestTypes.MultiTower)
                {
                    ((Behaviour)this).set_enabled(true);
                    this.ExecRequest((WebAPI) new ReqMultiTwResume((long)GlobalVars.BtlID, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                    break;
                }
                ((Behaviour)this).set_enabled(false);
                this.ActivateOutputLinks(8000);
                break;

            default:
                base.OnActivate(pinID);
                break;
            }
        }
Esempio n. 20
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.VS_NotSelfBattle:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotPlayer:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotQuestInfo:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotQuestData:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_BattleNotEnd:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_ComBattleEnd:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_TowerNotPlay:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotContinuousEnemy:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_RowerNotMatching:
                    this.OnFailed();
                    break;

                default:
                    switch (errCode - 3800)
                    {
                    case Network.EErrCode.Success:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Unknown:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Version:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.AssetVersion:
                        this.OnBack();
                        return;

                    case Network.EErrCode.NoVersionDbg:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.Unknown | Network.EErrCode.NoVersionDbg:
                        this.OnBack();
                        return;

                    default:
                        switch (errCode - 202)
                        {
                        case Network.EErrCode.Success:
                        case Network.EErrCode.Unknown:
                        case Network.EErrCode.AssetVersion:
                        case Network.EErrCode.NoVersionDbg:
                            this.OnMultiMaintenance();
                            return;

                        default:
                            switch (errCode - 3300)
                            {
                            case Network.EErrCode.Success:
                                this.OnBack();
                                return;

                            case Network.EErrCode.Unknown:
                                this.OnBack();
                                return;

                            case Network.EErrCode.AssetVersion:
                                this.OnBack();
                                return;

                            default:
                                switch (errCode - 12001)
                                {
                                case Network.EErrCode.Success:
                                    this.OnFailed();
                                    return;

                                case Network.EErrCode.Version:
                                    CriticalSection.Leave(CriticalSections.SceneChange);
                                    Network.RemoveAPI();
                                    ((Behaviour)this).set_enabled(false);
                                    this.ActivateOutputLinks(600);
                                    return;

                                default:
                                    if (errCode != Network.EErrCode.NotLocation)
                                    {
                                        if (errCode != Network.EErrCode.NotGpsQuest)
                                        {
                                            if (errCode != Network.EErrCode.QuestEnd)
                                            {
                                                if (errCode != Network.EErrCode.NoBtlInfo)
                                                {
                                                    if (errCode == Network.EErrCode.MultiVersionMismatch)
                                                    {
                                                        this.OnMismatchVersion();
                                                        return;
                                                    }
                                                    this.OnRetry();
                                                    return;
                                                }
                                                this.OnFailed();
                                                return;
                                            }
                                            this.OnFailed();
                                            return;
                                        }
                                        CriticalSection.Leave(CriticalSections.SceneChange);
                                        Network.RemoveAPI();
                                        Network.ResetError();
                                        this.ActivateOutputLinks(400);
                                        ((Behaviour)this).set_enabled(false);
                                        return;
                                    }
                                    this.OnBack();
                                    return;
                                }
                            }
                        }
                    }
                }
            }
            else if (this.mReqID == 30)
            {
                Network.RemoveAPI();
                this.ActivateOutputLinks(5);
            }
            else
            {
                string text = www.text;
                DebugMenu.Log("API", "StartQuest:" + www.text);
                WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> >(www.text);
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    this.ActivateOutputLinks(5);
                    this.SetVersusAudienceParam(text);
                    if (this.mResume && (MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) == 0L && jsonObject.body.btlinfo.qid == "QE_OP_0002")
                    {
                        MonoSingleton <GameManager> .Instance.CompleteTutorialStep();
                    }
                    this.StartCoroutine(this.StartScene(jsonObject.body));
                }
            }
        }
Esempio n. 21
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.VS_NotSelfBattle:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotPlayer:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotQuestInfo:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotQuestData:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_BattleNotEnd:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_ComBattleEnd:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_TowerNotPlay:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotContinuousEnemy:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_RowerNotMatching:
                    this.OnFailed();
                    break;

                default:
                    switch (errCode - 3800)
                    {
                    case Network.EErrCode.Success:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Unknown:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Version:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.AssetVersion:
                        this.OnBack();
                        return;

                    case Network.EErrCode.NoVersionDbg:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.Unknown | Network.EErrCode.NoVersionDbg:
                        this.OnBack();
                        return;

                    default:
                        switch (errCode - 202)
                        {
                        case Network.EErrCode.Success:
                        case Network.EErrCode.Unknown:
                        case Network.EErrCode.AssetVersion:
                        case Network.EErrCode.NoVersionDbg:
                            this.OnMultiMaintenance();
                            return;

                        default:
                            switch (errCode - 3300)
                            {
                            case Network.EErrCode.Success:
                                this.OnBack();
                                return;

                            case Network.EErrCode.Unknown:
                                this.OnBack();
                                return;

                            case Network.EErrCode.AssetVersion:
                                this.OnBack();
                                return;

                            default:
                                switch (errCode - 12001)
                                {
                                case Network.EErrCode.Success:
                                    this.OnFailed();
                                    return;

                                case Network.EErrCode.Version:
                                    CriticalSection.Leave(CriticalSections.SceneChange);
                                    Network.RemoveAPI();
                                    ((Behaviour)this).set_enabled(false);
                                    this.ActivateOutputLinks(600);
                                    return;

                                default:
                                    if (errCode != Network.EErrCode.NotLocation)
                                    {
                                        if (errCode != Network.EErrCode.NotGpsQuest)
                                        {
                                            if (errCode != Network.EErrCode.QuestEnd)
                                            {
                                                if (errCode != Network.EErrCode.NoBtlInfo)
                                                {
                                                    if (errCode == Network.EErrCode.MultiVersionMismatch)
                                                    {
                                                        this.OnMismatchVersion();
                                                        return;
                                                    }
                                                    this.OnRetry();
                                                    return;
                                                }
                                                this.OnFailed();
                                                return;
                                            }
                                            this.OnFailed();
                                            return;
                                        }
                                        CriticalSection.Leave(CriticalSections.SceneChange);
                                        Network.RemoveAPI();
                                        Network.ResetError();
                                        this.ActivateOutputLinks(400);
                                        ((Behaviour)this).set_enabled(false);
                                        return;
                                    }
                                    this.OnBack();
                                    return;
                                }
                            }
                        }
                    }
                }
            }
            else if (this.mReqID == 30)
            {
                Network.RemoveAPI();
                this.ActivateOutputLinks(5);
            }
            else
            {
                string text = www.text;
                DebugMenu.Log("API", "StartQuest:" + www.text);
                WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> >(www.text);
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    if (jsonObject.body.is_rehash != 0)
                    {
                        GlobalVars.BtlID.Set(jsonObject.body.btlid);
                        UIUtility.SystemMessage(string.Empty, LocalizedText.Get("sys.FAILED_RESUMEQUEST"), (UIUtility.DialogResultEvent)(go =>
                        {
                            CriticalSection.Leave(CriticalSections.SceneChange);
                            this.ActivateOutputLinks(800);
                        }), (GameObject)null, false, -1);
                    }
                    else
                    {
                        this.ActivateOutputLinks(5);
                        this.SetVersusAudienceParam(text);
                        this.StartCoroutine(this.StartScene(jsonObject.body));
                    }
                }
            }
        }
Esempio n. 22
0
 public override void OnBack()
 {
     CriticalSection.Leave(CriticalSections.SceneChange);
     base.OnBack();
 }