public static string BundleURL(string fileName) { string remoteUri = m_remoteUri; if ((MobileDeviceLocale.GetCurrentRegionId() == Network.BnetRegion.REGION_CN) && (m_remoteUriCNIndex != GetTryCount())) { remoteUri = string.Format(m_remoteUriCN, "0" + m_remoteUriCNIndex.ToString()); } return(string.Format("{0}{1}/{2}", remoteUri, DownloadManifest.Get().HashForBundle(fileName), fileName)); }
private void OnClick(UIEvent e) { if (ApplicationMgr.AllowResetFromFatalError != null) { if (this.m_redirectToStore) { PlatformDependentValue <string> value4 = new PlatformDependentValue <string>(PlatformCategory.OS) { iOS = "https://itunes.apple.com/app/hearthstone-heroes-warcraft/id625257520?ls=1&mt=8", Android = "https://play.google.com/store/apps/details?id=com.blizzard.wtcg.hearthstone" }; PlatformDependentValue <string> value2 = value4; value4 = new PlatformDependentValue <string>(PlatformCategory.OS) { iOS = "https://itunes.apple.com/cn/app/lu-shi-chuan-shuo-mo-shou/id841140063?ls=1&mt=8", Android = "https://www.battlenet.com.cn/account/download/hearthstone/android?style=hearthstone" }; PlatformDependentValue <string> value3 = value4; if (ApplicationMgr.GetAndroidStore() == AndroidStore.AMAZON) { value2.Android = "http://www.amazon.com/gp/mas/dl/android?p=com.blizzard.wtcg.hearthstone"; } if (MobileDeviceLocale.GetCurrentRegionId() == Network.BnetRegion.REGION_CN) { value2 = value3; } Application.OpenURL((string)value2); } else { float waitDuration = (ApplicationMgr.Get().LastResetTime() + this.m_delayBeforeNextReset) - UnityEngine.Time.realtimeSinceStartup; Log.JMac.Print("Remaining time to wait before allowing a reconnect attempt: " + waitDuration, new object[0]); if (waitDuration > 0f) { this.m_inputBlocker.RemoveEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnClick)); this.m_closedSignText.Text = GameStrings.Get("GLOBAL_SPLASH_CLOSED_RECONNECTING"); this.m_allowClick = false; this.m_reconnectTip.gameObject.SetActive(false); base.StartCoroutine(this.WaitBeforeReconnecting(waitDuration)); } else { UnityEngine.Debug.Log("resetting!"); this.m_inputBlocker.RemoveEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnClick)); ApplicationMgr.Get().Reset(); } } } else { this.m_inputBlocker.RemoveEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnClick)); ApplicationMgr.Get().Exit(); } }
private void GoToNoAccountTutorialServer(int scenario) { BattleNet.GameServerInfo gameServer = new BattleNet.GameServerInfo(); if (!BattleNet.IsVersionInt() && (BattleNet.GetVersionString() == "PAX")) { gameServer.Version = BattleNet.GetVersionString() + BattleNet.GetVersionInt().ToString(); } else { gameServer.Version = BattleNet.GetVersion(); } if (Vars.Key("Loopback.Active").GetBool(false)) { gameServer.Address = Vars.Key("Loopback.Address").GetStr(string.Empty); gameServer.Port = Vars.Key("Loopback.Port").GetInt(0); gameServer.AuroraPassword = BattleNet.GetVersionString(); } else { Network.BnetRegion currentRegionId = MobileDeviceLocale.GetCurrentRegionId(); if (ApplicationMgr.GetMobileEnvironment() == MobileEnv.PRODUCTION) { string str; try { str = RegionToTutorialName[currentRegionId]; } catch (KeyNotFoundException) { Debug.LogWarning("No matching tutorial server name found for region " + currentRegionId); str = "us"; } gameServer.Address = string.Format("{0}-tutorial{1}.actual.battle.net", str, BattleNet.TutorialServer); gameServer.Port = 0x45f; } else { gameServer.Address = "10.130.126.28"; MobileDeviceLocale.ConnectionData connectionDataFromRegionId = MobileDeviceLocale.GetConnectionDataFromRegionId(currentRegionId, true); gameServer.Port = connectionDataFromRegionId.tutorialPort; gameServer.Version = connectionDataFromRegionId.version; } object[] args = new object[] { currentRegionId, gameServer.Address, gameServer.Port, gameServer.Version }; Log.JMac.Print(string.Format("Connecting to account-free tutorial server for region {0}. Address: {1} Port: {2} Version: {3}", args), new object[0]); gameServer.AuroraPassword = string.Empty; } gameServer.GameHandle = 0; gameServer.ClientHandle = 0L; gameServer.Mission = scenario; this.ResolveAddressAndGotoGameServer(gameServer); }
private static void GetLocalizedLinkVars(out string baseUrl, out string localeString, out string regionString) { localeString = Localization.GetLocaleName(); bool isDev = (ApplicationMgr.GetMobileEnvironment() == MobileEnv.DEVELOPMENT) || ApplicationMgr.IsInternal(); MobileDeviceLocale.ConnectionData connectionDataFromRegionId = MobileDeviceLocale.GetConnectionDataFromRegionId(MobileDeviceLocale.GetCurrentRegionId(), isDev); try { regionString = TargetServerToRegion[connectionDataFromRegionId.address]; } catch (KeyNotFoundException) { Debug.LogWarning("No matching region found for " + connectionDataFromRegionId.address + " to get Nydus Link"); regionString = "US"; } baseUrl = !isDev ? ProdHost : DevHost; }