From 2efea9e25a900f41d915c2e4e4e844da0678bb56 Mon Sep 17 00:00:00 2001 From: Michael Morrison Date: Fri, 12 Jul 2013 05:36:07 -0500 Subject: [PATCH] Add query and notes to errors --- protocols/core.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/protocols/core.js b/protocols/core.js index df987f3..0ce05d0 100644 --- a/protocols/core.js +++ b/protocols/core.js @@ -46,7 +46,11 @@ module.exports = Class.extend(EventEmitter,{ bots: [] }; }, - finalizeState: function(state) { + finalizeState: function(state) {}, + + finish: function(state) { + this.finalizeState(state); + if(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; state.query.type = this.type; if('pretty' in this) state.query.pretty = this.pretty; - - if('players' in state) state.numplayers = state.players.length; - if('bots' in state) state.numbots = state.bots.length; - }, - finish: function(result) { - this.finalizeState(result); - this.done(result); + + this.done(state); }, + done: function(result) { if(this.finished) return; clearTimeout(this.globalTimeoutTimer);