From 86995feb349904c911bd327e6e28f0cd6b3163d6 Mon Sep 17 00:00:00 2001 From: Giuseppe Guerra Date: Wed, 2 Aug 2017 00:29:08 +0200 Subject: [PATCH] Alert users when entering tournament matches, make impossible to join tournament matches from ui --- events/joinMatchEvent.py | 7 +++---- objects/osuToken.py | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/events/joinMatchEvent.py b/events/joinMatchEvent.py index 324beef..362fddc 100644 --- a/events/joinMatchEvent.py +++ b/events/joinMatchEvent.py @@ -25,10 +25,9 @@ def handle(userToken, packetData): # password = generalUtils.stringMd5(password) # Check password - # TODO: Admins can enter every match - if match.matchPassword != "": - if match.matchPassword != password: - raise exceptions.matchWrongPasswordException + # Always send wrong password if this is a tourney match + if (match.matchPassword != "" and match.matchPassword != password) or match.isTourney: + raise exceptions.matchWrongPasswordException # Password is correct, join match userToken.joinMatch(matchID) diff --git a/objects/osuToken.py b/objects/osuToken.py index 176c13c..68471eb 100644 --- a/objects/osuToken.py +++ b/objects/osuToken.py @@ -308,6 +308,10 @@ class token: chat.joinChannel(token=self, channel="#multi_{}".format(self.matchID)) self.enqueue(serverPackets.matchJoinSuccess(matchID)) + # Alert the user if we have just joined a tourney match + if match.isTourney: + self.enqueue(serverPackets.notification("You are now in a tournament match.")) + def leaveMatch(self): """ Leave joined match, match stream and match channel