mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-18 01:30:39 +01:00
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:
parent
aa8b20b302
commit
184e9b170c
2 changed files with 3 additions and 5 deletions
|
@ -35,7 +35,8 @@ see next point) and `tshock` (which is `terraria`).
|
||||||
|
|
||||||
#### Games
|
#### Games
|
||||||
* Removed the players::setNum method, the library will no longer add empty players as
|
* 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`.
|
* Stabilized field `numplayers`.
|
||||||
* BeamMP (2021) - Added support.
|
* BeamMP (2021) - Added support.
|
||||||
|
|
||||||
|
|
|
@ -188,9 +188,6 @@ export default class valve extends Core {
|
||||||
|
|
||||||
this.logger.debug('Found player: ' + name + ' ' + score + ' ' + time)
|
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
|
// 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
|
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) => {
|
const sortedPlayers = state.raw.players.sort((a, b) => {
|
||||||
return botProbability(a) - botProbability(b)
|
return botProbability(a) - botProbability(b)
|
||||||
})
|
})
|
||||||
delete state.raw.players
|
|
||||||
const numBots = state.raw.numbots || 0
|
const numBots = state.raw.numbots || 0
|
||||||
|
|
||||||
while (state.bots.length < numBots && sortedPlayers.length) {
|
while (state.bots.length < numBots && sortedPlayers.length) {
|
||||||
|
|
Loading…
Reference in a new issue