mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-17 09:18:31 +01:00
Minor cleanup to satisfy code inspection
This commit is contained in:
parent
20b012ba80
commit
c0548fb886
4 changed files with 5 additions and 3 deletions
|
@ -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'
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ class Battlefield extends require('./core') {
|
|||
constructor() {
|
||||
super();
|
||||
this.encoding = 'latin1';
|
||||
this.isBadCompany2 = false;
|
||||
}
|
||||
|
||||
run(state) {
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue