mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Fix potential crash when no submission token
Can happen because `TimeshiftPlayer` will schedule a screen exit on token retrieval failure, and `RealtimePlayer`'s BDL won't even attempt to create a leaderboard in that case.
This commit is contained in:
@ -6,6 +6,7 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Screens;
|
||||
@ -33,6 +34,7 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
||||
private readonly TaskCompletionSource<bool> resultsReady = new TaskCompletionSource<bool>();
|
||||
private readonly ManualResetEventSlim startedEvent = new ManualResetEventSlim();
|
||||
|
||||
[CanBeNull]
|
||||
private MultiplayerGameplayLeaderboard leaderboard;
|
||||
|
||||
public RealtimePlayer(PlaylistItem playlistItem)
|
||||
@ -72,6 +74,13 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
adjustLeaderboardPosition();
|
||||
}
|
||||
|
||||
private void adjustLeaderboardPosition()
|
||||
{
|
||||
if (leaderboard == null)
|
||||
return;
|
||||
|
||||
const float padding = 44; // enough margin to avoid the hit error display.
|
||||
|
||||
|
Reference in New Issue
Block a user