fix(valve): dont skip players with no name (#449)

* fix: dont skip players with no name

* feat: dont delete raw.players

* chore: update changelog
This commit is contained in:
CosminPerRam 2024-01-11 02:21:16 +02:00 committed by GitHub
parent aa8b20b302
commit 184e9b170c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -35,7 +35,8 @@ see next point) and `tshock` (which is `terraria`).
#### Games
* Removed the players::setNum method, the library will no longer add empty players as
a placeholder in the `players` fields.
placeholders in the `players` fields.
* Valve: dont skip players with no name and keep state.raw.players.
* Stabilized field `numplayers`.
* BeamMP (2021) - Added support.

View File

@ -188,9 +188,6 @@ export default class valve extends Core {
this.logger.debug('Found player: ' + name + ' ' + score + ' ' + time)
// connecting players don't count as players.
if (!name) continue
// CSGO sometimes adds a bot named 'Max Players' if host_players_show is not 2
if (state.raw.appId === AppId.CSGO && name === 'Max Players') continue
@ -274,7 +271,7 @@ export default class valve extends Core {
const sortedPlayers = state.raw.players.sort((a, b) => {
return botProbability(a) - botProbability(b)
})
delete state.raw.players
const numBots = state.raw.numbots || 0
while (state.bots.length < numBots && sortedPlayers.length) {