Commit 4cb0ae5f authored by Hugo Denizart's avatar Hugo Denizart
Browse files

BanchoLobby: Fix matchFinished not setting playing to false

parent 7ceea314
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -325,6 +325,7 @@ 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();
						});
+2 −0
Original line number Diff line number Diff line
@@ -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")
};

+6 −0
Original line number Diff line number Diff line
@@ -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);