mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 07:43:00 +08:00
Check whether the build is deployed within the public check updates method
This commit is contained in:
parent
e6ad28a1cb
commit
3c24ca08d0
@ -26,6 +26,7 @@ namespace osu.Desktop.Updater
|
||||
|
||||
private UpdateManager updateManager;
|
||||
private NotificationOverlay notificationOverlay;
|
||||
private OsuGameBase gameBase;
|
||||
|
||||
public Task PrepareUpdateAsync() => UpdateManager.RestartAppWhenExited();
|
||||
|
||||
@ -34,16 +35,18 @@ namespace osu.Desktop.Updater
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(NotificationOverlay notification, OsuGameBase game)
|
||||
{
|
||||
gameBase = game;
|
||||
notificationOverlay = notification;
|
||||
|
||||
if (game.IsDeployedBuild)
|
||||
{
|
||||
Splat.Locator.CurrentMutable.Register(() => new SquirrelLogger(), typeof(Splat.ILogger));
|
||||
CheckForUpdate();
|
||||
}
|
||||
Splat.Locator.CurrentMutable.Register(() => new SquirrelLogger(), typeof(Splat.ILogger));
|
||||
CheckForUpdate();
|
||||
}
|
||||
|
||||
public override void CheckForUpdate() => Schedule(() => Task.Run(() => checkForUpdateAsync()));
|
||||
public override void CheckForUpdate()
|
||||
{
|
||||
if (gameBase.IsDeployedBuild)
|
||||
Schedule(() => Task.Run(() => checkForUpdateAsync()));
|
||||
}
|
||||
|
||||
private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null)
|
||||
{
|
||||
|
@ -26,16 +26,22 @@ namespace osu.Game.Updater
|
||||
[Resolved]
|
||||
private GameHost host { get; set; }
|
||||
|
||||
private OsuGameBase gameBase;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase game)
|
||||
{
|
||||
gameBase = game;
|
||||
version = game.Version;
|
||||
|
||||
if (game.IsDeployedBuild)
|
||||
CheckForUpdate();
|
||||
CheckForUpdate();
|
||||
}
|
||||
|
||||
public override void CheckForUpdate() => Schedule(() => Task.Run(checkForUpdateAsync));
|
||||
public override void CheckForUpdate()
|
||||
{
|
||||
if (gameBase.IsDeployedBuild)
|
||||
Schedule(() => Task.Run(checkForUpdateAsync));
|
||||
}
|
||||
|
||||
private async void checkForUpdateAsync()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user