Revert to LIVE if there's no Windows build (#526)

This commit is contained in:
pizzaboxer 2023-08-23 10:10:33 +01:00
parent 541a8bdc73
commit 47dcec060b
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -121,7 +121,6 @@ namespace Bloxstrap
try try
{ {
await RobloxDeployment.GetInfo(RobloxDeployment.DefaultChannel); await RobloxDeployment.GetInfo(RobloxDeployment.DefaultChannel);
App.Logger.WriteLine(LOG_IDENT, "Connectivity check finished");
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -140,6 +139,10 @@ namespace Bloxstrap
App.Terminate(ErrorCode.ERROR_CANCELLED); App.Terminate(ErrorCode.ERROR_CANCELLED);
} }
finally
{
App.Logger.WriteLine(LOG_IDENT, "Connectivity check finished");
}
#if !DEBUG #if !DEBUG
if (!App.IsFirstRun && App.Settings.Prop.CheckForUpdates) if (!App.IsFirstRun && App.Settings.Prop.CheckForUpdates)
@ -214,9 +217,25 @@ namespace Bloxstrap
private async Task CheckLatestVersion() private async Task CheckLatestVersion()
{ {
const string LOG_IDENT = "Bootstrapper::CheckLatestVersion";
SetStatus("Connecting to Roblox..."); SetStatus("Connecting to Roblox...");
var clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel); ClientVersion clientVersion;
try
{
clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel);
}
catch (HttpResponseException ex)
{
if (ex.ResponseMessage.StatusCode != HttpStatusCode.NotFound)
throw;
App.Logger.WriteLine(LOG_IDENT, $"Reverting enrolled channel to {RobloxDeployment.DefaultChannel} because a WindowsPlayer build does not exist for {App.Settings.Prop.Channel}");
App.Settings.Prop.Channel = RobloxDeployment.DefaultChannel;
clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel);
}
if (clientVersion.IsBehindDefaultChannel) if (clientVersion.IsBehindDefaultChannel)
{ {