Fix non-working packet 93, allow tournament-only packets only from tourney clients

This commit is contained in:
Giuseppe Guerra
2017-08-07 23:39:13 +02:00
parent 933c92e5f2
commit ffc84448a2
4 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ from helpers import chatHelper as chat
def handle(userToken, packetData):
packetData = clientPackets.tournamentJoinMatchChannel(packetData)
matchID = packetData["matchID"]
if matchID not in glob.matches.matches:
if matchID not in glob.matches.matches or not userToken.isTourney:
return
userToken.matchID = matchID
chat.joinChannel(token=userToken, channel="#multi_{}".format(matchID))

View File

@@ -5,7 +5,7 @@ from helpers import chatHelper as chat
def handle(userToken, packetData):
packetData = clientPackets.tournamentLeaveMatchChannel(packetData)
matchID = packetData["matchID"]
if matchID not in glob.matches.matches:
if matchID not in glob.matches.matches or not userToken.isTourney:
return
chat.partChannel(token=userToken, channel="#multi_{}".format(matchID))
userToken.matchID = 0

View File

@@ -4,6 +4,6 @@ from objects import glob
def handle(userToken, packetData):
packetData = clientPackets.tournamentMatchInfoRequest(packetData)
matchID = packetData["matchID"]
if matchID not in glob.matches.matches:
if matchID not in glob.matches.matches or not userToken.isTourney:
return
userToken.enqueue(glob.matches.matches[matchID].matchDataCache)