.BANCHO. Use tokens while spectating rather than references to clients objects
This commit is contained in:
@@ -50,7 +50,9 @@ if userToken.matchID != -1 and userToken.actionID != actions.MULTIPLAYING and us
|
||||
# Enqueue our new user panel and stats to us and our spectators
|
||||
recipients = [userToken]
|
||||
if len(userToken.spectators) > 0:
|
||||
recipients += userToken.spectators
|
||||
for i in userToken.spectators:
|
||||
if i in glob.tokens.tokens:
|
||||
recipients.append(glob.tokens.tokens[i])
|
||||
|
||||
for i in recipients:
|
||||
if i is not None:
|
||||
|
@@ -16,7 +16,7 @@ def handle(userToken, _=None):
|
||||
# the old logout packet will still be in the queue and will be sent to
|
||||
# the server, so we accept logout packets sent at least 5 seconds after login
|
||||
# if the user logs out before 5 seconds, he will be disconnected later with timeout check
|
||||
if int(time.time()-userToken.loginTime) >= 5 or userToken.irc == True:
|
||||
if (int(time.time()-userToken.loginTime) >= 5 or userToken.irc) or userToken.tournament:
|
||||
# Stop spectating
|
||||
userToken.stopSpectating()
|
||||
|
||||
|
Reference in New Issue
Block a user