summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-06-04 04:49:02 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-06-04 04:49:02 +0100
commit82515ed2370d88dc977da1c0a886b851db948aab (patch)
tree8e2b074fec80c671f9752237fef3a1822419a7f7
parent5e2488695ea4d64d6d0a2d26aa099777af84dab0 (diff)
fixed bug the card id was considered a string
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
-rwxr-xr-xserver.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/server.py b/server.py
index 4707ac9..77d8cab 100755
--- a/server.py
+++ b/server.py
@@ -31,20 +31,22 @@ def message_received_handler(client, server, message):
res = client['cao_client'].join_game(game_name)
elif op == 'view_player_cards':
res = client['cao_client'].view_player_cards()
+ elif op == 'view_black_card':
+ res = client['cao_client'].view_black_card()
elif op == 'view_played_cards':
res = client['cao_client'].view_played_cards()
elif op == 'pick_black_card':
res = client['cao_client'].pick_black_card()
elif op == 'designate_card':
try:
- card_id = json_msg['card_id']
+ card_id = int(json_msg['card_id'])
except KeyError:
res = cao_error('field `card_id\' is required')
else:
res = client['cao_client'].designate_card(card_id)
elif op == 'play_white_card':
try:
- card_id = json_msg['card_id']
+ card_id = int(json_msg['card_id'])
except KeyError:
res = cao_error('field `card_id\' is required')
else: