mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Re-add channel version check on startup
This commit is contained in:
parent
2d55e913a2
commit
cb4c813b8a
@ -191,6 +191,30 @@ namespace Bloxstrap
|
||||
|
||||
ClientVersion clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel);
|
||||
|
||||
if (clientVersion.IsBehindDefaultChannel)
|
||||
{
|
||||
MessageBoxResult action = App.Settings.Prop.ChannelChangeMode switch
|
||||
{
|
||||
ChannelChangeMode.Prompt => Controls.ShowMessageBox(
|
||||
$"The channel you're currently on ({App.Settings.Prop.Channel}) is out of date, and appears to no longer be receiving updates.\n" +
|
||||
$"Would you like to switch to the default channel ({RobloxDeployment.DefaultChannel})?",
|
||||
MessageBoxImage.Warning,
|
||||
MessageBoxButton.YesNo
|
||||
),
|
||||
ChannelChangeMode.Automatic => MessageBoxResult.Yes,
|
||||
ChannelChangeMode.Ignore => MessageBoxResult.No,
|
||||
_ => MessageBoxResult.None
|
||||
};
|
||||
|
||||
if (action == MessageBoxResult.Yes)
|
||||
{
|
||||
App.Logger.WriteLine("Bootstrapper::CheckLatestVersion", $"Changed Roblox channel from {App.Settings.Prop.Channel} to {RobloxDeployment.DefaultChannel}");
|
||||
|
||||
App.Settings.Prop.Channel = RobloxDeployment.DefaultChannel;
|
||||
clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel);
|
||||
}
|
||||
}
|
||||
|
||||
_latestVersionGuid = clientVersion.VersionGuid;
|
||||
_versionFolder = Path.Combine(Paths.Versions, _latestVersionGuid);
|
||||
_versionPackageManifest = await PackageManifest.Get(_latestVersionGuid);
|
||||
|
@ -94,7 +94,7 @@ namespace Bloxstrap
|
||||
return;
|
||||
}
|
||||
|
||||
App.Logger.WriteLine("Protocol::ParseUri", $"Changed Roblox build channel from {App.Settings.Prop.Channel} to {channel}");
|
||||
App.Logger.WriteLine("Protocol::ParseUri", $"Changed Roblox channel from {App.Settings.Prop.Channel} to {channel}");
|
||||
App.Settings.Prop.Channel = channel;
|
||||
}
|
||||
|
||||
|
@ -121,6 +121,14 @@ namespace Bloxstrap
|
||||
clientVersion = JsonSerializer.Deserialize<ClientVersion>(rawResponse)!;
|
||||
}
|
||||
|
||||
// check if channel is behind LIVE
|
||||
if (channel != DefaultChannel)
|
||||
{
|
||||
var defaultClientVersion = await GetInfo(DefaultChannel);
|
||||
|
||||
if (Utilities.CompareVersions(clientVersion.Version, defaultClientVersion.Version) == -1)
|
||||
clientVersion.IsBehindDefaultChannel = true;
|
||||
}
|
||||
|
||||
// for preferences
|
||||
if (extraInformation && clientVersion.Timestamp is null)
|
||||
@ -138,15 +146,6 @@ namespace Bloxstrap
|
||||
App.Logger.WriteLine(LOG_IDENT, $"{manifestUrl} - Last-Modified: {lastModified}");
|
||||
clientVersion.Timestamp = DateTime.Parse(lastModified).ToLocalTime();
|
||||
}
|
||||
|
||||
// check if channel is behind LIVE
|
||||
if (channel != DefaultChannel)
|
||||
{
|
||||
var defaultClientVersion = await GetInfo(DefaultChannel);
|
||||
|
||||
if (Utilities.CompareVersions(clientVersion.Version, defaultClientVersion.Version) == -1)
|
||||
clientVersion.IsBehindDefaultChannel = true;
|
||||
}
|
||||
}
|
||||
|
||||
ClientVersionCache[channel] = clientVersion;
|
||||
|
Loading…
Reference in New Issue
Block a user