From a58965cb6d7eb1cceb3b0f6454f678c1b285e65b Mon Sep 17 00:00:00 2001 From: Holly Date: Sat, 2 Jul 2022 11:36:38 +0100 Subject: [PATCH] Add inMatch User property --- server/MultiplayerManager.js | 1 + server/MultiplayerMatch.js | 3 +++ server/User.js | 2 ++ 3 files changed, 6 insertions(+) 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; }