mirror of
https://github.com/ppy/osu
synced 2024-12-12 09:58:22 +00:00
Fix gameplay proceeding when no frames have been received yet
This commit is contained in:
parent
d4467d20a2
commit
b3d793a505
@ -56,6 +56,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
public void TestBasicSpectatingFlow()
|
||||
{
|
||||
loadSpectatingScreen();
|
||||
|
||||
AddAssert("screen hasn't changed", () => Stack.CurrentScreen is Spectator);
|
||||
|
||||
AddStep("start play", () => testSpectatorStreamingClient.StartPlay());
|
||||
|
||||
sendFrames();
|
||||
@ -73,6 +76,18 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddAssert("game is paused", () => player.ChildrenOfType<DrawableRuleset>().First().IsPaused.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPlayStartsWithNoFrames()
|
||||
{
|
||||
loadSpectatingScreen();
|
||||
|
||||
AddStep("start play", () => testSpectatorStreamingClient.StartPlay());
|
||||
|
||||
AddUntilStep("wait for player", () => Stack.CurrentScreen is Player);
|
||||
|
||||
AddUntilStep("game is paused", () => player.ChildrenOfType<DrawableRuleset>().First().IsPaused.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSpectatingDuringGameplay()
|
||||
{
|
||||
|
@ -162,6 +162,12 @@ namespace osu.Game.Rulesets.Replays
|
||||
// if we didn't change frames, we need to ensure we are allowed to run frames in between, else return null.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if we never received frames and are expecting to, block.
|
||||
if (!replay.HasReceivedAllFrames)
|
||||
return null;
|
||||
}
|
||||
|
||||
return CurrentTime = time;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user