Loading lib/Multiplayer/BanchoLobby.js +2 −1 Original line number Diff line number Diff line Loading @@ -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(); }); Loading tests/TestGoals.js +2 −0 Original line number Diff line number Diff line Loading @@ -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") }; Loading tests/units/MultiplayerLobbiesUnit.js +6 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading
lib/Multiplayer/BanchoLobby.js +2 −1 Original line number Diff line number Diff line Loading @@ -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(); }); Loading
tests/TestGoals.js +2 −0 Original line number Diff line number Diff line Loading @@ -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") }; Loading
tests/units/MultiplayerLobbiesUnit.js +6 −0 Original line number Diff line number Diff line Loading @@ -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); Loading