mirror of
https://github.com/ppy/osu
synced 2024-12-16 20:05:41 +00:00
Fix TestMultiplayerClient not handling all users bailing from gameplay
This commit is contained in:
parent
2f1dc91211
commit
750bfae909
@ -128,6 +128,15 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
case MultiplayerRoomState.WaitingForLoad:
|
||||
if (Room.Users.All(u => u.State != MultiplayerUserState.WaitingForLoad))
|
||||
{
|
||||
var loadedUsers = Room.Users.Where(u => u.State == MultiplayerUserState.Loaded).ToArray();
|
||||
|
||||
if (loadedUsers.Length == 0)
|
||||
{
|
||||
// all users have bailed from the load sequence. cancel the game start.
|
||||
ChangeRoomState(MultiplayerRoomState.Open);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var u in Room.Users.Where(u => u.State == MultiplayerUserState.Loaded))
|
||||
ChangeUserState(u.UserID, MultiplayerUserState.Playing);
|
||||
|
||||
@ -143,8 +152,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
foreach (var u in Room.Users.Where(u => u.State == MultiplayerUserState.FinishedPlay))
|
||||
ChangeUserState(u.UserID, MultiplayerUserState.Results);
|
||||
ChangeRoomState(MultiplayerRoomState.Open);
|
||||
|
||||
ChangeRoomState(MultiplayerRoomState.Open);
|
||||
((IMultiplayerClient)this).ResultsReady();
|
||||
|
||||
FinishCurrentItem().Wait();
|
||||
|
Loading…
Reference in New Issue
Block a user