diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-11-16 16:34:01 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2021-11-16 22:25:31 +0100 |
commit | 7b5ce7d3949755c12b663531ab5d0b3d3051de34 (patch) | |
tree | 27f152f8ba4c59f8a9116a43b903c7003bc4e671 /public | |
parent | 0030c0313852fbbc73ec0332a9b7d48b7b9ada52 (diff) | |
download | server-7b5ce7d3949755c12b663531ab5d0b3d3051de34.tar.gz |
Drop socket.io-passport module. Allow viewing games as guest.
Diffstat (limited to 'public')
-rw-r--r-- | public/common/client.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/public/common/client.js b/public/common/client.js index 5df0413..1e31f79 100644 --- a/public/common/client.js +++ b/public/common/client.js @@ -188,7 +188,7 @@ function init_client(roles) { load_chat(game_id); - console.log("JOINING game", game_id, "role", role); + console.log("JOINING", title + "/" + game_id + "/" + role); socket = io({ transports: ['websocket'], @@ -220,7 +220,7 @@ function init_client(roles) { }); socket.on('presence', (presence) => { - console.log("PRESENCE", presence); + console.log("PRESENCE", JSON.stringify(presence)); for (let i = 0; i < roles.length; ++i) { let elt = document.querySelector(ROLE_SEL[i]); if (roles[i] in presence) @@ -231,7 +231,7 @@ function init_client(roles) { }); socket.on('state', (new_game, new_game_over) => { - console.log("STATE"); + console.log("STATE", !!new_game.actions, new_game_over); game = new_game; game_over = new_game_over; on_update_log(); @@ -426,14 +426,14 @@ function send_action(verb, noun) { if (noun !== undefined) { if (game.actions && game.actions[verb] && game.actions[verb].includes(noun)) { game.actions = null; - console.log("SEND ACTION", verb, noun); + console.log("ACTION", verb, JSON.stringify(noun)); socket.emit('action', verb, noun); return true; } } else { if (game.actions && game.actions[verb]) { game.actions = null; - console.log("SEND ACTION", verb); + console.log("ACTION", verb); socket.emit('action', verb); return true; } |