Esempio n. 1
0
 public override void OnActivate(int pinID)
 {
     if (!GameUtility.Config_UseAssetBundles.Value)
     {
         this.ActivateOutputLinks(this.PINID_NOT_EXIST);
     }
     else if (pinID == this.PINID_CHECK)
     {
         if (this.IsExist())
         {
             this.ActivateOutputLinks(this.PINID_EXIST);
         }
         else
         {
             this.ActivateOutputLinks(this.PINID_NOT_EXIST);
         }
     }
     else
     {
         if (pinID != this.PINID_DELETE)
         {
             return;
         }
         CriticalSection.Enter(CriticalSections.Default);
         this.StartCoroutine(this.DeleteOldData());
     }
 }
 public override void OnActivate(int pinID)
 {
     if (pinID != 0 || ((Behaviour)this).get_enabled())
     {
         return;
     }
     this.mResult = 0;
     if (GameUtility.Config_UseAssetBundles.Value)
     {
         ((Behaviour)this).set_enabled(true);
         CriticalSection.Enter(CriticalSections.Default);
         FlowNode_LoadMasterParam.ThreadStartParam threadStartParam = new FlowNode_LoadMasterParam.ThreadStartParam();
         threadStartParam.self        = this;
         threadStartParam.GameManager = MonoSingleton <GameManager> .Instance;
         threadStartParam.Language    = GameUtility.Config_Language;
         Debug.Log((object)"Starting Thread");
         this.mMutex = new Mutex();
         new Thread(new ParameterizedThreadStart(FlowNode_LoadMasterParam.LoadMasterDataThread)).Start((object)threadStartParam);
     }
     else
     {
         ((Behaviour)this).set_enabled(false);
         this.ActivateOutputLinks(100);
     }
 }
Esempio n. 3
0
 private void StartGachaScene(FlowNode_ExecGacha.GachaModes mode)
 {
     CriticalSection.Enter(CriticalSections.SceneChange);
     this.mGachaMode      = mode;
     this.mGachaResultSet = false;
     ((Behaviour)this).set_enabled(true);
     this.StartCoroutine(this.StartGachaSceneAsync(mode));
 }
Esempio n. 4
0
        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:
                PunMonoSingleton <MyPhoton> .Instance.IsMultiPlay = true;
                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))
                {
                    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;

            default:
                base.OnActivate(pinID);
                break;
            }
        }
Esempio n. 5
0
 public override void OnActivate(int pinID)
 {
     if (pinID != 0 || ((Behaviour)this).get_enabled())
     {
         return;
     }
     ((Behaviour)this).set_enabled(true);
     CriticalSection.Enter(CriticalSections.SceneChange);
     this.StartCoroutine(this.StartScene(MonoSingleton <GameManager> .Instance.FindQuest((string)GlobalVars.ReplaySelectedQuestID)));
 }
Esempio n. 6
0
 public override void OnActivate(int pinID)
 {
     if (pinID != 0 || ((Behaviour)this).get_enabled())
     {
         return;
     }
     CriticalSection.Enter(CriticalSections.Default);
     ((Behaviour)this).set_enabled(true);
     this.StartCoroutine(this.ClearCacheAsync());
     this.ActivateOutputLinks(100);
 }
Esempio n. 7
0
        public override void OnActivate(int pinID)
        {
            MonoSingleton <GameManager> .Instance.AudienceMode = false;
            if (pinID == 10)
            {
                this.mResume = true;
                pinID        = 0;
            }
            if (pinID != 0 || ((Behaviour)this).get_enabled())
            {
                return;
            }
            ((Behaviour)this).set_enabled(true);
            CriticalSection.Enter(CriticalSections.SceneChange);
            PlayerPartyTypes type = PlayerPartyTypes.Tower;

            GlobalVars.SelectedPartyIndex.Set((int)type);
            MonoSingleton <GameManager> .Instance.Player.SetPartyCurrentIndex((int)type);

            PunMonoSingleton <MyPhoton> .Instance.IsMultiPlay   = false;
            PunMonoSingleton <MyPhoton> .Instance.IsMultiVersus = false;
            if (this.mResume)
            {
                this.btlID = (long)GlobalVars.BtlID;
                GlobalVars.BtlID.Set(0L);
                this.ExecRequest((WebAPI) new ReqTowerBtlComResume(this.btlID, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
            }
            else
            {
                GameManager instance = MonoSingleton <GameManager> .Instance;
                if (!string.IsNullOrEmpty(this.QuestID))
                {
                    GlobalVars.SelectedQuestID  = this.QuestID;
                    GlobalVars.SelectedFriendID = string.Empty;
                }
                this.mStartingQuest = instance.FindQuest(GlobalVars.SelectedQuestID);
                if (this.PlayOffline || Network.Mode != Network.EConnectMode.Online)
                {
                    return;
                }
                PartyData partyOfType = instance.Player.FindPartyOfType(type);
                if (this.mStartingQuest.type != QuestTypes.Tower)
                {
                    return;
                }
                TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(this.mStartingQuest.iname);

                this.ExecRequest((WebAPI) new ReqBtlTowerComReq(towerFloor.tower_id, towerFloor.iname, partyOfType, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
            }
        }
Esempio n. 8
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 100 || ((Behaviour)this).get_enabled())
            {
                return;
            }
            string str = (string)null;

            switch (this.SceneType)
            {
            case FlowNode_LoadScene.SceneTypes.HomeTown:
                SectionParam homeWorld = HomeUnitController.GetHomeWorld();
                if (homeWorld != null)
                {
                    str = homeWorld.home;
                    break;
                }
                break;

            case FlowNode_LoadScene.SceneTypes.BootScene:
                FlowNode_LoadScene.LoadBootScene();
                this.ActivateOutputLinks(21);
                return;

            default:
                str = this.SceneName;
                break;
            }
            if (string.IsNullOrEmpty(str))
            {
                DebugUtility.LogError("No Scene to load");
            }
            else
            {
                ((Behaviour)this).set_enabled(true);
                CriticalSection.Enter(CriticalSections.SceneChange);
                this.ActivateOutputLinks(20);
                DebugUtility.Log("LoadScene [" + str + "]");
                if (AssetManager.IsAssetBundle(str))
                {
                    this.StartCoroutine(this.PreLoadSceneAsync(str));
                }
                else
                {
                    this.StartSceneLoad(str);
                }
            }
        }
Esempio n. 9
0
 public static void RequestAPI(WebAPI api, bool highPriority = false)
 {
     if (highPriority)
     {
         MonoSingleton <SRPG.Network> .Instance.mRequests.Insert(0, api);
     }
     else
     {
         MonoSingleton <SRPG.Network> .Instance.mRequests.Add(api);
     }
     if (MonoSingleton <SRPG.Network> .Instance.mRequests.Count != 1)
     {
         return;
     }
     CriticalSection.Enter(CriticalSections.Network);
 }
Esempio n. 10
0
 public static void RequestAPI(WebAPI api, bool highPriority = false)
 {
     DebugUtility.Log("Request WebAPI: " + Network.Host + api.name);
     if (highPriority)
     {
         MonoSingleton <Network> .Instance.mRequests.Insert(0, api);
     }
     else
     {
         MonoSingleton <Network> .Instance.mRequests.Add(api);
     }
     if (MonoSingleton <Network> .Instance.mRequests.Count != 1)
     {
         return;
     }
     CriticalSection.Enter(CriticalSections.Network);
 }
 private void Play(string fileName)
 {
     ((Behaviour)this).set_enabled(true);
     this.hBGMVolume = new MySound.VolumeHandle(MySound.EType.BGM);
     this.hBGMVolume.SetVolume(0.0f, 0.0f);
     this.hVoiceVolume = new MySound.VolumeHandle(MySound.EType.VOICE);
     this.hVoiceVolume.SetVolume(0.0f, 0.0f);
     if (this.AutoFade)
     {
         SRPG_TouchInputModule.LockInput();
         CriticalSection.Enter(CriticalSections.Default);
         FadeController.Instance.FadeTo(this.FadeColor, 1f, 0);
         this.StartCoroutine(this.PlayDelayed(fileName, new StreamingMovie.OnFinished(this.OnFinished)));
     }
     else
     {
         MonoSingleton <StreamingMovie> .Instance.Play(fileName, new StreamingMovie.OnFinished(this.OnFinished), (string)null);
     }
 }
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
        private void PlayMovie(string filename)
        {
            this.hBGMVolume = new MySound.VolumeHandle(MySound.EType.BGM);
            this.hBGMVolume.SetVolume(0.0f, 0.0f);
            this.hVoiceVolume = new MySound.VolumeHandle(MySound.EType.VOICE);
            this.hVoiceVolume.SetVolume(0.0f, 0.0f);
            if (this.AutoFade)
            {
                SRPG_TouchInputModule.LockInput();
                CriticalSection.Enter(CriticalSections.Default);
                FadeController.Instance.FadeTo(this.FadeColor, this.FadeTime, 0);
                this.PlayFilename = filename;
            }
            else
            {
                MonoSingleton <StreamingMovie> .Instance.Play(filename, new StreamingMovie.OnFinished(this.Finished), "UI/FullScreenMovieDemo");

                this.Played = true;
            }
        }
Esempio n. 14
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnFailed();
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                if (jsonObject.body == null)
                {
                    this.OnFailed();
                }
                else
                {
                    try
                    {
                        MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);

                        MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);

                        MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.units);
                    }
                    catch (Exception ex)
                    {
                        DebugUtility.LogException(ex);
                        this.OnFailed();
                        return;
                    }
                    CriticalSection.Enter(CriticalSections.Network);
                    this.StartCoroutine(this.WaitDownloadAsync());
                }
            }
        }
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)
                {
                    Debug.LogError((object)("ホーム画面用ユニットが存在しません '" + homeWorld.unit + "'"));
                }
                else
                {
                    this.SetupUnit(unitDataByUnitId, -1);
                    base.Start();
                }
            }
        }
Esempio n. 16
0
 public override void OnActivate()
 {
     this.Sequence.Scene = (GameObject)null;
     LightmapSettings.set_lightmapsMode((LightmapsMode)0);
     if (!string.IsNullOrEmpty(this.SceneID))
     {
         if (this.FadeIn)
         {
             GameUtility.FadeOut(0.0f);
         }
         SceneAwakeObserver.AddListener(new SceneAwakeObserver.SceneEvent(this.OnSceneLoad));
         CriticalSection.Enter(CriticalSections.SceneChange);
         this.mAsyncOp = AssetManager.LoadSceneAsync(this.SceneID, true);
     }
     else
     {
         if (!Object.op_Inequality((Object)this.Sequence.Scene, (Object)null))
         {
             return;
         }
         this.Sequence.Scene = (GameObject)null;
         this.ActivateNext();
     }
 }
Esempio n. 17
0
        public override void OnActivate(int pinID)
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;
            MyPhoton    pt       = PunMonoSingleton <MyPhoton> .Instance;

            instance.AudienceMode  = false;
            this.mReqID            = pinID;
            pt.IsMultiPlay         = false;
            pt.IsMultiVersus       = false;
            instance.IsVSCpuBattle = false;
            pt.IsRankMatch         = false;
            if (pinID == 0 || pinID == 100 || (pinID == 200 || pinID == 250) || (pinID == 500 || pinID == 700 || pinID == 1000))
            {
                pt.IsMultiPlay         = pinID == 100 || pinID == 200 || pinID == 250 || pinID == 500;
                pt.IsMultiVersus       = pinID == 200 || pinID == 250;
                instance.IsVSCpuBattle = pinID == 700;
                pt.IsRankMatch         = pinID == 250;
                pinID = 0;
            }
            if (pinID == 10)
            {
                this.mResume = true;
                pinID        = 0;
            }
            if (pinID == 0)
            {
                if (((Behaviour)this).get_enabled())
                {
                    return;
                }
                ((Behaviour)this).set_enabled(true);
                CriticalSection.Enter(CriticalSections.SceneChange);
                if (this.mResume)
                {
                    long btlId = (long)GlobalVars.BtlID;
                    GlobalVars.BtlID.Set(0L);
                    this.ExecRequest((WebAPI) new ReqBtlComResume(btlId, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                }
                else
                {
                    this.mStartingQuest = instance.FindQuest(GlobalVars.SelectedQuestID);
                    PlayerPartyTypes partyIndex1 = this.QuestToPartyIndex(this.mStartingQuest.type);
                    if (!string.IsNullOrEmpty(this.QuestID))
                    {
                        GlobalVars.SelectedQuestID  = this.QuestID;
                        GlobalVars.SelectedFriendID = string.Empty;
                    }
                    if (!this.PlayOffline && Network.Mode == Network.EConnectMode.Online)
                    {
                        if (this.mStartingQuest.type == QuestTypes.Arena)
                        {
                            this.ActivateOutputLinks(5);
                            this.StartCoroutine(this.StartScene((BattleCore.Json_Battle)null));
                        }
                        else if (this.mStartingQuest.type == QuestTypes.Ordeal)
                        {
                            this.ExecRequest((WebAPI) new ReqBtlOrdealReq(this.mStartingQuest.iname, GlobalVars.OrdealSupports, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                        }
                        else
                        {
                            PartyData        partyOfType      = instance.Player.FindPartyOfType(partyIndex1);
                            int              partyIndex2      = instance.Player.Partys.IndexOf(partyOfType);
                            bool             multi            = false;
                            bool             isHost           = false;
                            int              seat             = -1;
                            int              plid             = -1;
                            string           uid              = string.Empty;
                            List <string>    stringList       = new List <string>();
                            VersusStatusData versusStatusData = (VersusStatusData)null;
                            int              num1             = 0;
                            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)pt, (UnityEngine.Object)null))
                            {
                                multi  = pt.IsMultiPlay;
                                isHost = pt.IsOldestPlayer();
                                seat   = pt.MyPlayerIndex;
                                MyPhoton.MyPlayer myPlayer = pt.GetMyPlayer();
                                if (myPlayer != null)
                                {
                                    plid = myPlayer.playerID;
                                }
                                if (pt.IsMultiVersus)
                                {
                                    List <JSON_MyPhotonPlayerParam> myPlayersStarted = pt.GetMyPlayersStarted();
                                    MyPhoton.MyRoom          currentRoom             = pt.GetCurrentRoom();
                                    int                      num2 = currentRoom == null ? 1 : currentRoom.playerCount;
                                    JSON_MyPhotonPlayerParam photonPlayerParam = myPlayersStarted.Find((Predicate <JSON_MyPhotonPlayerParam>)(p => p.playerIndex != pt.MyPlayerIndex));
                                    if (photonPlayerParam != null)
                                    {
                                        uid = photonPlayerParam.UID;
                                    }
                                    if (!GlobalVars.IsVersusDraftMode)
                                    {
                                        if (string.IsNullOrEmpty(uid) || num2 == 1)
                                        {
                                            this.OnVersusNoPlayer();
                                            return;
                                        }
                                        PlayerPartyTypes playerPartyTypes = PlayerPartyTypes.Versus;
                                        if (pt.IsRankMatch)
                                        {
                                            playerPartyTypes = PlayerPartyTypes.RankMatch;
                                        }
                                        PartyData party = instance.Player.Partys[(int)playerPartyTypes];
                                        if (party != null)
                                        {
                                            versusStatusData = new VersusStatusData();
                                            for (int index = 0; index < party.MAX_UNIT; ++index)
                                            {
                                                long unitUniqueId = party.GetUnitUniqueID(index);
                                                if (party.GetUnitUniqueID(index) != 0L)
                                                {
                                                    UnitData unitDataByUniqueId = instance.Player.FindUnitDataByUniqueID(unitUniqueId);
                                                    if (unitDataByUniqueId != null)
                                                    {
                                                        versusStatusData.Add(unitDataByUniqueId.Status.param, unitDataByUniqueId.GetCombination());
                                                        ++num1;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    else
                                    {
                                        versusStatusData = new VersusStatusData();
                                        for (int index = 0; index < VersusDraftList.VersusDraftPartyUnits.Count; ++index)
                                        {
                                            UnitData versusDraftPartyUnit = VersusDraftList.VersusDraftPartyUnits[index];
                                            if (versusDraftPartyUnit != null)
                                            {
                                                versusStatusData.Add(versusDraftPartyUnit.Status.param, versusDraftPartyUnit.GetCombination());
                                                ++num1;
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    List <JSON_MyPhotonPlayerParam> myPlayersStarted = pt.GetMyPlayersStarted();
                                    for (int index = 0; index < myPlayersStarted.Count; ++index)
                                    {
                                        if (myPlayersStarted[index].playerIndex != pt.MyPlayerIndex)
                                        {
                                            stringList.Add(myPlayersStarted[index].UID);
                                        }
                                    }
                                }
                            }
                            if (this.mReqID == 200)
                            {
                                if (GlobalVars.IsVersusDraftMode)
                                {
                                    int enemy_draft_id       = 0;
                                    MyPhoton.MyPlayer player = PunMonoSingleton <MyPhoton> .Instance.GetMyPlayer();

                                    JSON_MyPhotonPlayerParam photonPlayerParam = pt.GetMyPlayersStarted().Find((Predicate <JSON_MyPhotonPlayerParam>)(p => p.playerID != player.playerID));
                                    if (photonPlayerParam != null)
                                    {
                                        enemy_draft_id = photonPlayerParam.draft_id;
                                    }
                                    this.ExecRequest((WebAPI) new ReqVersus(this.mStartingQuest.iname, plid, seat, uid, versusStatusData, num1, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback), GlobalVars.SelectedMultiPlayVersusType, VersusDraftList.DraftID, enemy_draft_id));
                                }
                                else
                                {
                                    this.ExecRequest((WebAPI) new ReqVersus(this.mStartingQuest.iname, plid, seat, uid, versusStatusData, num1, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback), GlobalVars.SelectedMultiPlayVersusType, 0, 0));
                                }
                            }
                            else if (this.mReqID == 250)
                            {
                                this.ExecRequest((WebAPI) new ReqRankMatch(this.mStartingQuest.iname, plid, seat, uid, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                            }
                            else if (this.mReqID == 500)
                            {
                                this.ExecRequest((WebAPI) new ReqBtlMultiTwReq(this.mStartingQuest.iname, partyIndex2, plid, seat, stringList.ToArray(), new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                            }
                            else if (this.mReqID == 700)
                            {
                                this.ExecRequest((WebAPI) new ReqVersusCpu(this.mStartingQuest.iname, GlobalVars.VersusCpu == null ? 1 : GlobalVars.VersusCpu.Get().Deck, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                            }
                            else
                            {
                                this.ExecRequest((WebAPI) new ReqBtlComReq(this.mStartingQuest.iname, GlobalVars.SelectedFriendID, GlobalVars.SelectedSupport.Get(), new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback), multi, partyIndex2, isHost, plid, seat, GlobalVars.Location, GlobalVars.SelectedRankingQuestParam));
                            }
                        }
                    }
                    else
                    {
                        this.StartCoroutine(this.StartScene((BattleCore.Json_Battle)null));
                    }
                }
            }
            else if (pinID == 20)
            {
                if (instance.AudienceRoom == null)
                {
                    return;
                }
                this.StartCoroutine(this.StartAudience());
            }
            else
            {
                if (pinID != 30)
                {
                    return;
                }
                if (Network.IsError)
                {
                    this.ActivateOutputLinks(300);
                    Network.ResetError();
                }
                else if (!Network.IsStreamConnecting)
                {
                    Network.ResetError();
                    this.ActivateOutputLinks(300);
                }
                else
                {
                    VersusAudienceManager audienceManager = instance.AudienceManager;
                    audienceManager.AddStartQuest();
                    if (audienceManager.GetStartedParam() != null)
                    {
                        if (audienceManager.GetStartedParam().btlinfo != null)
                        {
                            BattleCore.Json_Battle json = new BattleCore.Json_Battle();
                            json.btlinfo = audienceManager.GetStartedParam().btlinfo;
                            CriticalSection.Enter(CriticalSections.SceneChange);
                            instance.AudienceMode = true;
                            this.StartCoroutine(this.StartScene(json));
                        }
                        else if (audienceManager.IsRetryError)
                        {
                            DebugUtility.LogError("Not Exist btlInfo");
                            Network.Abort();
                            this.ActivateOutputLinks(300);
                        }
                        else
                        {
                            this.ActivateOutputLinks(9);
                        }
                    }
                    else if (audienceManager.IsRetryError)
                    {
                        DebugUtility.LogError("Not Exist StartParam");
                        Network.Abort();
                        this.ActivateOutputLinks(300);
                    }
                    else
                    {
                        this.ActivateOutputLinks(9);
                    }
                }
            }
        }
Esempio n. 18
0
        public override void OnActivate(int pinID)
        {
            int num1 = pinID;

            if (pinID == 0 || pinID == 100 || pinID == 200)
            {
                PunMonoSingleton <MyPhoton> .Instance.IsMultiPlay   = pinID == 100 || pinID == 200;
                PunMonoSingleton <MyPhoton> .Instance.IsMultiVersus = pinID == 200;
                pinID = 0;
            }
            if (pinID == 10)
            {
                this.mResume = true;
                pinID        = 0;
            }
            if (pinID != 0 || ((Behaviour)this).get_enabled())
            {
                return;
            }
            ((Behaviour)this).set_enabled(true);
            CriticalSection.Enter(CriticalSections.SceneChange);
            if (this.mResume)
            {
                long btlId = (long)GlobalVars.BtlID;
                GlobalVars.BtlID.Set(0L);
                this.ExecRequest((WebAPI) new ReqBtlComResume(btlId, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
            }
            else
            {
                GameManager instance = MonoSingleton <GameManager> .Instance;
                this.mStartingQuest = instance.FindQuest(GlobalVars.SelectedQuestID);
                PlayerPartyTypes partyIndex1 = this.QuestToPartyIndex(this.mStartingQuest.type);
                if (!string.IsNullOrEmpty(this.QuestID))
                {
                    GlobalVars.SelectedQuestID  = this.QuestID;
                    GlobalVars.SelectedFriendID = string.Empty;
                }
                if (!this.PlayOffline && Network.Mode == Network.EConnectMode.Online)
                {
                    PartyData partyOfType = instance.Player.FindPartyOfType(partyIndex1);
                    int       partyIndex2 = instance.Player.Partys.IndexOf(partyOfType);
                    if (this.mStartingQuest.type == QuestTypes.Arena)
                    {
                        ArenaPlayer selectedArenaPlayer = (ArenaPlayer)GlobalVars.SelectedArenaPlayer;
                        this.ExecRequest((WebAPI) new ReqBtlColoReq(this.mStartingQuest.iname, selectedArenaPlayer.FUID, selectedArenaPlayer, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback), partyIndex2));
                    }
                    else
                    {
                        // ISSUE: object of a compiler-generated type is created
                        // ISSUE: variable of a compiler-generated type
                        FlowNode_StartQuest.\u003COnActivate\u003Ec__AnonStorey20E activateCAnonStorey20E = new FlowNode_StartQuest.\u003COnActivate\u003Ec__AnonStorey20E();
                        // ISSUE: reference to a compiler-generated field
                        activateCAnonStorey20E.pt = PunMonoSingleton <MyPhoton> .Instance;
                        bool   multi  = false;
                        bool   isHost = false;
                        int    seat   = -1;
                        int    plid   = -1;
                        string uid    = string.Empty;
                        // ISSUE: reference to a compiler-generated field
                        if (Object.op_Inequality((Object)activateCAnonStorey20E.pt, (Object)null))
                        {
                            // ISSUE: reference to a compiler-generated field
                            multi = activateCAnonStorey20E.pt.IsMultiPlay;
                            // ISSUE: reference to a compiler-generated field
                            isHost = activateCAnonStorey20E.pt.IsOldestPlayer();
                            // ISSUE: reference to a compiler-generated field
                            seat = activateCAnonStorey20E.pt.MyPlayerIndex;
                            // ISSUE: reference to a compiler-generated field
                            MyPhoton.MyPlayer myPlayer = activateCAnonStorey20E.pt.GetMyPlayer();
                            if (myPlayer != null)
                            {
                                plid = myPlayer.playerID;
                            }
                            // ISSUE: reference to a compiler-generated field
                            if (activateCAnonStorey20E.pt.IsMultiVersus)
                            {
                                // ISSUE: reference to a compiler-generated field
                                List <JSON_MyPhotonPlayerParam> myPlayersStarted = activateCAnonStorey20E.pt.GetMyPlayersStarted();
                                // ISSUE: reference to a compiler-generated field
                                MyPhoton.MyRoom currentRoom = activateCAnonStorey20E.pt.GetCurrentRoom();
                                int             num2        = currentRoom == null ? 1 : currentRoom.playerCount;
                                // ISSUE: reference to a compiler-generated method
                                JSON_MyPhotonPlayerParam photonPlayerParam = myPlayersStarted.Find(new Predicate <JSON_MyPhotonPlayerParam>(activateCAnonStorey20E.\u003C\u003Em__1F5));
                                if (photonPlayerParam != null)
                                {
                                    uid = photonPlayerParam.UID;
                                }
                                if (string.IsNullOrEmpty(uid) || num2 == 1)
                                {
                                    this.OnVersusNoPlayer();
                                    return;
                                }
                            }
                        }
                        if (num1 == 200)
                        {
                            this.ExecRequest((WebAPI) new ReqVersus(this.mStartingQuest.iname, plid, seat, uid, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback), GlobalVars.SelectedMultiPlayVersusType));
                        }
                        else
                        {
                            this.ExecRequest((WebAPI) new ReqBtlComReq(this.mStartingQuest.iname, GlobalVars.SelectedFriendID, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback), multi, partyIndex2, isHost, plid, seat));
                        }
                    }
                }
                else
                {
                    this.StartCoroutine(this.StartScene((BattleCore.Json_Battle)null));
                }
            }
        }
Esempio n. 19
0
        public override void OnActivate(int pinID)
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            instance.AudienceMode = false;
            this.mReqID           = pinID;
            if (pinID == 0 || pinID == 100 || (pinID == 200 || pinID == 500))
            {
                PunMonoSingleton <MyPhoton> .Instance.IsMultiPlay   = pinID == 100 || pinID == 200 || pinID == 500;
                PunMonoSingleton <MyPhoton> .Instance.IsMultiVersus = pinID == 200;
                pinID = 0;
            }
            if (pinID == 10)
            {
                this.mResume = true;
                pinID        = 0;
            }
            if (pinID == 0)
            {
                if (((Behaviour)this).get_enabled())
                {
                    return;
                }
                ((Behaviour)this).set_enabled(true);
                CriticalSection.Enter(CriticalSections.SceneChange);
                if (this.mResume)
                {
                    long btlId = (long)GlobalVars.BtlID;
                    GlobalVars.BtlID.Set(0L);
                    this.ExecRequest((WebAPI) new ReqBtlComResume(btlId, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                }
                else
                {
                    this.mStartingQuest = instance.FindQuest(GlobalVars.SelectedQuestID);
                    PlayerPartyTypes partyIndex1 = this.QuestToPartyIndex(this.mStartingQuest.type);
                    if (!string.IsNullOrEmpty(this.QuestID))
                    {
                        GlobalVars.SelectedQuestID  = this.QuestID;
                        GlobalVars.SelectedFriendID = string.Empty;
                    }
                    if (!this.PlayOffline && Network.Mode == Network.EConnectMode.Online)
                    {
                        PartyData partyOfType = instance.Player.FindPartyOfType(partyIndex1);
                        int       partyIndex2 = instance.Player.Partys.IndexOf(partyOfType);
                        if (this.mStartingQuest.type == QuestTypes.Arena)
                        {
                            this.ActivateOutputLinks(5);
                            this.StartCoroutine(this.StartScene((BattleCore.Json_Battle)null));
                        }
                        else
                        {
                            // ISSUE: object of a compiler-generated type is created
                            // ISSUE: variable of a compiler-generated type
                            FlowNode_StartQuest.\u003COnActivate\u003Ec__AnonStorey2CC activateCAnonStorey2Cc = new FlowNode_StartQuest.\u003COnActivate\u003Ec__AnonStorey2CC();
                            // ISSUE: reference to a compiler-generated field
                            activateCAnonStorey2Cc.pt = PunMonoSingleton <MyPhoton> .Instance;
                            bool          multi      = false;
                            bool          isHost     = false;
                            int           seat       = -1;
                            int           plid       = -1;
                            string        uid        = string.Empty;
                            List <string> stringList = new List <string>();
                            // ISSUE: reference to a compiler-generated field
                            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)activateCAnonStorey2Cc.pt, (UnityEngine.Object)null))
                            {
                                // ISSUE: reference to a compiler-generated field
                                multi = activateCAnonStorey2Cc.pt.IsMultiPlay;
                                // ISSUE: reference to a compiler-generated field
                                isHost = activateCAnonStorey2Cc.pt.IsOldestPlayer();
                                // ISSUE: reference to a compiler-generated field
                                seat = activateCAnonStorey2Cc.pt.MyPlayerIndex;
                                // ISSUE: reference to a compiler-generated field
                                MyPhoton.MyPlayer myPlayer = activateCAnonStorey2Cc.pt.GetMyPlayer();
                                if (myPlayer != null)
                                {
                                    plid = myPlayer.playerID;
                                }
                                // ISSUE: reference to a compiler-generated field
                                if (activateCAnonStorey2Cc.pt.IsMultiVersus)
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    List <JSON_MyPhotonPlayerParam> myPlayersStarted = activateCAnonStorey2Cc.pt.GetMyPlayersStarted();
                                    // ISSUE: reference to a compiler-generated field
                                    MyPhoton.MyRoom currentRoom = activateCAnonStorey2Cc.pt.GetCurrentRoom();
                                    int             num         = currentRoom == null ? 1 : currentRoom.playerCount;
                                    // ISSUE: reference to a compiler-generated method
                                    JSON_MyPhotonPlayerParam photonPlayerParam = myPlayersStarted.Find(new Predicate <JSON_MyPhotonPlayerParam>(activateCAnonStorey2Cc.\u003C\u003Em__2AB));
                                    if (photonPlayerParam != null)
                                    {
                                        uid = photonPlayerParam.UID;
                                    }
                                    if (string.IsNullOrEmpty(uid) || num == 1)
                                    {
                                        this.OnVersusNoPlayer();
                                        return;
                                    }
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    List <JSON_MyPhotonPlayerParam> myPlayersStarted = activateCAnonStorey2Cc.pt.GetMyPlayersStarted();
                                    for (int index = 0; index < myPlayersStarted.Count; ++index)
                                    {
                                        // ISSUE: reference to a compiler-generated field
                                        if (myPlayersStarted[index].playerIndex != activateCAnonStorey2Cc.pt.MyPlayerIndex)
                                        {
                                            stringList.Add(myPlayersStarted[index].UID);
                                        }
                                    }
                                }
                            }
                            if (this.mReqID == 200)
                            {
                                this.ExecRequest((WebAPI) new ReqVersus(this.mStartingQuest.iname, plid, seat, uid, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback), GlobalVars.SelectedMultiPlayVersusType));
                            }
                            else if (this.mReqID == 500)
                            {
                                this.ExecRequest((WebAPI) new ReqBtlMultiTwReq(this.mStartingQuest.iname, partyIndex2, plid, seat, stringList.ToArray(), new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                            }
                            else
                            {
                                this.ExecRequest((WebAPI) new ReqBtlComReq(this.mStartingQuest.iname, GlobalVars.SelectedFriendID, GlobalVars.SelectedSupport.Get(), new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback), multi, partyIndex2, isHost, plid, seat, GlobalVars.Location, GlobalVars.SelectedRankingQuestParam));
                            }
                        }
                    }
                    else
                    {
                        this.StartCoroutine(this.StartScene((BattleCore.Json_Battle)null));
                    }
                }
            }
            else if (pinID == 20)
            {
                if (instance.AudienceRoom == null)
                {
                    return;
                }
                this.StartCoroutine(this.StartAudience());
            }
            else
            {
                if (pinID != 30)
                {
                    return;
                }
                if (Network.IsError)
                {
                    this.ActivateOutputLinks(300);
                    Network.ResetError();
                }
                else if (!Network.IsStreamConnecting)
                {
                    Network.ResetError();
                    this.ActivateOutputLinks(300);
                }
                else
                {
                    VersusAudienceManager audienceManager = instance.AudienceManager;
                    audienceManager.AddStartQuest();
                    if (audienceManager.GetStartedParam() != null)
                    {
                        if (audienceManager.GetStartedParam().btlinfo != null)
                        {
                            BattleCore.Json_Battle json = new BattleCore.Json_Battle();
                            json.btlinfo = audienceManager.GetStartedParam().btlinfo;
                            CriticalSection.Enter(CriticalSections.SceneChange);
                            instance.AudienceMode = true;
                            this.StartCoroutine(this.StartScene(json));
                        }
                        else
                        {
                            DebugUtility.LogError("Not Exist btlInfo");
                            if (audienceManager.IsRetryError)
                            {
                                Network.Abort();
                                this.ActivateOutputLinks(300);
                            }
                            else
                            {
                                this.ActivateOutputLinks(9);
                            }
                        }
                    }
                    else
                    {
                        DebugUtility.LogError("Not Exist StartParam");
                        if (audienceManager.IsRetryError)
                        {
                            Network.Abort();
                            this.ActivateOutputLinks(300);
                        }
                        else
                        {
                            this.ActivateOutputLinks(9);
                        }
                    }
                }
            }
        }
Esempio n. 20
0
 public override void Begin(HomeWindow self)
 {
     CriticalSection.Enter(CriticalSections.SceneChange);
 }