mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 01:25:51 +00:00
Improve logging
This commit is contained in:
parent
9b8423b20a
commit
484e99b29c
8 changed files with 88 additions and 85 deletions
|
|
@ -57,17 +57,15 @@ class Minecraft extends Core {
|
|||
|
||||
let data = receivedData;
|
||||
const packetId = varint.decode(data);
|
||||
if(this.debug) console.log("Packet ID: "+packetId);
|
||||
this.debugLog("Packet ID: "+packetId);
|
||||
data = data.slice(varint.decode.bytes);
|
||||
|
||||
const strLen = varint.decode(data);
|
||||
if(this.debug) console.log("String Length: "+strLen);
|
||||
this.debugLog("String Length: "+strLen);
|
||||
data = data.slice(varint.decode.bytes);
|
||||
|
||||
const str = data.toString('utf8');
|
||||
if(this.debug) {
|
||||
console.log(str);
|
||||
}
|
||||
this.debugLog(str);
|
||||
|
||||
let json;
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue