mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-05-09 04:40:27 -04:00
packet 0xfe (ping): updated to support 1.6.1
This commit is contained in:
parent
9c3f671a22
commit
1ac3e12099
2 changed files with 16 additions and 2 deletions
10
lib/ping.js
10
lib/ping.js
|
@ -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();
|
||||
|
|
|
@ -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" }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue