Go Get
go get -u github.com/markus-wa/demoinfocs-golang/v6/pkg/demoinfocs@v6.0.0-alpha.0
Breaking Changes
- Upgraded version from v5 to v6, changing import paths from
github.com/markus-wa/demoinfocs-golang/v5/...togithub.com/markus-wa/demoinfocs-golang/v6/...sed -i 's/demoinfocs-golang\/v5/demoinfocs-golang\/v6/' **/*.gomay be useful to upgrade, use at your own risk
- Now requires Go 1.27 (up from 1.24) by @markus-wa in #681
- Several correctness fixes change observable parsing output: new
InfernoFireOutevents,PlayerHurt.Health()now reports the HP before the event,PlayerFlashedvictims are paired by detonation rather than FIFO order, andPlayerHurt.HealthDamageTakenis capped at remaining HP on fatal hits - The
v5line continues to be maintained on thev5branch for users not ready to upgrade
New Features
- Full user-command decoding for CS2 by @WangChuDi in #669
- new
events.UserCmdwith the fully reconstructed command (buttons, mouse deltas, view angles, movement, subtick moves, input history, …), incl. delta-encoded commands - new
ParserConfig.UserCmdParsingmodes:UserCmdParsingFull,UserCmdParsingButtonsOnly(default, low overhead) &UserCmdParsingDisabled
- new
- Knife detail:
common.KnifeTypewithMapKnifeType(), user-extensibleKnifeTypes/KnifeTypeIndexMapping/KnifeTypeNamesmaps, andEquipment.OriginalStringcarrying the raw weapon string from game events by @markus-wa in #683 - New events & getters by @markus-wa in #663:
events.InfernoFireOut— dispatched when an inferno's flames actually burn out (~5–7s), as opposed toInfernoExpiredon entity destroy (~20s)events.VoteCastwith library-resolved playerBombDefuseStart.SiteandPlayerJump.PositionParser.FrameCount()— returns-1until the total frame count is known
Player.Velocity()by @akiver in #674- Updated proto messages by @akiver in #660
Fixes
- OOM FIX: fail fast on corrupt bitstreams instead of OOM-killing — production demos that previously OOM'd at ~121 GB live heap (desynced entity state after a handler panic) now abort in ~2s at ~150 MB with a recoverable error:
- stop processing queued messages once a fatal error is recorded by @StefanDorresteijn in #664
- stop all handler work (incl. user-registered handlers) once a fatal error is recorded by @markus-wa in #678
- bound field-state allocations by @StefanDorresteijn in #665
- bound
readBytesallocation before decoding corrupt lengths by @markus-wa in #679
- Proper support for polymorphic fields in the CS2 sendtables parser by @Copilot in #654 — sub-fields of polymorphic pointers (e.g.
m_pGameRules.m_pGameModeRules.*deathmatch fields) now resolve per active type, with deterministic handler rebuilds and nested-table enumeration inProperties()/Map() - Fix entity-stream desync (panic: "unable to find existing entity") on demos containing plugin-spawned entities such as CBeam — the quantized-float decoder now rounds to nearest, matching the engine's encoder by @akiver in #672
- Fix float decoding differences between amd64 and arm64 (FMA contraction) by @akiver in #676
- Fix
PlayerHurtdispatch timing soevent.Player.Health()reports the HP before the event by @akiver in #675 - Fix send-node field-name collisions: colliding fields now resolve via canonical
sendNode.varNamepaths (e.g.m_vecVelocity.m_vecX), bare names keep working as deprecated aliases by @akiver in #674 - Fix
PlayerButtonsStateUpdatenot working since the last CS2 update & resolve usercmd players via controller entity by @WangChuDi in #669 - Always update player user ID in
getOrCreatePlayerby @akiver in #659 - Broadcasts: fix player user-id mappings when starting parsing mid-match by @markus-wa in #655
- Further correctness fixes by @markus-wa in #663:
- Dispatch
OtherDeathfor CS2entity_killed - Resolve
PlayerHurt.Attackerviaattacker_pawnfallback - Deterministic collection accessors & grenade/inferno
UniqueIDs - Decode 32-bit QAngle components as noscale floats (fixes e.g.
m_aimPunchAngle) - Stop
GrenadeProjectile.Velocity()panicking on CS2 demos - Grenade type fallback by server class +
ParserWarninstead of stderr for unknown models
- Dispatch
Changes
- Performance Improvement (end below v5.2.0 in allocations & memory): fix alloc regressions, pool frame buffers & widen value caches by @markus-wa in #685 — ~12% fewer allocs/op, ~30% less memory and ~3% faster parsing than v5.2.0
- Upgraded linter config by @akiver in #680
- CI: update actions/checkout to v7, setup-go to v7, cache to v6, codeql-action to v4, create-pull-request to v8 by @katsugtgz in #677
- Docs: fix typos by @antonkesy in #667, clarify
IsWalking()semantics in #684, plus doc corrections for game events,AmmoReserve(),FlashDuration& more in #663 - Dependency updates: testify 1.12.1, protobuf 1.36.12, x/image 0.41.0, and a README fix
New Contributors
- @katsugtgz made their first contribution in #677
- @antonkesy made their first contribution in #667
Full Changelog: v5.2.0...v6.0.0-alpha.0