From ae2046d991f2b2240d42402124eb3a61d3a9a999 Mon Sep 17 00:00:00 2001 From: Xabier de Zuazo Date: Tue, 9 Jul 2013 22:37:30 +0200 Subject: [PATCH] packet 0xfe (ping): some fields renamed, put the correct protocol version in mc.ping() --- lib/ping.js | 5 +++-- lib/protocol.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ping.js b/lib/ping.js index a055620..6d96178 100644 --- a/lib/ping.js +++ b/lib/ping.js @@ -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, }); diff --git a/lib/protocol.js b/lib/protocol.js index e7dd27d..a0f7100 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -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" } ],