1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 00:02:54 +08:00

Fix multiplayer spectator getting stuck

This commit is contained in:
Dean Herbert 2022-08-24 13:11:53 +09:00
parent 46d000b8ce
commit 85fbe7abca
2 changed files with 7 additions and 1 deletions

View File

@ -73,7 +73,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
if (IsRunning)
{
double elapsedSource = Source.ElapsedFrameTime;
// When in catch-up mode, the source is usually not running.
// In such a case, its elapsed time may be zero, which would cause catch-up to get stuck.
// To avoid this, use a constant 16ms elapsed time for now. Probably not too correct, but this whole logic isn't too correct anyway.
double elapsedSource = Source.IsRunning ? Source.ElapsedFrameTime : 16;
double elapsed = elapsedSource * Rate;
CurrentTime += elapsed;

View File

@ -8,6 +8,7 @@ using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Logging;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Online.Multiplayer;
@ -195,6 +196,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
private void onMasterStateChanged(ValueChangedEvent<MasterClockState> state)
{
Logger.Log($"{nameof(MultiSpectatorScreen)}'s master clock become {state.NewValue}");
switch (state.NewValue)
{
case MasterClockState.Synchronised: