-
Notifications
You must be signed in to change notification settings - Fork 144
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
bug: players array not always returning #632
Comments
Garrys mod runs on the Valve protocol, which has players number in the 'general informations' query (this is why you see the players count but no players): node-gamedig/protocols/valve.js Line 69 in ba2f373
Although I see that on gametracker it does report some players, while making our query, the server does not respond to the players query which times out:
(the logs show the initial query to which responds with a new challenge code, the final query is with the provided challenge, and it times out) Although I queried the server a bunch of times, it always fails the players query, which is weird considering it works for you sometimes. |
Could you try to run the query with |
Bump. |
Describe the bug
The state.players array is currently returning Players(0) [] even when it further up it recognises there is 12 numplayers.
However there are occasions it works, its just mixing between the two.
Expected behavior
Should return the data array of players.
Screenshots or Data
let playerList;
if (state.players && state.players.length > 0) {
playerList = state.players.map(player => player.name || 'Unknown').join('\n'); // Add line breaks here
} else if (state.numplayers > 0) {
playerList = 'Player details unavailable';
} else {
playerList = 'No players online';
}
Console (from public server, used for test):
Results {
name: 'Gaminglight ▌ ImperialRP ▌ Custom ▌ No Training',
map: 'rp_anaxes_v2-5',
password: false,
raw: {
protocol: 17,
folder: 'garrysmod',
game: 'starwarsrp',
appId: 4000,
numbots: 0,
listentype: 'd',
environment: 'l',
secure: 1,
steamid: '85568392923361747',
tags: [ ' gm:starwarsrp loc:us ver:240809' ],
players: []
},
version: '2023.06.28',
maxplayers: 110,
numplayers: 12,
players: Players(0) [],
bots: Players(0) [],
queryPort: 27015,
connect: '193.243.190.36:27015',
ping: 19
}
Players(0) []
The text was updated successfully, but these errors were encountered: