From f17de6410b34b6f6bd8bbea7953130e9eee26c97 Mon Sep 17 00:00:00 2001 From: deathcap Date: Sun, 31 Jan 2016 12:26:03 -0800 Subject: [PATCH] Use new object for ping() to avoid potential cross-contamination --- src/client/autoVersion.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/autoVersion.js b/src/client/autoVersion.js index 86e3d6a..5a41b2b 100644 --- a/src/client/autoVersion.js +++ b/src/client/autoVersion.js @@ -24,11 +24,11 @@ function protocolVersion2MinecraftVersion(n) { module.exports = function(client) { var options = client.options; - debug('creating client'); options.wait_connect = true; // don't let src/client/setProtocol proceed on socket 'connect' until 'connect_allowed' debug('pinging',options.host); - // TODO: detect ping timeout, https://github.com/PrismarineJS/node-minecraft-protocol/issues/329 - ping(options, function(err, response) { + var pingOptions = {host: options.host, port: options.port}; + // TODO: use 0xfe ping instead for better compatibility/performance? https://github.com/deathcap/node-minecraft-ping + ping(pingOptions, function(err, response) { if (err) throw err; // hmm debug('ping response',response); // TODO: could also use ping pre-connect to save description, type, negotiate protocol etc.