public static IEnumerator ReadVersion(string versionFileUrl) { if (string.IsNullOrEmpty(versionFileUrl)) { Log.Warning("No version file defined: force version valid", 106, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Configuration\\ApplicationStarter.cs"); ApplicationConfig.versionCheckResult = VersionChecker.Result.Success; yield break; } TextWebRequest.AsyncResult versionFileLoadResult = new TextWebRequest.AsyncResult(); yield return(TextWebRequest.ReadFile(versionFileUrl, versionFileLoadResult)); if (versionFileLoadResult.hasException) { long responseCode = versionFileLoadResult.exception.responseCode; if (responseCode == 404) { Log.Error("Could not find version file at URL '" + versionFileUrl + "'.", 121, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Configuration\\ApplicationStarter.cs"); } else { Log.Error($"Error {responseCode} when trying to download version file at URL '{versionFileUrl}'.", 125, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Configuration\\ApplicationStarter.cs"); } ApplicationConfig.versionCheckResult = VersionChecker.Result.VersionFileError; } else { ApplicationConfig.versionCheckResult = VersionChecker.ParseVersionFile(versionFileLoadResult.value); } }
public static IEnumerator ReadRemoteConfig(string remoteSettingsFileUrl) { TextWebRequest.AsyncResult remoteSettingsFileLoadResult = new TextWebRequest.AsyncResult(); yield return(TextWebRequest.ReadFile(remoteSettingsFileUrl, remoteSettingsFileLoadResult)); if (remoteSettingsFileLoadResult.hasException) { long responseCode = remoteSettingsFileLoadResult.exception.responseCode; if (responseCode == 404) { Log.Error("Could not find remote settings file at URL '" + remoteSettingsFileUrl + "'.", 83, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Configuration\\ApplicationStarter.cs"); } else { Log.Error($"Error {responseCode} when trying to download remote settings file at URL '{remoteSettingsFileUrl}'.", 90, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Configuration\\ApplicationStarter.cs"); } } else { ApplicationConfig.SetFromRemoteConfig(RemoteConfig.From(new ConfigReader(remoteSettingsFileLoadResult.value, remoteSettingsFileUrl))); } }