Skip to content

Commit

Permalink
Stabilize numplayers on minecraft
Browse files Browse the repository at this point in the history
  • Loading branch information
CosminPerRam committed Oct 27, 2023
1 parent d5f191d commit 878b40e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions protocols/minecraft.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,22 @@ export default class minecraft extends Core {
}
state.name = name
} catch (e) {}
if (vanillaState.numplayers) state.numplayers = vanillaState.numplayers
if (vanillaState.maxplayers) state.maxplayers = vanillaState.maxplayers
if (vanillaState.players.length) state.players = vanillaState.players
if (vanillaState.ping) this.registerRtt(vanillaState.ping)
}
if (gamespyState) {
if (gamespyState.name) state.name = gamespyState.name
if (gamespyState.numplayers) state.numplayers = gamespyState.numplayers
if (gamespyState.maxplayers) state.maxplayers = gamespyState.maxplayers
if (gamespyState.players.length) state.players = gamespyState.players
else if (gamespyState.raw.numplayers) state.numplayers = parseInt(gamespyState.raw.numplayers)
if (gamespyState.ping) this.registerRtt(gamespyState.ping)
}
if (bedrockState) {
if (bedrockState.name) state.name = bedrockState.name
if (bedrockState.numplayers) state.numplayers = bedrockState.numplayers
if (bedrockState.maxplayers) state.maxplayers = bedrockState.maxplayers
if (bedrockState.map) state.map = bedrockState.map
if (bedrockState.ping) this.registerRtt(bedrockState.ping)
Expand Down

0 comments on commit 878b40e

Please sign in to comment.