Skip to content

v2.0.0

Compare
Choose a tag to compare
@markus-wa markus-wa released this 08 May 11:08
· 690 commits to master since this release
c27cf26

Doc Links

The new docs are hosted on the fabulous new go.dev page.

Package docs: https://pkg.go.dev/mod/github.com/markus-wa/demoinfocs-golang/[email protected]
API docs: https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/[email protected]/pkg/demoinfocs?tab=doc

Go Get

Watch out, there's a new module path for go get and import!

go get -u github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs

Upgrading from v1.x

If you are currently using version 1.x of this library, check out this wiki page for an upgrade guide.

Breaking Changes

  • Import path base has changed from github.com/markus-wa/demoinfocs-golang to github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs
  • Replaced main public structs with interfaces (Parser, GameState, Participants, Entity, Property)
    • These interfaces already existed before but used to be prefixed with I (e.g. IParser)
  • Replaced many struct fields in package common with getter funcs
  • Replaced Player.AdditionalPlayerInfo.XXX with getter funcs on the Player struct
  • Removed or replaced all previously deprecated methods, fields and events
  • Renamed field EquipmentElement.Weapon to EquipmentElement.Type
  • Renamed field Player.RawWeapons to Player.Inventory
  • Renamed field Player.SteamID to Player.SteamID64
  • Renamed func Entity.PropertiesI() to Entity.Properties()
  • Renamed func Entity.FindPropertyI() to Entity.Property()
  • Removed redundant funcs common.EquipmentElementNames() and common.GamePhaseNames()
    EquipmentType.String() and GamePhase.String() will achieve the same result.
  • Removed obsolete func ItemPickup.WeaponTraceable()
    ItemPickup.Weapon should now be identical (see #119)
  • Removed Item{Pickup,Drop,Equip}.WeaponPtr
  • Removed func Entity.BindPosition()
  • Changed type of Item{Pickup,Drop,Equip}.Weapon from Equipment struct to pointer of the same type
  • Changed type of Equipment.ZoomLevel from int to ZoomLevel
  • Changed receiver types of DemoHeader, TeamState, Equipment, GrenadeProjectile and Inferno funcs from struct to pointer

New Features / Changes

  • Added Bomb-Damage detection. PlayerHurt.Weapon.Type and Kill.Weapon.Type will now be EqBomb
  • Added Fall-Damage detection. PlayerHurt.Weapon.Type and Kill.Weapon.Type will now be EqWorld
  • Added field RankUpdate.Player (may be nil if the player has already disconnected)
  • Added utility function Player.SteamID32() which converts SteamID64 to the 32-bit variant and returns the result
  • Added utility function RankUpdate.SteamID64() which converts SteamID32 to the 64-bit variant and returns the result
  • Added utility functions common.ConvertSteamID{TxtTo32,32To64,64To32}()
  • Added constants common.Zoom{None,Half,Full}
  • Updated protobuf code (re-generated with new protoc version)