mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 15:17:36 +00:00
Add query and notes to errors
This commit is contained in:
parent
f73de31212
commit
2efea9e25a
1 changed files with 8 additions and 8 deletions
|
|
@ -46,7 +46,11 @@ module.exports = Class.extend(EventEmitter,{
|
||||||
bots: []
|
bots: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
finalizeState: function(state) {
|
finalizeState: function(state) {},
|
||||||
|
|
||||||
|
finish: function(state) {
|
||||||
|
this.finalizeState(state);
|
||||||
|
|
||||||
if(this.options.notes)
|
if(this.options.notes)
|
||||||
state.notes = this.options.notes;
|
state.notes = this.options.notes;
|
||||||
|
|
||||||
|
|
@ -55,14 +59,10 @@ module.exports = Class.extend(EventEmitter,{
|
||||||
if('port' in this.options) state.query.port = this.options.port;
|
if('port' in this.options) state.query.port = this.options.port;
|
||||||
state.query.type = this.type;
|
state.query.type = this.type;
|
||||||
if('pretty' in this) state.query.pretty = this.pretty;
|
if('pretty' in this) state.query.pretty = this.pretty;
|
||||||
|
|
||||||
if('players' in state) state.numplayers = state.players.length;
|
this.done(state);
|
||||||
if('bots' in state) state.numbots = state.bots.length;
|
|
||||||
},
|
|
||||||
finish: function(result) {
|
|
||||||
this.finalizeState(result);
|
|
||||||
this.done(result);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
done: function(result) {
|
done: function(result) {
|
||||||
if(this.finished) return;
|
if(this.finished) return;
|
||||||
clearTimeout(this.globalTimeoutTimer);
|
clearTimeout(this.globalTimeoutTimer);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue