fix debug disconnect

This commit is contained in:
Alberto Xamin 2023-01-21 14:16:48 +00:00
parent 699c976c75
commit 461dfb8841
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
2 changed files with 3 additions and 1 deletions

View File

@ -125,6 +125,8 @@ class Game:
self.replay_speed = speed
for i in range(len(log)-1):
print('replay:', i, 'of', len(log)-3, '->', log[i])
if len(self.spectators) == 0:
break
if (log[i] == "@@@"):
eventlet.sleep(10)
if self.is_replay:

View File

@ -150,7 +150,7 @@ class Player:
print(f'I {self.name} joined {self.game}')
def disconnect(self):
if self.is_admin() and self.game.debug: return False
if self.is_admin() and self.game.debug and self.game.started: return False
return self.game.handle_disconnect(self)
def set_role(self, role: r.Role):