comm works by json both ways now

This commit is contained in:
2020-12-06 21:49:17 +01:00
parent ebf7878397
commit 1b9ccc65ab
3 changed files with 7 additions and 7 deletions

View File

@ -76,15 +76,12 @@ async def websocket(ws):
the_game.websockets.append(ws)
try:
x = await ws.receive_json()
print(x)
fct = x['fct']
if fct == 'playcard':
print("play card :)")
p = int(x['player'])
c = int(x['card'])
await play_card(p, c)
elif fct == 'setTrumpColor':
print("trump color :)")
player = x['player']
color = x['color']
await set_trump_color(player, color)