From 0e45be751ec537a4096ee2bd56b83e5c6ad135c2 Mon Sep 17 00:00:00 2001 From: William Dizon Date: Tue, 23 Feb 2016 17:23:57 +0000 Subject: [PATCH] disabled mcquery on phar servers --- mineos.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/mineos.js b/mineos.js index 430c116c..5cc7f46d 100644 --- a/mineos.js +++ b/mineos.js @@ -1507,27 +1507,30 @@ mineos.mc = function(server_name, base_dir) { var retval = {}; async.waterfall([ + async.apply(self.sc), + function(dict, cb) { + var jarfile = (dict.java || {}).jarfile; + cb(jarfile.slice(-5).toLowerCase() == '.phar') + }, async.apply(self.property, 'server-port'), function(port, cb) { q = new mcquery('localhost', port); cb(); }, function(cb) { - try { - q.connect(function(err){ - if (err || !q.online) - cb(err); - else - q.full_stat(cb); - }); - } catch (e) { cb(true) } + q.connect(function(err){ + if (err || !q.online) + cb(err); + else + q.full_stat(cb); + }); }, function(pingback, cb) { retval = pingback; cb(); } ], function(err) { - q.close(); + try { q.close() } catch (e) {} callback(null, retval); }) }