packet 0xfe (ping): updated to support 1.6.1

This commit is contained in:
Xabier de Zuazo 2013-07-07 11:04:15 +02:00
parent 9c3f671a22
commit 1ac3e12099
2 changed files with 16 additions and 2 deletions

View file

@ -33,7 +33,15 @@ function ping(options, cb) {
cb(err);
});
client.on('connect', function() {
client.write(0xfe, { magic: 1 });
client.write(0xfe, {
unused1: 1,
customPayloadId: 250,
magicText: "MC|PingHost",
len: 3 + ip.length + 4,
magic: 73,
ip: host,
port: port,
});
});
var start = Date.now();

View file

@ -480,7 +480,13 @@ var packets = {
{ name: "verifyToken", type: "byteArray16" }
],
0xfe: [
{ name: "magic", type: "byte" }
{ name: "unused1", type: "byte" },
{ name: "customPayloadId", type: "byte" },
{ name: "magicText", type: "string" },
{ name: "len", type: "short" },
{ name: "magic", type: "byte" },
{ name: "ip", type: "string" },
{ name: "port", type: "int" }
],
0xff: [
{ name: "reason", type: "string" }