BanchoLobby: Fix matchFinished not setting playing to false

parent 7ceea314
......@@ -325,10 +325,11 @@ class BanchoLobby extends EventEmitter {
// This ensures sorting/emitting is executed after all names are resolved.
this.pushPlayerCreationQueue(() => {
this.sortScores();
this.playing = false;
this.emit(regex.name, this.scores);
this.playersCreationCallback();
});
});
});
break;
case "invalidBeatmapId":
case "passwordRemoved":
......
......@@ -29,7 +29,9 @@ const TestGoals = {
MultiplayerLobbyUnlockSlots: Symbol("MultiplayerLobbyUnlockSlots"),
MultiplayerLobbyClearHost: Symbol("MultiplayerLobbyClearHost"),
MultiplayerLobbyStartMatch: Symbol("MultiplayerLobbyStartMatch"),
MultiplayerLobbyPlayingTrue: Symbol("MultiplayerLobbyPlayingTrue"),
MultiplayerLobbyAbortMatch: Symbol("MultiplayerLobbyAbortMatch"),
MultiplayerLobbyPlayingFalse: Symbol("MultiplayerLobbyPlayingFalse"),
MultiplayerLobbyCloseLobby: Symbol("MultiplayerLobbyCloseLobby")
};
......
......@@ -40,8 +40,14 @@ class MultiplayerLobbiesUnit extends TestUnit {
this.fulFillGoal(TestGoals.MultiplayerLobbyClearHost);
await channel.lobby.startMatch();
this.fulFillGoal(TestGoals.MultiplayerLobbyStartMatch);
if(channel.lobby.playing !== true)
throw new Error("playing is not set to true after starting match!");
this.fulFillGoal(TestGoals.MultiplayerLobbyPlayingTrue);
await channel.lobby.abortMatch();
this.fulFillGoal(TestGoals.MultiplayerLobbyAbortMatch);
if(channel.lobby.playing !== false)
throw new Error("playing is not set to false after starting match!");
this.fulFillGoal(TestGoals.MultiplayerLobbyPlayingFalse);
await channel.lobby.closeLobby();
this.fulFillGoal(TestGoals.MultiplayerLobbyCloseLobby);
clearTimeout(timeout);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment