Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Types

Every type here can be imported from pygsi. The models are Pydantic models, and the enums are StrEnums, so each member equals its string value: RoundPhase.LIVE == "live".

GameState

The full state of one player’s game.

FieldTypeMeaning
mapMapState | NoneThe map and the score
roundRoundState | NoneThe current round
playerPlayer | NoneThe tracked player, or None when the payload has no data for them, such as while they’re dead and spectating

MapState

FieldTypeMeaning
namestrThe map’s name, such as "de_dust2"
modestrThe game mode, such as "competitive"
phaseMapPhaseThe map’s phase
roundintThe number of rounds finished, plus one. During a round, that’s the round’s number.
team_ct_scoreintRounds won by CT
team_t_scoreintRounds won by T
round_winsdict[str, str]How each round was won, by round number, such as {"1": "ct_win_elimination"}. Empty unless the config has map_round_wins.

RoundState

FieldTypeMeaning
phaseRoundPhaseThe round’s phase
bombBombStatus | NoneThe bomb’s status, or None if it isn’t planted
winning_teamTeam | NoneThe team that won the round, set once the phase is over

Player

FieldTypeMeaning
steamidstrThe player’s SteamID64
namestrThe player’s name
teamTeamThe player’s team
activityActivity | NoneWhat the player is doing in the game client
statePlayerStateHealth, money, and so on
match_statsPlayerMatchStatsTotals for the match

PlayerState

FieldTypeMeaning
healthintHealth, from 0 to 100
armorintArmor, from 0 to 100
helmetboolWhether the player has a helmet
flashedintHow flashed the player is, from 0 to 255
smokedintHow far inside a smoke the player is, from 0 to 255
burningintHow much the player is burning, from 0 to 255
moneyintMoney
round_killsintKills this round
round_killhsintHeadshot kills this round
equip_valueintThe total value of the player’s equipment

PlayerMatchStats

FieldTypeMeaning
killsintKills this match
assistsintAssists this match
deathsintDeaths this match
mvpsintMVPs this match
scoreintScore this match

Enums

EnumMembers
MapPhaseWARMUP ("warmup"), LIVE ("live"), INTERMISSION ("intermission"), GAMEOVER ("gameover")
RoundPhaseFREEZETIME ("freezetime"), LIVE ("live"), OVER ("over")
BombStatusPLANTED ("planted"), DEFUSED ("defused"), EXPLODED ("exploded")
TeamT ("T"), CT ("CT")
ActivityPLAYING ("playing"), MENU ("menu"), TEXT_INPUT ("textinput")

pygsi only stores payloads from live and finished maps (see Game State), so a stored MapState has the phase LIVE or GAMEOVER.