Add inMatch User property

This commit is contained in:
Holly Stubbs 2022-07-02 11:36:38 +01:00
parent 2e2fb4c609
commit a58965cb6d
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E
3 changed files with 6 additions and 0 deletions

View file

@ -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);

View file

@ -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());

View file

@ -45,6 +45,8 @@ module.exports = class {
this.currentMatch = null;
this.matchSlotId = -1;
this.inMatch = false;
this.isTourneyUser = false;
}