Skip to content

Commit

Permalink
close #151: hide players who disconnected before match start
Browse files Browse the repository at this point in the history
  • Loading branch information
drweissbrot committed Mar 2, 2024
1 parent 9bc1380 commit 1449fe5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ This project does not adhere to Semantic Versioning.
### Added
* Added fallback for wrong GSI-reported inferno flame positions

### Changed
* Players who disconnected before match start are now hidden


## [2.4.0] - 2024-02-04
### Added
Expand Down
6 changes: 5 additions & 1 deletion src/themes/raw/gsi/parse-players.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const getObserverSlot = (player, steam64Id) => {
const rawSlot = player.observer_slot ?? additionalState.lastKnownPlayerObserverSlot?.[steam64Id]
if (options['preferences.isCsgo']) return rawSlot

if (rawSlot === undefined) return
if (rawSlot === 9) return 0
return rawSlot + 1
}
Expand Down Expand Up @@ -64,6 +65,9 @@ export const parsePlayers = () => {
const name = playerNameOverrides.get(steam64Id) || player.name
if (hiddenPlayerNames.has(name)) continue

const observerSlot = getObserverSlot(player, steam64Id)
if (observerSlot === undefined) continue

const weapons = parsePlayerWeapons(player)
const grenades = []

Expand All @@ -90,6 +94,7 @@ export const parsePlayers = () => {
kdRatio,
knife,
name,
observerSlot,
primary,
secondary,
steam64Id,
Expand Down Expand Up @@ -122,7 +127,6 @@ export const parsePlayers = () => {
kills: player.match_stats?.kills,
money: player.state?.money,
mvps: player.match_stats?.mvps,
observerSlot: getObserverSlot(player, steam64Id),
position: parsePosition(player.position),
roundDamage: player.state?.round_totaldmg,
roundDamages: additionalState.roundDamages?.[steam64Id] || [],
Expand Down

0 comments on commit 1449fe5

Please sign in to comment.