mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Merge pull request #895 from 1011025m/bs-check-channel-avail
Reopening of #869
This commit is contained in:
commit
fc0d5b14fc
@ -229,10 +229,32 @@ namespace Bloxstrap
|
|||||||
}
|
}
|
||||||
catch (HttpResponseException ex)
|
catch (HttpResponseException ex)
|
||||||
{
|
{
|
||||||
if (ex.ResponseMessage.StatusCode != HttpStatusCode.NotFound)
|
// If channel does not exist
|
||||||
throw;
|
if (ex.ResponseMessage.StatusCode == HttpStatusCode.NotFound)
|
||||||
|
App.Logger.WriteLine(LOG_IDENT, $"Reverting enrolled channel to {RobloxDeployment.DefaultChannel} because a WindowsPlayer build does not exist for {App.Settings.Prop.Channel}");
|
||||||
|
// If channel is not available to the user (private/internal release channel)
|
||||||
|
else if (ex.ResponseMessage.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
|
{
|
||||||
|
App.Logger.WriteLine(LOG_IDENT, $"Channel {App.Settings.Prop.Channel} is unavailable to the user.");
|
||||||
|
// Only prompt if user has channel switching mode set to something other than Automatic.
|
||||||
|
if (App.Settings.Prop.ChannelChangeMode != ChannelChangeMode.Automatic)
|
||||||
|
{
|
||||||
|
MessageBoxResult channelChangeResult = Controls.ShowMessageBox(
|
||||||
|
$"Release channel {App.Settings.Prop.Channel} is not available to you. Would you like to reset to {RobloxDeployment.DefaultChannel}?",
|
||||||
|
MessageBoxImage.Warning,
|
||||||
|
MessageBoxButton.YesNo);
|
||||||
|
|
||||||
|
if (channelChangeResult != MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
Controls.ShowMessageBox($"Client cannot be launched as you are enrolled into an unavailable release channel and refused to reset.", MessageBoxImage.Error);
|
||||||
|
App.Logger.WriteLine(LOG_IDENT, $"User refused to reset channel. Aborting.");
|
||||||
|
App.Terminate(ErrorCode.ERROR_CANCELLED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
App.Logger.WriteLine(LOG_IDENT, $"Resetting release channel to {RobloxDeployment.DefaultChannel} as {App.Settings.Prop.Channel} is unavailable to the user.");
|
||||||
|
}
|
||||||
|
else 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;
|
App.Settings.Prop.Channel = RobloxDeployment.DefaultChannel;
|
||||||
clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel);
|
clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user