packet 0xfe (ping): some fields renamed, put the correct protocol version in mc.ping()

This commit is contained in:
Xabier de Zuazo 2013-07-09 22:37:30 +02:00
parent f3657f74e0
commit ae2046d991
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,6 @@
var net = require('net')
, Client = require('./client')
, protocol = require('./protocol')
module.exports = ping;
@ -34,11 +35,11 @@ function ping(options, cb) {
});
client.on('connect', function() {
client.write(0xfe, {
unused1: 1,
readSuccessfully: 1,
customPayloadId: 250,
magicText: "MC|PingHost",
len: 3 + host.length + 4,
magic: 73,
version: protocol.version,
ip: host,
port: port,
});

View File

@ -480,11 +480,11 @@ var packets = {
{ name: "verifyToken", type: "byteArray16" }
],
0xfe: [
{ name: "unused1", type: "byte" },
{ name: "readSuccessfully", type: "byte" },
{ name: "customPayloadId", type: "ubyte" },
{ name: "magicText", type: "string" },
{ name: "len", type: "short" },
{ name: "magic", type: "byte" },
{ name: "version", type: "byte" },
{ name: "ip", type: "string" },
{ name: "port", type: "int" }
],