Skip to content

Commit

Permalink
disabled mcquery on phar servers
Browse files Browse the repository at this point in the history
  • Loading branch information
hexparrot committed Feb 23, 2016
1 parent 89d5f4d commit 0e45be7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions mineos.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
}
Expand Down

0 comments on commit 0e45be7

Please sign in to comment.