diff --git a/server/MultiplayerManager.js b/server/MultiplayerManager.js index 304a533..46f3af3 100644 --- a/server/MultiplayerManager.js +++ b/server/MultiplayerManager.js @@ -135,6 +135,7 @@ module.exports = class { // Set the user's current match to this match JoiningUser.currentMatch = match; + JoiningUser.inMatch = true; // Add user to the stream for the match global.StreamsHandler.addUserToStream(streamName, JoiningUser.uuid); diff --git a/server/MultiplayerMatch.js b/server/MultiplayerMatch.js index 1cc57b3..b89d6e2 100644 --- a/server/MultiplayerMatch.js +++ b/server/MultiplayerMatch.js @@ -100,6 +100,8 @@ module.exports = class { break; } } + // Make sure this leave call is valid + if (MatchUser.inMatch) return; // Make sure we don't run more than once // Again, client double firing packets. @@ -119,6 +121,7 @@ module.exports = class { break; } + MatchUser.inMatch = false; osuPacketWriter.MatchUpdate(this.createOsuMatchJSON()); diff --git a/server/User.js b/server/User.js index 26030bb..43ce3f4 100644 --- a/server/User.js +++ b/server/User.js @@ -45,6 +45,8 @@ module.exports = class { this.currentMatch = null; this.matchSlotId = -1; + this.inMatch = false; + this.isTourneyUser = false; }