mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-18 01:30:39 +01:00
Merge pull request #311 from WhyKickAmooCow/master
Fixed Minecraft resolver only reporting 0 ping. #310
This commit is contained in:
commit
0687474982
1 changed files with 3 additions and 3 deletions
|
@ -76,20 +76,20 @@ class Minecraft extends Core {
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
if (vanillaState.maxplayers) state.maxplayers = vanillaState.maxplayers;
|
if (vanillaState.maxplayers) state.maxplayers = vanillaState.maxplayers;
|
||||||
if (vanillaState.players.length) state.players = vanillaState.players;
|
if (vanillaState.players.length) state.players = vanillaState.players;
|
||||||
if (vanillaState.ping) state.ping = vanillaState.ping;
|
if (vanillaState.ping) this.registerRtt(vanillaState.ping);
|
||||||
}
|
}
|
||||||
if (gamespyState) {
|
if (gamespyState) {
|
||||||
if (gamespyState.name) state.name = gamespyState.name;
|
if (gamespyState.name) state.name = gamespyState.name;
|
||||||
if (gamespyState.maxplayers) state.maxplayers = gamespyState.maxplayers;
|
if (gamespyState.maxplayers) state.maxplayers = gamespyState.maxplayers;
|
||||||
if (gamespyState.players.length) state.players = gamespyState.players;
|
if (gamespyState.players.length) state.players = gamespyState.players;
|
||||||
else if (gamespyState.raw.numplayers) state.players.setNum(parseInt(gamespyState.raw.numplayers));
|
else if (gamespyState.raw.numplayers) state.players.setNum(parseInt(gamespyState.raw.numplayers));
|
||||||
if (gamespyState.ping) state.ping = gamespyState.ping;
|
if (gamespyState.ping) this.registerRtt(gamespyState.ping);
|
||||||
}
|
}
|
||||||
if (bedrockState) {
|
if (bedrockState) {
|
||||||
if (bedrockState.name) state.name = bedrockState.name;
|
if (bedrockState.name) state.name = bedrockState.name;
|
||||||
if (bedrockState.maxplayers) state.maxplayers = bedrockState.maxplayers;
|
if (bedrockState.maxplayers) state.maxplayers = bedrockState.maxplayers;
|
||||||
if (bedrockState.map) state.map = bedrockState.map;
|
if (bedrockState.map) state.map = bedrockState.map;
|
||||||
if (bedrockState.ping) state.ping = bedrockState.ping;
|
if (bedrockState.ping) this.registerRtt(bedrockState.ping);
|
||||||
}
|
}
|
||||||
// remove dupe spaces from name
|
// remove dupe spaces from name
|
||||||
state.name = state.name.replace(/\s+/g, ' ');
|
state.name = state.name.replace(/\s+/g, ' ');
|
||||||
|
|
Loading…
Reference in a new issue