fix replayspeed
This commit is contained in:
parent
fa231dade2
commit
ab112165f0
@ -117,7 +117,7 @@ class Game:
|
|||||||
player.buy_gold_rush_card(int(cmd[2]))
|
player.buy_gold_rush_card(int(cmd[2]))
|
||||||
# if cmd[1] == 'chat_message':
|
# if cmd[1] == 'chat_message':
|
||||||
# chat_message(None, cmd[2], player)
|
# chat_message(None, cmd[2], player)
|
||||||
eventlet.sleep(self.replay_speed)
|
eventlet.sleep(max(self.replay_speed, 0.1))
|
||||||
|
|
||||||
def notify_room(self, sid=None):
|
def notify_room(self, sid=None):
|
||||||
if len([p for p in self.players if p.character == None]) != 0 or sid:
|
if len([p for p in self.players if p.character == None]) != 0 or sid:
|
||||||
|
@ -349,7 +349,7 @@ def chat_message(sid, msg, pl=None):
|
|||||||
print("WARNING: DISCORD_WEBHOOK not found")
|
print("WARNING: DISCORD_WEBHOOK not found")
|
||||||
print(f'New bug report, replay at https://www.toptal.com/developers/hastebin/{key}')
|
print(f'New bug report, replay at https://www.toptal.com/developers/hastebin/{key}')
|
||||||
return
|
return
|
||||||
if '/replay' in msg:
|
if '/replay' in msg and not '/replayspeed' in msg:
|
||||||
_cmd = msg.split()
|
_cmd = msg.split()
|
||||||
if len(_cmd) == 2:
|
if len(_cmd) == 2:
|
||||||
replay_id = _cmd[1]
|
replay_id = _cmd[1]
|
||||||
@ -361,7 +361,7 @@ def chat_message(sid, msg, pl=None):
|
|||||||
if '/replayspeed' in msg:
|
if '/replayspeed' in msg:
|
||||||
_cmd = msg.split()
|
_cmd = msg.split()
|
||||||
if len(_cmd) == 2:
|
if len(_cmd) == 2:
|
||||||
ses.game.replay_speed = float(cmd[1])
|
ses.game.replay_speed = float(_cmd[1])
|
||||||
return
|
return
|
||||||
if '/startwithseed' in msg and not ses.game.started:
|
if '/startwithseed' in msg and not ses.game.started:
|
||||||
if len(msg.split()) > 1:
|
if len(msg.split()) > 1:
|
||||||
|
Loading…
Reference in New Issue
Block a user