mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 13:45:37 -04:00
added debug output for read/written packet ids
This commit is contained in:
parent
b699d5506a
commit
936ba5832d
@ -79,6 +79,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) + ")");
|
||||||
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);
|
||||||
};
|
};
|
||||||
|
@ -1256,6 +1256,8 @@ function parsePacket(buffer, isServer) {
|
|||||||
return {
|
return {
|
||||||
error: new Error("Unrecognized packetId: " + packetId + " (0x" + packetId.toString(16) + ")")
|
error: new Error("Unrecognized packetId: " + packetId + " (0x" + packetId.toString(16) + ")")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
debug("read packetId " + packetId + " (0x" + packetId.toString(16) + ")");
|
||||||
}
|
}
|
||||||
var i, fieldInfo, read, readResults;
|
var i, fieldInfo, read, readResults;
|
||||||
for (i = 0; i < packetInfo.length; ++i) {
|
for (i = 0; i < packetInfo.length; ++i) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user