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.
This commit is contained in:
Guangcong Luo 2014-09-18 22:20:08 -05:00
parent 626a2eef2d
commit 723803b57f

View File

@ -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);
},
/**