Improve logging

This commit is contained in:
mmorrison 2019-01-09 05:50:30 -06:00
parent 9b8423b20a
commit 484e99b29c
8 changed files with 88 additions and 85 deletions

View file

@ -98,7 +98,7 @@ class Battlefield extends Core {
return await this.tcpSend(socket, outPacket, (data) => {
const decoded = this.decodePacket(data);
if(decoded) {
if(this.debug) console.log(decoded);
this.debugLog(decoded);
if(decoded.shift() !== 'OK') throw new Error('Missing OK');
return decoded;
}