github markus-wa/demoinfocs-golang v6.0.0-alpha.0

pre-release6 hours ago

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/... to github.com/markus-wa/demoinfocs-golang/v6/...
    • sed -i 's/demoinfocs-golang\/v5/demoinfocs-golang\/v6/' **/*.go may 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 InfernoFireOut events, PlayerHurt.Health() now reports the HP before the event, PlayerFlashed victims are paired by detonation rather than FIFO order, and PlayerHurt.HealthDamageTaken is capped at remaining HP on fatal hits
  • The v5 line continues to be maintained on the v5 branch for users not ready to upgrade

New Features

  • Full user-command decoding for CS2 by @WangChuDi in #669
    • new events.UserCmd with the fully reconstructed command (buttons, mouse deltas, view angles, movement, subtick moves, input history, …), incl. delta-encoded commands
    • new ParserConfig.UserCmdParsing modes: UserCmdParsingFull, UserCmdParsingButtonsOnly (default, low overhead) & UserCmdParsingDisabled
  • Knife detail: common.KnifeType with MapKnifeType(), user-extensible KnifeTypes / KnifeTypeIndexMapping / KnifeTypeNames maps, and Equipment.OriginalString carrying 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 to InfernoExpired on entity destroy (~20s)
    • events.VoteCast with library-resolved player
    • BombDefuseStart.Site and PlayerJump.Position
    • Parser.FrameCount() — returns -1 until 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:
  • 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 in Properties()/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 PlayerHurt dispatch timing so event.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.varName paths (e.g. m_vecVelocity.m_vecX), bare names keep working as deprecated aliases by @akiver in #674
  • Fix PlayerButtonsStateUpdate not working since the last CS2 update & resolve usercmd players via controller entity by @WangChuDi in #669
  • Always update player user ID in getOrCreatePlayer by @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 OtherDeath for CS2 entity_killed
    • Resolve PlayerHurt.Attacker via attacker_pawn fallback
    • 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 + ParserWarn instead of stderr for unknown models

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

Full Changelog: v5.2.0...v6.0.0-alpha.0

Discussions / Chat / Announcements

Discord Chat

Don't miss a new demoinfocs-golang release

NewReleases is sending notifications on new releases.