Exemple #1
0
        public override void InitializeStore(string token = "")
        {
            CommerceLog("<color='magenta'>initializeStore:</color> with token" + token);
            enableListners();
            Configurator configurator = Service.Get <Configurator>();
            IDictionary <string, object> dictionaryForSystem = configurator.GetDictionaryForSystem("CSGConfig");

            csgConfig            = default(CSGConfig);
            csgConfig.SupportUrl = Service.Get <Localizer>().GetTokenTranslation("GlobalUI.Settings.SettingsURLs.cphelp");
            csgConfig.Language   = LocalizationLanguage.GetCultureLanguageString(Service.Get <Localizer>().Language);
            Dictionary <string, CommerceResourceURLsDefinition> dictionary = Service.Get <GameData>().Get <Dictionary <string, CommerceResourceURLsDefinition> >();

            Disney.Kelowna.Common.Environment.Environment developmentEnvironment = Disney.Kelowna.Common.Environment.Environment.PRODUCTION;
            if (dictionary.TryGetValue(NetworkController.GenerateNetworkServiceConfig(developmentEnvironment).CommerceResourceURLsDefinition, out var value))
            {
                csgConfig.BaseUrl        = value.BaseURL;
                csgConfig.JavascriptUrls = value.JavascriptURLs;
                csgConfig.CSSUrls        = value.CSSURLs;
            }
            string key = "windows";
            IDictionary <string, object> dictionary2 = (IDictionary <string, object>)dictionaryForSystem["PROD"];
            IDictionary <string, object> dictionary3 = (IDictionary <string, object>)dictionary2[key];
            IDictionary <string, object> dictionary4 = (IDictionary <string, object>)dictionary2["base"];

            csgConfig.DeviceType            = dictionary3["DeviceType"].ToString();
            csgConfig.DistributionChannelId = dictionary3["DistributionChannelId"].ToString();
            csgConfig.PaypalMerchantId      = dictionary4["PaypalMerchantId"].ToString();
            csgConfig.PaypalEnvironment     = dictionary4["PaypalEnvironment"].ToString();
            csgConfig.SystemId       = dictionary4["SystemId"].ToString();
            csgConfig.ServicesDomain = dictionary4["ServicesDomain"].ToString();
            csgConfig.MetadataDomain = dictionary4["MetadataDomain"].ToString();
        }
Exemple #2
0
    public override IEnumerator PerformFirstPass()
    {
        Localizer localizer = Localizer.Instance;

        Service.Set(localizer);
        Localizer localizer2 = localizer;

        localizer2.TokensUpdated = (Localizer.TokensUpdatedDelegate)Delegate.Combine(localizer2.TokensUpdated, (Localizer.TokensUpdatedDelegate) delegate
        {
            AppWindowUtil.SetTitle(Service.Get <Localizer>().GetTokenTranslation(AppTitleLocToken));
        });
        Language savedLanguage = Service.Get <GameSettings>().SavedLanguage;

        if (savedLanguage == Language.none)
        {
            localizer.Language = LocalizationLanguage.GetLanguage();
        }
        else
        {
            localizer.Language = savedLanguage;
        }
        localizer.LanguageString = LocalizationLanguage.GetLanguageString(localizer.Language);
        string languageStringOneID = localizer.LanguageStringOneID = LocalizationLanguage.GetOneIDLanguageString(localizer.Language);

        Thread.CurrentThread.CurrentCulture   = new CultureInfo(LocalizationLanguage.GetCultureLanguageString(localizer.Language));
        Thread.CurrentThread.CurrentUICulture = new CultureInfo(LocalizationLanguage.GetCultureLanguageString(localizer.Language));
        tokensLoaded = false;
        ILocalizedTokenFilePath tokensFilePath = new AppTokensFilePath(Localizer.DEFAULT_TOKEN_LOCATION, Platform.global);
        DateTime cutOffTime = DateTime.Now.AddMinutes(1.0);

        localizer.LoadTokensFromLocalJSON(tokensFilePath, onTokensLoaded);
        while (!tokensLoaded && !(DateTime.Now > cutOffTime))
        {
            yield return(null);
        }
        if (!tokensLoaded)
        {
            Log.LogError(this, "Unable to load tokens for " + localizer.LanguageString);
        }
    }
Exemple #3
0
 private void onLanguageChanged()
 {
     csgConfig.Language = LocalizationLanguage.GetCultureLanguageString(Service.Get <Localizer>().Language);
 }