Merge remote-tracking branch 'xCausxn/master'
This commit is contained in:
commit
83238f48e2
|
@ -15,6 +15,8 @@ module.exports = require('./core').extend({
|
||||||
function(c) {
|
function(c) {
|
||||||
self.sendCommand('serverinfo', function(data) {
|
self.sendCommand('serverinfo', function(data) {
|
||||||
state.raw = data[0];
|
state.raw = data[0];
|
||||||
|
if('virtualserver_name' in state.raw) state.name = state.raw.virtualserver_name;
|
||||||
|
if('virtualserver_maxclients' in state.raw) state.maxplayers = state.raw.virtualserver_maxclients;
|
||||||
c();
|
c();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -44,7 +46,7 @@ module.exports = require('./core').extend({
|
||||||
if(buffer.length < 21) return;
|
if(buffer.length < 21) return;
|
||||||
if(buffer.slice(-21).toString() != '\n\rerror id=0 msg=ok\n\r') return;
|
if(buffer.slice(-21).toString() != '\n\rerror id=0 msg=ok\n\r') return;
|
||||||
var body = buffer.slice(0,-21).toString();
|
var body = buffer.slice(0,-21).toString();
|
||||||
|
|
||||||
var out;
|
var out;
|
||||||
|
|
||||||
if(raw) {
|
if(raw) {
|
||||||
|
@ -65,9 +67,9 @@ module.exports = require('./core').extend({
|
||||||
out.push(unit);
|
out.push(unit);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
c(out);
|
c(out);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue