Open aman7 opened 1 month ago
Hi @aman7,
looking at this code the players.forEach
should be state.players.forEach
basing it on your referenced code. Unless you are declaring this variable elsewhere as I cannot see from your snippet.
As for the player names, I do not believe these are visible anyway on the query as shown from the raw
field while cross referencing with a random server on battlemetrics. https://www.battlemetrics.com/servers/7dtd/28162889
This is likely information only available over rcon.
Also the currently online players should be accessed through state.numplayers
not from the raw
field.
Could you post a Minimal Reproducible Example, the gamedig version you are using and if possible the server you are trying to query?
Also the currently online players should be accessed through
state.numplayers
not from theraw
field.Could you post a Minimal Reproducible Example, the gamedig version you are using and if possible the server you are trying to query?
i am not trying to get number of players, i am trying to get list of players online.
Can you provide the server IP that you are trying to query and not get any players info?
for example this server https://www.battlemetrics.com/servers/7dtd/29531220 Address 63.143.60.238:29800
@CosminPerRam Battlemetrics do not show a player list either, so I do not think the server exposes this information.
It provides players info, but not names, querying a bunch of other servers results in the same behaviour.
Yeah which is useless, other than maybe time connected. Probably why battlemetrics dont show it.
I would assume its an anti-stalking/streamer measure.
Describe the bug i am using gamedig for my discord bot to fetch player's list out of server, it is working with Unturned, but not with 7 days to die. instead of player's list it is sending Undefind. i have attached the screenshot.
Steps To Reproduce var totalPlayers = state.raw.numplayers; var names = "Total Number of player is (" + totalPlayers + ")\n\n"; players.forEach(element => { if (totalPlayers > 0) names += element.name + "\n"; }); console.log(names);
Expected behavior this should list all the existing players in the server.
Screenshots or Data