.BANCHO. .FIX. Stop spectating only if user is spectating someone

This commit is contained in:
Nyo 2016-09-04 12:42:14 +02:00
parent d5c87ba51c
commit 31a78432bb
2 changed files with 2 additions and 3 deletions

View File

@ -146,6 +146,8 @@ class token:
def stopSpectating(self): def stopSpectating(self):
# Remove our userID from host's spectators # Remove our userID from host's spectators
target = self.spectating target = self.spectating
if self.spectating == 0:
return
targetToken = glob.tokens.getTokenFromUserID(target) targetToken = glob.tokens.getTokenFromUserID(target)
if targetToken is not None: if targetToken is not None:
# Remove us from host's spectators list # Remove us from host's spectators list

3
pep.py
View File

@ -82,9 +82,6 @@ if __name__ == "__main__":
os.makedirs(i, 0o770) os.makedirs(i, 0o770)
consoleHelper.printDone() consoleHelper.printDone()
# Flush file buffers at exit
#atexit.register(lambda: glob.fileBuffers.flushAll())
# Connect to db # Connect to db
try: try:
consoleHelper.printNoNl("> Connecting to MySQL db") consoleHelper.printNoNl("> Connecting to MySQL db")