mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 21:52:17 -04:00
print sent and received packet contents in debug mode
This commit is contained in:
parent
a48d6dcdd8
commit
664c7e380a
@ -91,6 +91,7 @@ Client.prototype.end = function(reason) {
|
|||||||
Client.prototype.write = function(packetId, params) {
|
Client.prototype.write = function(packetId, params) {
|
||||||
var buffer = createPacketBuffer(packetId, params, this.isServer);
|
var buffer = createPacketBuffer(packetId, params, this.isServer);
|
||||||
debug("writing packetId " + packetId + " (0x" + packetId.toString(16) + ")");
|
debug("writing packetId " + packetId + " (0x" + packetId.toString(16) + ")");
|
||||||
|
debug(params);
|
||||||
var out = this.encryptionEnabled ? new Buffer(this.cipher.update(buffer), 'binary') : buffer;
|
var out = this.encryptionEnabled ? new Buffer(this.cipher.update(buffer), 'binary') : buffer;
|
||||||
this.socket.write(out);
|
this.socket.write(out);
|
||||||
};
|
};
|
||||||
|
@ -1282,6 +1282,7 @@ function parsePacket(buffer, isServer) {
|
|||||||
results[fieldInfo.name] = readResults.value;
|
results[fieldInfo.name] = readResults.value;
|
||||||
size += readResults.size;
|
size += readResults.size;
|
||||||
}
|
}
|
||||||
|
debug(results);
|
||||||
return {
|
return {
|
||||||
size: size,
|
size: size,
|
||||||
results: results,
|
results: results,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user