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

pre-release2 hours ago

Go Get

go get -u github.com/markus-wa/demoinfocs-golang/v6/pkg/demoinfocs@v6.0.0-alpha.1

To upgrade from v5, this may be useful to update import paths (use at your own risk):

sed -i 's/demoinfocs-golang\/v5/demoinfocs-golang\/v6/' **/*.go

See the v6.0.0-alpha.0 release notes for the full list of changes since v5 (import path /v5 → /v6, Go 1.27 requirement, etc.).

Breaking Changes

  • PlayerHurt.HealthDamageTaken is now the HP actually removed (health before the hit minus reported post-hit health) for every hit, not just fatal ones, by @markus-wa in #700
    • On many demos a hit removes dmg_health or dmg_health + 1 HP. This depends on the server build: it shows up on demos from 2023 to 2026, but not on all of them. HealthDamageTaken now matches the game's own damage stats (m_pActionTrackingServices.m_iDamage, round_stats in server.log) in 7,223 of 7,230 player-rounds over a 41-demo corpus (the remaining 7 are player_hurt events the GOTV recording dropped)
    • ADR computed from HealthDamageTaken will be ~1% higher than HLTV's on affected demos. Use HealthDamage (the raw dmg_health) to reproduce HLTV numbers
  • BombExplode is no longer dispatched when the server shuts down a planted bomb without detonating it (e.g. a few ticks after a round is decided at half-time, overtime start or map end) by @markus-wa in #701 — the event now keys off CPlantedC4.m_bHasExploded, matching the native bomb_exploded count exactly in all 41 corpus demos (previously 17 spurious explosions across 12 demos)
  • The v5 line continues to be maintained on the v5 branch for users not ready to upgrade

New Features

  • Decrypt encrypted net-messages in CS2 demos (chat messages in Valve matchmaking demos are encrypted since the Sept 2026 CS2 update) by @blinkzz in #696 and @markus-wa in #697, ported to v6 in #699
    • new ParserConfig.NetMessageDecryptionKey — set it to the key from the match730_*.dem.info file, which MatchInfoDecryptionKey() extracts for you
    • new ParserWarn types WarnTypeMissingNetMessageDecryptionKey (encrypted message seen, no key configured) & WarnTypeCantReadEncryptedNetMessage
    • CSVCMsg_EncryptedData is also exposed as a regular net-message for RegisterNetMessageHandler
    • ⚠️ alpha caveat: there is no encrypted CS2 demo in the test suite yet, so this path is not covered by automated tests — please report any issues with encrypted demos (a wrong key currently fails the parse instead of just warning)
  • Updated proto messages (svc_EncryptedData, CSVCMsg_VoiceData.caster, textallchat, CS_UM_*_CSGOLegacy renames, CCSUsrMsg_CustomHudClicked) in #699

Fixes

  • Fix player name changes being reverted after a reconnect & Playing() returning the same *Player twice when a bot name is re-used on CS2 GOTV demos (regression in v6.0.0-alpha.0, reported by @billfreeman44 in #692) by @markus-wa in #693
    • restores the userinfo string-table guard against the GOTV proxy re-sending stale pre-reconnect userinfo, while keeping alpha.0's mid-match broadcast user-id mapping fix
    • player_connect now syncs the authoritative name onto the player object & dispatches PlayerNameChange
    • bot controller → raw-player matching is slot-first and deterministic
  • Fix nil Entity/Owner on WeaponInstance of thrown grenades (GrenadeProjectileThrow, mimicked WeaponFire; #580) by @markus-wa in #688 — CS2 destroys the weapon entity before the projectile is created, so the last-known weapon of that type is used as a fallback (nil Entity went from 9–42% of throws per demo to 0)
  • Fix Equipment.Silenced() panicking with a nil pointer dereference on equipment whose class has no m_bSilencerOn (defuse kit, kevlar, helmet, NVG) by @youdie006 in #695

Changes

  • Performance: reduce parse hotspots (snappy destination reuse, field-path huffman peek table, less decoder boxing) by @markus-wa in #691 — ~12% faster, ~19% less memory and ~3% fewer allocs/op vs. v6.0.0-alpha.0 on BenchmarkDemoInfoCs
  • CI: least-privilege workflow permissions in #690, OSV-Scanner dependency vulnerability scanning in #689, CSDA step disabled until it migrates to v6 by @akiver in #694
  • Dependency updates: ice-cipher-go v1.0.0 (new, for net-message decryption), gobitread v0.2.5, x/image 0.45.0, x/text 0.41.0

New Contributors

Full Changelog: v6.0.0-alpha.0...v6.0.0-alpha.1

Discussions / Chat / Announcements

Discord Chat

Don't miss a new demoinfocs-golang release

NewReleases is sending notifications on new releases.