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

Limitations

This page lists what pygsi doesn’t do. Some of it is CS2’s limit, because the game sends a player less than it sends an observer, and some is pygsi’s own.

What CS2 Doesn’t Send Players

Some GSI components only carry data for spectators and observers, such as casters and tournament tools:

  • allplayers, allplayers_state, allplayers_match_stats, allplayers_weapons, and allplayers_position, with data on every player in the match
  • bomb, with the bomb’s position and carrier
  • allgrenades, with every grenade in the air
  • phase_countdowns, with the timers for each phase
  • player_position, with the player’s position

During a match, a player’s own client sends nothing for these, so pygsi doesn’t model them. That also means pygsi can’t say who the player killed, who killed them, or who planted the bomb. The draft CS2 GSI spec lists every component and what CS2 sends for each.

What pygsi Doesn’t Do

  • Handlers must be async. There’s no support for plain def handlers.
  • run() owns the event loop. It calls uvicorn.run, which creates its own loop and blocks. To share a process with other async code, such as a Discord bot, you have to run pygsi in its own thread.
  • The config file’s auth block is ignored. CS2 can send a token with each payload, but pygsi doesn’t check it. Anyone who can reach the server can send it payloads, which is one more reason to bind to 127.0.0.1 when you can.
  • Handler signatures aren’t type-checked. The decorators accept any async function, so a handler with the wrong signature only shows up at runtime, as an error in the log.
  • Weapons aren’t modeled. CS2 sends a player’s weapons in the player_weapons component, but pygsi doesn’t read it.
  • Nothing is saved. State lives in memory and is gone when the process stops.