From abccd2e51a99d310956e5e04abd08a5dfd7d6d13 Mon Sep 17 00:00:00 2001 From: Stefan Rupp Date: Sun, 6 Dec 2020 21:56:16 +0100 Subject: [PATCH] cleanup --- templates/home/player.html | 22 ++++++++++------------ templates/shared/_layout.html | 4 +--- views/player.py | 10 ---------- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/templates/home/player.html b/templates/home/player.html index 37eb28a..2a171e3 100644 --- a/templates/home/player.html +++ b/templates/home/player.html @@ -7,26 +7,24 @@ let player = "{{player}}"; let c = card.toString(); var msg = { - type: "message", - fct: "playcard", - player: player, - card: c + type: "message", + fct: "playcard", + player: player, + card: c }; - //window.game_socket.send("playcard "+player+":"+card); - t = JSON.stringify(msg); + let t = JSON.stringify(msg); window.game_socket.send(t); } function setTrumpColor(color) { let player = "{{player}}" var msg = { - type: "message", - fct: "setTrumpColor", - player: player, - color: color + type: "message", + fct: "setTrumpColor", + player: player, + color: color }; - //window.game_socket.send("setTrumpColor "+player+":"+color) - t = JSON.stringify(msg); + let t = JSON.stringify(msg); window.game_socket.send(t); } diff --git a/templates/shared/_layout.html b/templates/shared/_layout.html index 6e57a62..a6371b8 100644 --- a/templates/shared/_layout.html +++ b/templates/shared/_layout.html @@ -7,7 +7,7 @@ - Free Online Gamblingc + Free Online Gambling @@ -33,8 +33,6 @@ }; socket.onmessage = function(event) { - //alert(`[message] Data received from server: ${event.data}`); - //if (event.data == "reload") { let x = JSON.parse(event.data); let fct = x.fct; if (fct == "reload") { diff --git a/views/player.py b/views/player.py index 5437e87..3f6616a 100644 --- a/views/player.py +++ b/views/player.py @@ -88,16 +88,6 @@ async def websocket(ws): else: print("confused :(") - # cmd = await ws.receive_text() - # fct, args = cmd.split() - # if fct == "playcard": - # p, c = map(int, args.split(':')) - # await play_card(p, c) - # elif fct == "setTrumpColor": - # player, color = args.split(':') - # await set_trump_color(player, color) - - except WebSocketDisconnect: the_game.websockets.remove(ws)