Example #1
0
 public static void ReAuth()
 {
     if (!GameCenterManager.isValidEnvironment())
     {
         ;
     }
 }
Example #2
0
 public static void ReAuth()
 {
     if (!GameCenterManager.isValidEnvironment() || PlayGamesPlatform.Instance.localUser.get_authenticated())
     {
         return;
     }
     PlayGamesPlatform.Instance.Authenticate(new Action <bool>(GameCenterManager.ProcessAuthGameCenter));
 }
Example #3
0
 public static void SendAchievementProgress(AchievementParam param)
 {
     if (param == null)
     {
         return;
     }
     GameCenterManager.SendAchievementProgressInternal(param.AchievementID);
 }
Example #4
0
        public static void SendAchievementProgressInternal(string achievementID)
        {
            if (string.IsNullOrEmpty(achievementID))
            {
                return;
            }
            long progress = 100;

            GameCenterManager.SendAchievementProgress(achievementID, progress);
        }
Example #5
0
        public static void SendAchievementProgress(string iname)
        {
            AchievementParam achievementParam = GameCenterManager.GetAchievementParam(iname);

            if (achievementParam == null)
            {
                return;
            }
            GameCenterManager.SendAchievementProgressInternal(achievementParam.AchievementID);
        }
Example #6
0
 public void OnClick()
 {
     if (GameCenterManager.IsAuth())
     {
         GameCenterManager.ShowAchievement();
     }
     else
     {
         GameCenterManager.ReAuth();
     }
 }
Example #7
0
 public static void Auth()
 {
     if (!GameCenterManager.isValidEnvironment())
     {
         return;
     }
     PlayGamesPlatform.InitializeInstance(new PlayGamesClientConfiguration.Builder().Build());
     PlayGamesPlatform.Activate();
     if (PlayGamesPlatform.Instance.localUser.get_authenticated())
     {
         return;
     }
     PlayGamesPlatform.Instance.Authenticate(new Action <bool>(GameCenterManager.ProcessAuthGameCenter), true);
 }
Example #8
0
        public static void SendAchievementProgress(string iname)
        {
            Debug.Log((object)("Call SendAchievementProgress:" + iname));
            string platformAchievementId = GameCenterManager.GetPlatformAchievementId(iname);

            if (string.IsNullOrEmpty(platformAchievementId))
            {
                return;
            }
            Debug.Log((object)("Exec SendAchievementProgress:" + platformAchievementId));
            long progress = 100;

            GameCenterManager.SendAchievementProgress(platformAchievementId, progress);
        }
Example #9
0
        public void OnClick()
        {
            if (GameCenterManager.IsAuth())
            {
                GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

                if (Object.op_Inequality((Object)instanceDirect, (Object)null))
                {
                    instanceDirect.Player.UpdateAchievementTrophyStates();
                }
                GameCenterManager.ShowAchievement();
            }
            else
            {
                GameCenterManager.ReAuth();
            }
        }
Example #10
0
        private static AchievementParam GetAchievementParam(string iname)
        {
            List <AchievementParam> achievementData = GameCenterManager.GetAchievementData();

            if (achievementData == null || achievementData.Count < 1)
            {
                return((AchievementParam)null);
            }
            using (List <AchievementParam> .Enumerator enumerator = achievementData.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    AchievementParam current = enumerator.Current;
                    if (current.iname == iname)
                    {
                        return(current);
                    }
                }
            }
            return((AchievementParam)null);
        }
Example #11
0
        public static string GetPlatformAchievementId(string iname)
        {
            List <AchievementParam> achievementData = GameCenterManager.GetAchievementData();

            if (achievementData == null)
            {
                return(string.Empty);
            }
            using (List <AchievementParam> .Enumerator enumerator = achievementData.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    AchievementParam current = enumerator.Current;
                    if (current.iname == iname)
                    {
                        return(current.googleplay);
                    }
                }
            }
            return(string.Empty);
        }
Example #12
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <Json_ResAwardList> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ResAwardList> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         if (jsonObject.body == null)
         {
             this.Failure();
         }
         else
         {
             string[] awards = jsonObject.body.awards;
             if (awards != null)
             {
                 for (int index = 0; index < awards.Length; ++index)
                 {
                     if (!string.IsNullOrEmpty(awards[index]))
                     {
                         GameCenterManager.SendAchievementProgress(awards[index]);
                     }
                 }
                 this.Success();
             }
             else
             {
                 this.Failure();
             }
         }
     }
 }
        private void Success()
        {
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            if (Network.Mode == Network.EConnectMode.Offline)
            {
                for (int index = 0; index < this.mTrophyParam.Items.Length; ++index)
                {
                    player.GainItem(this.mTrophyParam.Items[index].iname, this.mTrophyParam.Items[index].Num);
                }
            }
            for (int index = 0; index < this.mTrophyParam.Items.Length; ++index)
            {
                player.OnItemQuantityChange(this.mTrophyParam.Items[index].iname, this.mTrophyParam.Items[index].Num);
            }
            player.OnCoinChange(this.mTrophyParam.Coin);
            player.OnGoldChange(this.mTrophyParam.Gold);
            if (player.Lv > this.mLevelOld)
            {
                player.OnPlayerLevelChange(player.Lv - this.mLevelOld);
            }
            GlobalVars.PlayerLevelChanged.Set(player.Lv != this.mLevelOld);
            GlobalVars.PlayerExpNew.Set(player.Exp);
            player.MarkTrophiesEnded(new TrophyParam[1]
            {
                this.mTrophyParam
            });
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardWindow, (UnityEngine.Object)null))
            {
                RewardData data = new RewardData();
                data.Coin = this.mTrophyParam.Coin;
                data.Gold = this.mTrophyParam.Gold;
                data.Exp  = this.mTrophyParam.Exp;
                if (data.Coin > 0)
                {
                    AnalyticsManager.TrackFreePremiumCurrencyObtain((long)data.Coin, "Milestone Reward");
                }
                if (data.Gold > 0)
                {
                    AnalyticsManager.TrackNonPremiumCurrencyObtain(AnalyticsManager.NonPremiumCurrencyType.Zeni, (long)data.Gold, "Milestone Reward", (string)null);
                }
                GameManager instance = MonoSingleton <GameManager> .Instance;
                for (int index = 0; index < this.mTrophyParam.Items.Length; ++index)
                {
                    ItemData itemData = new ItemData();
                    if (itemData.Setup(0L, this.mTrophyParam.Items[index].iname, this.mTrophyParam.Items[index].Num))
                    {
                        data.Items.Add(itemData);
                        ItemData itemDataByItemId = instance.Player.FindItemDataByItemID(itemData.Param.iname);
                        int      num = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                        data.ItemsBeforeAmount.Add(num);
                        AnalyticsManager.TrackNonPremiumCurrencyObtain(itemDataByItemId.Param.type != EItemType.Ticket ? AnalyticsManager.NonPremiumCurrencyType.Item : AnalyticsManager.NonPremiumCurrencyType.SummonTicket, (long)itemDataByItemId.Num, "Milestone Reward", itemDataByItemId.ItemID);
                    }
                }
                DataSource.Bind <RewardData>(this.RewardWindow, data);
            }
            GameCenterManager.SendAchievementProgress(this.mTrophyParam.iname);
            if (this.mTrophyParam != null && this.mTrophyParam.Objectives != null)
            {
                for (int index = 0; index < this.mTrophyParam.Objectives.Length; ++index)
                {
                    if (this.mTrophyParam.Objectives[index].type == TrophyConditionTypes.followtwitter)
                    {
                        string reviewUrlTwitter = this.ReviewURL_Twitter;
                        if (!string.IsNullOrEmpty(reviewUrlTwitter))
                        {
                            Application.OpenURL(reviewUrlTwitter);
                            break;
                        }
                        break;
                    }
                }
            }
            ((Behaviour)this).set_enabled(false);
            this.ActivateOutputLinks(1);
        }
Example #14
0
        public void Activated(int pinID)
        {
            if (99 <= pinID && pinID < 122)
            {
                TrophyState[] trophyStates = MonoSingleton <GameManager> .Instance.Player.TrophyStates;
                if (trophyStates != null)
                {
                    for (int index = 0; index < trophyStates.Length; ++index)
                    {
                        if (trophyStates[index].IsCompleted)
                        {
                            TrophyParam trophy = MonoSingleton <GameManager> .Instance.MasterParam.GetTrophy(trophyStates[index].iname);

                            if (trophy != null)
                            {
                                GameCenterManager.SendAchievementProgress(trophy.iname);
                            }
                        }
                    }
                }
                if (this.mDesirdSceneSet)
                {
                    return;
                }
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                HomeWindow.\u003CActivated\u003Ec__AnonStorey251 activatedCAnonStorey251 = new HomeWindow.\u003CActivated\u003Ec__AnonStorey251();
                // ISSUE: reference to a compiler-generated field
                activatedCAnonStorey251.desiredSceneName = (string)null;
                bool flag1 = false;
                bool flag2 = GlobalVars.ForceSceneChange;
                GlobalVars.ForceSceneChange = false;
                if (pinID == 99)
                {
                    SectionParam homeWorld = HomeUnitController.GetHomeWorld();
                    if (homeWorld != null)
                    {
                        // ISSUE: reference to a compiler-generated field
                        activatedCAnonStorey251.desiredSceneName = homeWorld.home;
                        flag1 = true;
                    }
                }
                else
                {
                    // ISSUE: reference to a compiler-generated field
                    activatedCAnonStorey251.desiredSceneName = this.SceneNames[pinID - 100];
                    // ISSUE: reference to a compiler-generated field
                    if (activatedCAnonStorey251.desiredSceneName == "world001")
                    {
                        // ISSUE: reference to a compiler-generated field
                        activatedCAnonStorey251.desiredSceneName = "world001_sg";
                    }
                }
                // ISSUE: reference to a compiler-generated method
                if (Array.FindIndex <string>(this.IgnoreSameSceneCheck, new Predicate <string>(activatedCAnonStorey251.\u003C\u003Em__29C)) != -1)
                {
                    flag2 = true;
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                if (string.IsNullOrEmpty(activatedCAnonStorey251.desiredSceneName) || !flag2 && !(this.mLastSceneName != activatedCAnonStorey251.desiredSceneName) || !MonoSingleton <GameManager> .Instance.PrepareSceneChange())
                {
                    return;
                }
                this.mDesirdSceneSet = true;
                // ISSUE: reference to a compiler-generated field
                this.mDesiredSceneName   = activatedCAnonStorey251.desiredSceneName;
                this.mDesiredSceneIsHome = flag1;
                if ((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) == 0L)
                {
                    GameManager instance = MonoSingleton <GameManager> .Instance;
                    if (!this.mDesiredSceneIsHome)
                    {
                        // ISSUE: reference to a compiler-generated field
                        if (activatedCAnonStorey251.desiredSceneName == "Home_Gacha")
                        {
                            if (instance.GetNextTutorialStep() != "ShowSummonButton")
                            {
                                this.mDesirdSceneSet = false;
                            }
                        }
                        else
                        {
                            // ISSUE: reference to a compiler-generated field
                            if (activatedCAnonStorey251.desiredSceneName == "Home_UnitList")
                            {
                                if (instance.GetNextTutorialStep() != "ShowUnitButton")
                                {
                                    this.mDesirdSceneSet = false;
                                }
                            }
                            else
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (activatedCAnonStorey251.desiredSceneName == "world001_sg")
                                {
                                    if (instance.GetNextTutorialStep() != "ShowStoryButton")
                                    {
                                        this.mDesirdSceneSet = false;
                                    }
                                }
                                else
                                {
                                    this.mDesirdSceneSet = false;
                                    return;
                                }
                            }
                        }
                    }
                }
                this.mIgnorePopups = !this.mDesiredSceneIsHome;
                if (!this.mDesiredSceneIsHome)
                {
                    return;
                }
                FlowNode_PlayBGM.PlayHomeBGM();
            }
            else
            {
                switch (pinID)
                {
                case 12:
                    this.mFadingOut = false;
                    break;

                case 30:
                    if (this.RestoreScenes == null)
                    {
                        break;
                    }
                    GlobalVars.IsTutorialEnd = true;
                    if (HomeWindow.mRestorePoint != RestorePoints.Home)
                    {
                        if (!this.IsNotHomeBGM())
                        {
                            FlowNode_PlayBGM.PlayHomeBGM();
                        }
                        for (int index = 0; index < this.RestoreScenes.Length; ++index)
                        {
                            if (this.RestoreScenes[index].Type == HomeWindow.mRestorePoint)
                            {
                                this.Activated(100 + this.RestoreScenes[index].Index);
                                return;
                            }
                        }
                    }
                    this.Activated(99);
                    break;

                case 1002:
                    this.mStateMachine.GotoState <HomeWindow.State_Tutorial>();
                    break;
                }
            }
        }
Example #15
0
        private void Success()
        {
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            if (player.Lv > this.mLevelOld)
            {
                player.OnPlayerLevelChange(player.Lv - this.mLevelOld);
            }
            GlobalVars.PlayerLevelChanged.Set(player.Lv != this.mLevelOld);
            GlobalVars.PlayerExpNew.Set(player.Exp);
            player.MarkTrophiesEnded(new TrophyParam[1]
            {
                this.mTrophyParam
            });
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardWindow, (UnityEngine.Object)null))
            {
                RewardData data = new RewardData();
                data.Coin = this.mTrophyParam.Coin;
                data.Gold = this.mTrophyParam.Gold;
                data.Exp  = this.mTrophyParam.Exp;
                GameManager instance = MonoSingleton <GameManager> .Instance;
                for (int index = 0; index < this.mTrophyParam.Items.Length; ++index)
                {
                    ItemData itemData = new ItemData();
                    if (itemData.Setup(0L, this.mTrophyParam.Items[index].iname, this.mTrophyParam.Items[index].Num))
                    {
                        data.Items.Add(itemData);
                        ItemData itemDataByItemId = instance.Player.FindItemDataByItemID(itemData.Param.iname);
                        int      num = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                        data.ItemsBeforeAmount.Add(num);
                    }
                }
                DataSource.Bind <RewardData>(this.RewardWindow, data);
            }
            GameCenterManager.SendAchievementProgress(this.mTrophyParam.iname);
            if (this.mTrophyParam != null && this.mTrophyParam.Objectives != null)
            {
                for (int index = 0; index < this.mTrophyParam.Objectives.Length; ++index)
                {
                    if (this.mTrophyParam.Objectives[index].type == TrophyConditionTypes.review)
                    {
                        string reviewUrlGeneric = this.ReviewURL_Generic;
                        if (!string.IsNullOrEmpty(reviewUrlGeneric))
                        {
                            Application.OpenURL(reviewUrlGeneric);
                            break;
                        }
                        break;
                    }
                }
            }
            if (this.mTrophyParam != null && this.mTrophyParam.Objectives != null)
            {
                for (int index = 0; index < this.mTrophyParam.Objectives.Length; ++index)
                {
                    if (this.mTrophyParam.Objectives[index].type == TrophyConditionTypes.followtwitter)
                    {
                        string reviewUrlTwitter = this.ReviewURL_Twitter;
                        if (!string.IsNullOrEmpty(reviewUrlTwitter))
                        {
                            Application.OpenURL(reviewUrlTwitter);
                            break;
                        }
                        break;
                    }
                }
            }
            ((Behaviour)this).set_enabled(false);
            this.ActivateOutputLinks(1);
        }