From 723803b57f0317924f9bed9aa41eb482e8aabbcb Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Thu, 18 Sep 2014 22:20:08 -0500 Subject: [PATCH] Console log all SockJS I/O Previously, we only logged non-lobby server->client messages, but since lobby is no longer on default autojoin, it makes sense to just log everything. Useful to anyone who wants to learn more about how PS's protocol works. --- js/client.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/client.js b/js/client.js index 5b8d282cd..501a12fe1 100644 --- a/js/client.js +++ b/js/client.js @@ -648,8 +648,8 @@ } }; this.socket.onmessage = function(msg) { - if (window.console && console.log && (Config.server.id !== 'showdown' || msg.data.charAt(0) !== '|')) { - console.log('received: '+msg.data); + if (window.console && console.log) { + console.log('<< '+msg.data); } if (msg.data.charAt(0) !== '{') { self.receive(msg.data); @@ -711,6 +711,9 @@ this.sendQueue.push(data); return; } + if (window.console && console.log) { + console.log('>> '+data); + } this.socket.send(data); }, /**