fix password bug
This commit is contained in:
parent
000cd93cb1
commit
a6174fee95
@ -43,6 +43,7 @@ class Game:
|
|||||||
self.attack_in_progress = False
|
self.attack_in_progress = False
|
||||||
self.characters_to_distribute = 2 # personaggi da dare a inizio partita
|
self.characters_to_distribute = 2 # personaggi da dare a inizio partita
|
||||||
self.debug = self.name == 'debug'
|
self.debug = self.name == 'debug'
|
||||||
|
self.is_changing_pwd = False
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
print('resetting lobby')
|
print('resetting lobby')
|
||||||
@ -116,12 +117,16 @@ class Game:
|
|||||||
self.sio.emit('chat_message', room=self.name, data=f'_joined|{player.name}')
|
self.sio.emit('chat_message', room=self.name, data=f'_joined|{player.name}')
|
||||||
|
|
||||||
def set_private(self):
|
def set_private(self):
|
||||||
|
if not self.is_changing_pwd:
|
||||||
|
self.is_changing_pwd = True
|
||||||
if self.password == '':
|
if self.password == '':
|
||||||
self.password = ''.join(random.choice("AEIOUJKZT123456789") for x in range(6))
|
self.password = ''.join(random.choice("AEIOUJKZT123456789") for x in range(6))
|
||||||
print(self.name, 'is now private pwd', self.password)
|
print(self.name, 'is now private pwd', self.password)
|
||||||
else:
|
else:
|
||||||
self.password = ''
|
self.password = ''
|
||||||
self.notify_room()
|
self.notify_room()
|
||||||
|
eventlet.sleep(0.2)
|
||||||
|
self.is_changing_pwd = False
|
||||||
|
|
||||||
def notify_character_selection(self):
|
def notify_character_selection(self):
|
||||||
self.notify_room()
|
self.notify_room()
|
||||||
|
Loading…
Reference in New Issue
Block a user