Fix wrong variable names

This commit is contained in:
Giuseppe Guerra 2017-08-07 23:53:09 +02:00
parent ffc84448a2
commit e2149d7d61
3 changed files with 3 additions and 3 deletions

View File

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

View File

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