Categorygithub.com/LukeyR/CS2-GameStateIntegration

# README

Counter Strike 2 (CS2) Game State Integration (GSI)

A small package to take advantage of Game State Integration in CS2

Example Usage

See cmd for 2 dummy projects.

Supported Events

Not every unique event in the game is supported yet (although I welcome changes that add more). The following ones are supported:

IDEvent NameDescriptionNotes
0EventHeartbeatHeartbeat sent from the game to check the server is still accepting
1EventPlayerPausedPlayer paused the game
2EventPlayerPlayingPlayer has started playing again
3EventPlayerInTextInputIn a text input (seem's to be triggered when entering chat and console)
4EventPlayerWeaponUsePlayer fired their weapon
5EventPlayerWeaponReloadStartedStarted Reloading their weapon
6EventPlayerWeaponReloadFinishedFinished Reloading their weapon
7EventPlayerWeaponChangedChanging from one type of gun to another (e.g. AK-47 to SG 553)
8EventPlayerWeaponAddedPicked up a wespon
9EventPlayerWeaponRemovedDropped a weapon
10EventPlayerActiveWeaponSwitchedSwitched from e.g. primary to secondary
11EventPlayerHealthChangedHealth increased/decreased
12EventPlayerArmourChangedArmour increased/decreased
13EventPlayerAlivenessChangedPlayer died/respawned
14EventBombPlantedBomb was plantedThis one doesn't seem instant. From my testing it will always fire circa 1 second late to account for the extra 1 second (white LED) at the end of the bomb countdown sequence. This also relies on the heartbeat packet, so settting your heartbeat packet lower will yield more accurate timing. I have mine set to 0.5 seconds for testing
15EventBombDefusedBomb was defused
16EventBombExplodedBomb exploded

Usage

Using the go-package

You can use the go package in your own application to build more complicated tooling around game events. go get github.com/LukeyR/CS2-GameStateIntegration

Using a websocket

If yout not a fan of go, you can download the binary .exe from the latest release, and listen to events via a websocket. Once you are running the websocket, connect to ws://127.0.0.1:8000/ws. You can provide the query paramter Events as many times as you like to choose which events to subscribe to. You can use the ID's or the event name form the table above. e.g. ws://127.0.0.1:8000/ws?Events=11&Events=EventPlayerAlivenessChanged would get a message every time the player's health changed, or they died/respawned.

Building

Nothing special here. Your usual go build process should work as normal.

# Packages

No description provided by the author
No description provided by the author