Exemple #1
0
        private void AddUserResponse(AddDeviceWithEmailAddressAndPasswordResult res)
        {
            switch (res.ResultCode)
            {
            case AddDeviceWithEmailAddressAndPasswordResultCode.Success:
                GameUtility.ClearPreferences();
                this.ActivateOutputLinks(10);
                break;

            case AddDeviceWithEmailAddressAndPasswordResultCode.MissingDeviceId:
                this.ActivateOutputLinks(20);
                break;

            case AddDeviceWithEmailAddressAndPasswordResultCode.MissingEmailOrPassword:
                this.ActivateOutputLinks(21);
                break;

            case AddDeviceWithEmailAddressAndPasswordResultCode.Locked:
                DateTime dateTime = TimeManager.ServerTime.AddSeconds((double)res.LockedExpiresIn);
                string   msg      = LocalizedText.Get("sys.CHAINDATA_LOCKED", new object[1] {
                    (object)string.Format("{0}/{1:D2}/{2:D2} {3:D2}:{4:D2}", (object)dateTime.Year, (object)dateTime.Month, (object)dateTime.Day, (object)dateTime.Hour, (object)dateTime.Minute)
                });
                UIUtility.NegativeSystemMessage(string.Empty, msg, (UIUtility.DialogResultEvent)(obj => this.ActivateOutputLinks(22)), (GameObject)null, true, -1);
                break;

            default:
                this.ActivateOutputLinks(11);
                break;
            }
        }
Exemple #2
0
        public void ResDebugDataReset(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.IsRetry = true;
            }
            else
            {
                bool   flag1            = GameUtility.Config_UseAssetBundles.Value;
                bool   flag2            = GameUtility.Config_UseStgServer.Value;
                bool   flag3            = GameUtility.Config_UseDevServer.Value;
                string devServerSetting = GameUtility.DevServerSetting;
                GameUtility.ClearPreferences();
                GameUtility.Config_UseAssetBundles.Value = flag1;
                GameUtility.Config_UseStgServer.Value    = flag2;
                GameUtility.Config_UseDevServer.Value    = flag3;
                GameUtility.DevServerSetting             = devServerSetting;
                DebugUtility.Assert(www.text != null, "res == null");
                MonoSingleton <GameManager> .Instance.ResetAuth();

                GameUtility.Config_NewGame.Value = false;
                PlayerPrefs.DeleteKey("PlayerName");
                PlayerPrefs.DeleteKey("AccountLinked");
                AnalyticsManager.Setup();
                Network.RemoveAPI();
                this.Success();
            }
        }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.HikkoshiNoToken:
                case Network.EErrCode.MigrateIllCode:
                case Network.EErrCode.MigrateSameDev:
                case Network.EErrCode.MigrateLockCode:
                    this.OnBack();
                    break;

                case Network.EErrCode.AcheiveMigrateIllcode:
                case Network.EErrCode.AcheiveMigrateNoCoop:
                case Network.EErrCode.AcheiveMigrateLock:
                case Network.EErrCode.AcheiveMigrateAuthorize:
                    this.OnBack();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                if (this.m_Api == FlowNode_ReqHikkoshi.API.Normal)
                {
                    WebAPI.JSON_BodyResponse <JSON_Migrate> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_Migrate> >(www.text);
                    DebugUtility.Assert(jsonObject != null, "res == null");
                    if (jsonObject.body == null)
                    {
                        this.OnRetry();
                        return;
                    }
                    MonoSingleton <GameManager> .Instance.SaveAuth(jsonObject.body.old_device_id);
                }
                else if (this.m_Api == FlowNode_ReqHikkoshi.API.FgG)
                {
                    WebAPI.JSON_BodyResponse <JSON_Migrate> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_Migrate> >(www.text);
                    DebugUtility.Assert(jsonObject != null, "res == null");
                    if (jsonObject.body == null)
                    {
                        this.OnRetry();
                        return;
                    }
                    MonoSingleton <GameManager> .Instance.SaveAuth(jsonObject.body.old_device_id);
                }
                MonoSingleton <GameManager> .Instance.InitAuth();

                GameUtility.ClearPreferences();
                Network.RemoveAPI();
                this.Success();
            }
        }
        private void AddUserResponse(AddDeviceWithEmailAddressAndPasswordResult res)
        {
            switch (res.ResultCode)
            {
            case AddDeviceWithEmailAddressAndPasswordResultCode.Success:
                GameUtility.ClearPreferences();
                this.ActivateOutputLinks(10);
                break;

            default:
                this.ActivateOutputLinks(11);
                break;
            }
        }
Exemple #5
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.AcheiveMigrateIllcode:
                case Network.EErrCode.AcheiveMigrateLock:
                    this.OnBack();
                    break;

                default:
                    if (errCode != Network.EErrCode.MigrateSameDev)
                    {
                        this.OnRetry();
                        break;
                    }
                    goto case Network.EErrCode.AcheiveMigrateIllcode;
                }
            }
            else
            {
                if (this.m_Api == FlowNode_ReqFggDevice.API.Add)
                {
                    WebAPI.JSON_BodyResponse <ReqGAuthFgGDevice.Json_FggDevice> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqGAuthFgGDevice.Json_FggDevice> >(www.text);
                    DebugUtility.Assert(jsonObject != null, "res == null");
                    if (jsonObject.body == null)
                    {
                        this.OnRetry();
                        return;
                    }
                    MonoSingleton <GameManager> .Instance.SaveAuthWithKey(jsonObject.body.device_id, jsonObject.body.secret_key);

                    MonoSingleton <GameManager> .Instance.InitAuth();

                    GameUtility.ClearPreferences();
                }
                Network.RemoveAPI();
                this.Success();
            }
        }
        public void ResDebugDataReset(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.IsRetry = true;
            }
            else
            {
                bool flag = GameUtility.Config_UseAssetBundles.Value;
                GameUtility.ClearPreferences();
                GameUtility.Config_UseAssetBundles.Value = flag;
                DebugUtility.Assert(www.text != null, "res == null");
                MonoSingleton <GameManager> .Instance.ResetAuth();

                GameUtility.Config_NewGame.Value = false;
                MetapsAnalyticsScript.ReInitialize();
                Network.RemoveAPI();
                this.Success();
            }
        }