typo in rpc_log

This commit is contained in:
Giulio 2022-03-30 12:20:01 +02:00
parent d0159ea0e1
commit 7aebb2318b
2 changed files with 5 additions and 2 deletions

View File

@ -116,7 +116,10 @@ class Game:
player.end_turn() player.end_turn()
if cmd[1] == 'play_card': if cmd[1] == 'play_card':
data = json.loads(cmd[2]) data = json.loads(cmd[2])
player.play_card(data['index'], data['against'], data['with']) if len(data) != 0:
player.play_card(data['index'], data['against'], data['with'])
else:
player.special(data) #TODO: remove this, is only for the typo in the log
if cmd[1] == 'respond': if cmd[1] == 'respond':
player.respond(int(cmd[2])) player.respond(int(cmd[2]))
if cmd[1] == 'choose': if cmd[1] == 'choose':

View File

@ -331,7 +331,7 @@ def scrap(sid, card_index):
@sio.event @sio.event
def special(sid, data): def special(sid, data):
ses: Player = sio.get_session(sid) ses: Player = sio.get_session(sid)
ses.game.rpc_log.append(f'{ses.name};play_card;{json.dumps(data)}') ses.game.rpc_log.append(f'{ses.name};special;{json.dumps(data)}')
ses.special(data) ses.special(data)
@sio.event @sio.event