Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to fetch player's list - 7 days to die #646

Open
aman7 opened this issue Sep 27, 2024 · 8 comments
Open

unable to fetch player's list - 7 days to die #646

aman7 opened this issue Sep 27, 2024 · 8 comments
Labels

Comments

@aman7
Copy link

aman7 commented Sep 27, 2024

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
gamedig

@aman7 aman7 added the bug label Sep 27, 2024
@xCausxn
Copy link
Contributor

xCausxn commented Sep 27, 2024

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.

@CosminPerRam
Copy link
Member

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?

@aman7
Copy link
Author

aman7 commented Sep 29, 2024

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?

i am not trying to get number of players, i am trying to get list of players online.

@CosminPerRam
Copy link
Member

Can you provide the server IP that you are trying to query and not get any players info?

@aman7
Copy link
Author

aman7 commented Sep 29, 2024

for example this server
https://www.battlemetrics.com/servers/7dtd/29531220
Address
63.143.60.238:29800

@xCausxn
Copy link
Contributor

xCausxn commented Sep 29, 2024

@CosminPerRam Battlemetrics do not show a player list either, so I do not think the server exposes this information.

@CosminPerRam
Copy link
Member

Server Query Output {"name":"SaltyZombies PVE US Casual","map":"Salty","password":false,"raw":{"protocol":17,"folder":"7DTD","game":"7 Days To Die","appId":251570,"numbots":0,"listentype":"d","environment":"l","secure":0,"steamid":"90202160542751766","tags":["ApoBAQMACAAAgOzmAhIYiAMFgAEEH7gBAgAAMrQHAAADAwOIA4gDpAGkAQcACC0AqNEDESEygKABQQrTAg=="],"players":[{"nam e":"","score":0,"time":4002.676025390625},{"name":"","score":0,"time":4000.481201171875},{"name":"","score":0,"time":4000.03076171875},{"name":"","score":0,"time":3985.624267578125},{"name":"","score":0,"time":3966.894287109375},{"name":"","score":0,"time":3962.34423828125},{"name":"","score":0,"time":3948.61572265625},{"name":"","score":0," time":3948.116943359375},{"name":"","score":0,"time":3939.6513671875},{"name":"","score":0,"time":3918.2138671875},{"name":"","score":0,"time":3913.76123046875},{"name":"","score":0,"time":3906.64697265625},{"name":"","score":0,"time":3869.72607421875},{"name":"","score":0,"time":3852.9931640625},{"name":"","score":0,"time":3845.081787109375 },{"name":"","score":0,"time":3830.485107421875},{"name":"","score":0,"time":3819.108642578125},{"name":"","score":0,"time":3808.710205078125},{"name":"","score":0,"time":3771.7197265625},{"name":"","score":0,"time":3730.080078125},{"name":"","score":0,"time":3678.33154296875},{"name":"","score":0,"time":3578.486572265625},{"name":"","score" :0,"time":3503.099609375},{"name":"","score":0,"time":3430.277587890625},{"name":"","score":0,"time":2911.47119140625},{"name":"","score":0,"time":2696.759765625},{"name":"","score":0,"time":2511.851318359375},{"name":"","score":0,"time":2475.716796875},{"name":"","score":0,"time":1825.9691162109375},{"name":"","score":0,"time":1692.01892089 84375},{"name":"","score":0,"time":1667.11669921875},{"name":"","score":0,"time":1613.21337890625},{"name":"","score":0,"time":1113.2679443359375},{"name":"","score":0,"time":319.02740478515625},{"name":"","score":0,"time":177.51206970214844}]},"version":"01.01.00","maxplayers":50,"numplayers":35,"players":[{"name":"","raw":{"score":0,"time" :4002.676025390625}},{"name":"","raw":{"score":0,"time":4000.481201171875}},{"name":"","raw":{"score":0,"time":4000.03076171875}},{"name":"","raw":{"score":0,"time":3985.624267578125}},{"name":"","raw":{"score":0,"time":3966.894287109375}},{"name":"","raw":{"score":0,"time":3962.34423828125}},{"name":"","raw":{"score":0,"time":3948.615722656 25}},{"name":"","raw":{"score":0,"time":3948.116943359375}},{"name":"","raw":{"score":0,"time":3939.6513671875}},{"name":"","raw":{"score":0,"time":3918.2138671875}},{"name":"","raw":{"score":0,"time":3913.76123046875}},{"name":"","raw":{"score":0,"time":3906.64697265625}},{"name":"","raw":{"score":0,"time":3869.72607421875}},{"name":"","raw ":{"score":0,"time":3852.9931640625}},{"name":"","raw":{"score":0,"time":3845.081787109375}},{"name":"","raw":{"score":0,"time":3830.485107421875}},{"name":"","raw":{"score":0,"time":3819.108642578125}},{"name":"","raw":{"score":0,"time":3808.710205078125}},{"name":"","raw":{"score":0,"time":3771.7197265625}},{"name":"","raw":{"score":0,"tim e":3730.080078125}},{"name":"","raw":{"score":0,"time":3678.33154296875}},{"name":"","raw":{"score":0,"time":3578.486572265625}},{"name":"","raw":{"score":0,"time":3503.099609375}},{"name":"","raw":{"score":0,"time":3430.277587890625}},{"name":"","raw":{"score":0,"time":2911.47119140625}},{"name":"","raw":{"score":0,"time":2696.759765625}},{ "name":"","raw":{"score":0,"time":2511.851318359375}},{"name":"","raw":{"score":0,"time":2475.716796875}},{"name":"","raw":{"score":0,"time":1825.9691162109375}},{"name":"","raw":{"score":0,"time":1692.0189208984375}},{"name":"","raw":{"score":0,"time":1667.11669921875}},{"name":"","raw":{"score":0,"time":1613.21337890625}},{"name":"","raw":{"score":0,"time":1113.2679443359375}},{"name":"","raw":{"score":0,"time":319.02740478515625}},{"name":"","raw":{"score":0,"time":177.51206970214844}}],"bots":[],"queryPort":29800,"connect":"63.143.60.238:29800","ping":145}

It provides players info, but not names, querying a bunch of other servers results in the same behaviour.

@xCausxn
Copy link
Contributor

xCausxn commented Sep 29, 2024

Yeah which is useless, other than maybe time connected. Probably why battlemetrics dont show it.

I would assume its an anti-stalking/streamer measure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants