mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
Fixes for ase, geneshift, minecraftping, and quake 2 arising from cleanup
This commit is contained in:
parent
14aa56714f
commit
b015d58a0a
8 changed files with 29 additions and 21 deletions
|
|
@ -125,15 +125,19 @@ class Core extends EventEmitter {
|
|||
|
||||
parseDns(host,c) {
|
||||
const resolveStandard = (host,c) => {
|
||||
if(this.debug) console.log("Standard DNS Lookup: " + host);
|
||||
dns.lookup(host, (err,address,family) => {
|
||||
if(err) return this.fatal(err);
|
||||
if(this.debug) console.log(address);
|
||||
this.options.address = address;
|
||||
c();
|
||||
});
|
||||
};
|
||||
|
||||
const resolveSrv = (srv,host,c) => {
|
||||
if(this.debug) console.log("SRV DNS Lookup: " + srv+'.'+host);
|
||||
dns.resolve(srv+'.'+host, 'SRV', (err,addresses) => {
|
||||
if(this.debug) console.log(err, addresses);
|
||||
if(err) return resolveStandard(host,c);
|
||||
if(addresses.length >= 1) {
|
||||
const line = addresses[0];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue