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; }