Remove callback support and global Gamedig.debug option

This commit is contained in:
mmorrison 2019-01-12 22:38:49 -06:00
parent fdc08b5c09
commit dfa5c95efc
5 changed files with 28 additions and 46 deletions

View file

@ -1,5 +1,6 @@
const GameResolver = require('./GameResolver'),
ProtocolResolver = require('./ProtocolResolver');
ProtocolResolver = require('./ProtocolResolver'),
GlobalUdpSocket = require('./GlobalUdpSocket');
const defaultOptions = {
socketTimeout: 2000,
@ -8,9 +9,8 @@ const defaultOptions = {
};
class QueryRunner {
constructor(udpSocket, debug) {
this.debug = debug;
this.udpSocket = udpSocket;
constructor() {
this.udpSocket = new GlobalUdpSocket();
this.gameResolver = new GameResolver();
this.protocolResolver = new ProtocolResolver();
}
@ -90,7 +90,7 @@ class QueryRunner {
}
async _attempt(options) {
if (this.debug) {
if (options.debug) {
console.log("Running attempt with options:");
console.log(options);
}