var request = require('request'); module.exports = require('./core').extend({ run: function(state) { var self = this; request({ uri: 'http://'+this.options.address+':'+this.options.port_query+'/', timeout: 3000, }, function(e,r,body) { if(e) return self.fatal('HTTP error'); var m = body.match(/status server for (.*?)\r|\n/); if(m) state.name = m[1]; var m = body.match(/Current uptime: (\d+)/); if(m) state.raw.uptime = m[1]; var m = body.match(/currently running (.*?) by /); if(m) state.map = m[1]; var m = body.match(/Current players: (\d+)\/(\d+)/); if(m) { state.raw.numplayers = m[1]; state.maxplayers = m[2]; } var m = body.match(/class="playerlist"([^]+?)\/table/); if(m) { var table = m[1]; var pre = /