1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 11:53:21 +08:00

Add field to Replay denoting whether the full replay have been received or not

This commit is contained in:
Dean Herbert 2020-10-27 16:27:15 +09:00
parent c1e7cd6e47
commit b737a8bf6e
2 changed files with 10 additions and 2 deletions

View File

@ -8,6 +8,12 @@ namespace osu.Game.Replays
{
public class Replay
{
/// <summary>
/// Whether all frames for this replay have been received.
/// If false, gameplay would be paused to wait for further data, for instance.
/// </summary>
public bool HasReceivedAllFrames = true;
public List<ReplayFrame> Frames = new List<ReplayFrame>();
}
}

View File

@ -104,7 +104,7 @@ namespace osu.Game.Screens.Play
if (userId != targetUser.Id)
return;
replay ??= new Replay();
replay ??= new Replay { HasReceivedAllFrames = false };
var resolvedRuleset = rulesets.AvailableRulesets.FirstOrDefault(r => r.ID == state.RulesetID)?.CreateInstance();
@ -138,7 +138,9 @@ namespace osu.Game.Screens.Play
private void userFinishedPlaying(int userId, SpectatorState state)
{
// todo: handle this in some way?
if (replay == null) return;
replay.HasReceivedAllFrames = true;
}
protected override void Dispose(bool isDisposing)