diff --git a/README.md b/README.md index 6009543..8b53ab5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ npm install gamedig Promise: ```javascript -var Gamedig = require('gamedig'); +const Gamedig = require('gamedig'); Gamedig.query({ type: 'minecraft', host: 'mc.example.com' @@ -29,7 +29,7 @@ Gamedig.query({ or Node.JS Callback: ```javascript -var Gamedig = require('gamedig'); +const Gamedig = require('gamedig'); Gamedig.query({ type: 'minecraft', host: 'mc.example.com' diff --git a/lib/typeresolver.js b/lib/typeresolver.js index be74da6..1a3fe63 100644 --- a/lib/typeresolver.js +++ b/lib/typeresolver.js @@ -14,7 +14,7 @@ function parseList(str) { if(value === 'true' || value === '') value = true; else if(value === 'false') value = false; - else if(!isNaN(value)) value = parseInt(value); + else if(!isNaN(parseInt(value))) value = parseInt(value); out[key] = value; } diff --git a/protocols/battlefield.js b/protocols/battlefield.js index c84e567..26f641b 100644 --- a/protocols/battlefield.js +++ b/protocols/battlefield.js @@ -4,6 +4,7 @@ class Battlefield extends require('./core') { constructor() { super(); this.encoding = 'latin1'; + this.isBadCompany2 = false; } run(state) { diff --git a/protocols/core.js b/protocols/core.js index c8943ea..b88a167 100644 --- a/protocols/core.js +++ b/protocols/core.js @@ -17,6 +17,7 @@ class Core extends EventEmitter { this.encoding = 'utf8'; this.byteorder = 'le'; this.delimiter = '\0'; + this.srvRecord = null; this.globalTimeoutTimer = setTimeout(() => { this.fatal('timeout');