Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update module github.com/markus-wa/demoinfocs-golang to v4 #18

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 26, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
github.com/markus-wa/demoinfocs-golang v1.11.0 -> v4.0.1 age adoption passing confidence

Release Notes

markus-wa/demoinfocs-golang (github.com/markus-wa/demoinfocs-golang)

v4.0.1

Compare Source

Go Get
go get -u github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs@v4.0.1
Fixes
Acknowledgements

Thanks to @​akiver for their contributions to this release ❤️

v4.0.0

Compare Source

Go Get
go get -u github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs@v4.0.0
Changes
  • Added Player.Velocity() support for CS2 #​470
  • Added grenade trajectory timings #​452
  • Slight performance improvements #​454
Fixes
  • Fixed bad data in Player.Weapons() and Player.Inventory #​478 - thanks @​micvbang
  • Fixed some events in new CS2 demos not containg players (e.g. attacker, victim) #​475
  • Fixed weapon owners #​473
  • Fixed players marked as disconnected when they aren't #​468
  • Fixed nil pointer deref due to bomb planter state #​464
  • Fixed fire positions #​453
Acknowledgements

Thanks to @​akiver @​micvbang & @​BestAwperEver for their contributions to this release ❤️

v3.3.0

Compare Source

Special thanks to @​akiver for the contributions to this release - see also #​374

Changes
  • Improved POV Demo support
    • Re-use existing entities when they enter PVS if possible based on their serial number
    • Add int64 props decoder (got some with Danger mode demos)
    • Use the proper prop in player.Position() (cslocaldata.m_vecOrigin vs csnonlocaldata.m_vecOrigin)
    • Added event POVRecordingPlayerDetected
  • Make player.isAlive() more accurate by checking the value of the prop m_lifeState
  • Add more known game events
  • Add a doc about game events

v3.2.0

Compare Source

Changes
  • Added Player.TotalDamage() & Player.UtilityDamage() - thanks @​DandrewsDev
  • Added HitGroupNeck constant - thanks @​akiver
  • Upgraded deps go-unassert and quickhull-go to latest versions

v3.1.0

Compare Source

Changes
  • Added Equipment.UniqueID2() - thanks @​David-Durst
  • Added Equipment.RecoilIndex() - thanks @​David-Durst
  • Upgraded dependencies to fix security issues in the supply chain
  • Updated protobufs
Fixes
  • Fixed -debugdemoinfocs not printing game events properly after protobuf upgrade

v3.0.1

Compare Source

Changes
  • Added Player.ColorOrErr() (see #​359)
  • Deprecated Player.Color() (see #​359)
Fixes
  • Fixed panic in Player.Color() for old demos (see #​359)

v3.0.0

Compare Source

v3 is out 🥳

The primary purpose of v3 is to upgrade/replace dependencies, including some which are deprecated and/or dependencies with security vulnerabilities. The parser itself has no known vulnerabilities and no known code paths to vulnerabilities in dependencies, but it's still important to keep on top of this nonetheless.
As secondary objectives we want to modernise some of the API and enable usage of generics for the project (go1.18).

Installation
go get github.com/markus-wa/demoinfocs-golang/v3@​v3.0.0
Migration

change all imports of v2 to v3 - so github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs -> github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs

SED command
sed -i 's#github.com/markus-wa/demoinfocs-golang/v2#github.com/markus-wa/demoinfocs-golang/v3#g' **/*.go
Breaking Changes
  • Removed code marked as deprecated from codebase
  • Increased minimum Go requirement from go1.11 to go1.18
  • Upgraded from the protobuf v1 API to v2 (https://go.dev/blog/protobuf-apiv2)
    • This will affect users that rely on raw net messages (i.e. import github.com/markus-wa/demoinfocs-golang/v2/demoinfocs/msg)
    • Stopped using gogo-protobuf (this has no negative performance impact 🥳)
  • Removed /assets and /pkg/demoinfocs/metadata (was mostly used for examples)
  • Moved internal/constants to pkg/demoinfocs/constants
  • Deps: replaced dustin/go-heatmap with markus-wa/go-heatmap to avoid replace directive (examples only)
Changes
  • Upgraded all dependencies to latest version (including security fixes)

Please let me know if you encounter any issues.

v2.13.3

Compare Source

Changes
  • Examples heatmap and nade-trajectories are now using https://radar-overviews.csgo.saiko.tech/... to get the correct radar image and offset / coordinate translations for any historic map version of official maps. - see also https://github.com/saiko-tech/csgo-centrifuge

v2.13.2

Compare Source

Fixes
  • Started raising ParserWarn instead of error on bad net-message decryption key (see #​326)

v2.13.1

Compare Source

In Support of Ukraine

This release is dedicated to all Ukrainians affected by Putin's war.

Ukrainian Flag
Fixes
  • Fixed MatchInfoDecryptionKey() returning a bad decryption key in certain cases (see #​338 & #​339)

War in Ukraine

Some of my Ukrainian colleagues in the eSports and Tech scene have been directly affected by the crisis and I hope to be able to raise awareness about their situation.

If you enjoy this project, please consider supporting the Global Giving Ukraine Crisis Relief Fund or charity to help the humanitarian crisis happening in the Ukraine right now (a list of other top rated charities can be found here)

Further, please voice your support for more sanctions against Russia in your country (such as sanctions for Gas & Oil) - it's the most effective way to put pressure on Putin and the Russian regime.

To our Russian Friends:
Please read and share this article: https://www.theatlantic.com/ideas/archive/2022/03/schwarzenegger-russia-ukraine-war-message/627100/

v2.13.0

Compare Source

Support for encrypted net-messages 🥳

This means we can now read chat messages from Valve Matchmaking demos! (and more!)

Main PR: #​323

New Features
Example
package main

import (
	"io/ioutil"
	"log"
	"os"

	dem "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs"
	"github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/events"
)

func checkErr(err error) {
	if err != nil {
		panic(err)
	}
}

func main() {
	infoF, err := os.Open("test/cs-demos/match730_003528806449641685104_1453182610_271.dem.info")
	checkErr(err)

	b, err := ioutil.ReadAll(infoF)
	checkErr(err)

	k, err := dem.MatchInfoDecryptionKey(b)
	checkErr(err)

	f, err := os.Open("test/cs-demos/match730_003528806449641685104_1453182610_271.dem")
	checkErr(err)

	defer f.Close()

	cfg := dem.DefaultParserConfig
	cfg.NetMessageDecryptionKey = k

	p := dem.NewParserWithConfig(f, cfg)

	p.RegisterEventHandler(func(message events.ChatMessage) {
		log.Println(message)
	})

	err = p.ParseToEnd()
	checkErr(err)
}

v2.12.2

Compare Source

Fixes
  • Fixed ParseToEnd() not returning errors that happen during SyncAllQueues()
  • Fixed RankUpdate event failing to get the correct player instance when a player re-connected during the game

v2.12.1

Compare Source

Fixes
  • Changed EquipmentType.String() human readable name for EqP250 from p250 to P250

v2.12.0

Compare Source

New Features
  • Added ParserConfig.IgnoreErrBombsiteIndexNotFound flag to ignore errors about bombsite indexes that can't be found (#​315 - see also #​314)

v2.11.1

Compare Source

Fixes
  • fixed BombPlantBegin.Site always being BombsiteA for new demos (#​313)

v2.11.0

Compare Source

New Features

v2.10.1

Compare Source

Fixes
  • common: fix panic when player_connect.networkid is malformed or missing

v2.10.0

Compare Source

Changes
  • Return error for Parser.Close() if closing underlying resources fails (i.e. when closing the bit-reader)
Fixes
  • Fixed (hopefully) an issue where the parser would not work with io.Reader's that don't have all data available from the beginning (e.g. HTTP streaming or Gzip) - see #​299

v2.9.1

Compare Source

New Features
  • Added map scale + translations for de_ancient, de_office and de_agency (#​302 - thanks @​srjnm)

v2.9.0

Compare Source

New Features
  • Added Player.PositionEyes() - returns player position with Z value on eye/view height
Fixes
  • Fixed documentation of Player.Position() - it does not match cl_showpos 1 contrary to what it said before

v2.8.1

Compare Source

New Features
  • Added events.PlayerNameChange to signal that a player's name has changed (#​289)

Fixes

  • Capture a player's name change in Player.Name, this fixes a regression introduced in 0515f18 (#​289)

v2.8.0

Compare Source

New Features / Changes
  • Added GrenadeProjectile.Velocity() function
  • Added sendtables.PropertyValue.Type() function
  • Updated protobuf descriptors
Fixes
  • Fixed docs on DataTablesParsed event referencing non-exposed types

v2.7.1

Compare Source

de_grind crash fix

See #​280 for more information, especially if you need to know the bombsite for some of the bomb related events.

Changes
  • BombEvent.Site may now be unknown/undefined (meaning neither BombsiteA nor BombsiteB), see #​280 for more details
  • Replaced panic: bomb not planted on bombsite A or B with ParserWarn event with the same message
  • Added ParserWarn.Type to reliably identify kinds of warnings, currently only WarnTypeBombsiteUnknown exists

v2.7.0

Compare Source

New Features / Changes
  • Added Player.CrosshairCode() to get players crosshair codes (#​274 - thanks @​captainswain)
  • Calling Parser.Cancel() will no longer send already-parsed events to event and message handlers, and will instead unregister all existing handlers
Fixes
  • Common: fix active Player.ActiveWeapon() sometimes being off right after buy
  • Fixed deadlock caused by calling Parser.Cancel() multiple times within the same frame (#​276 - thanks @​Julien2313)
  • Upgraded some outdated transitive dependencies flagging up as vulnerable in Snyk (#​275)
    • note: no known code-path to vulnerable code was found, so this is more of a routine update

v2.6.0

Compare Source

Hostages!

image

New Features / Changes
  • Improved hostage map support (#​269 - thanks @​akiver)
    • Added GameState.Hostages()
    • Added hostage events
      • HostageRescued
      • HostageRescuedAll
      • HostageHurt
      • HostageKilled
      • HostageStateChanged
  • Added additional data to Kill event (#​270 - thanks @​akiver)
    • AssistedFlash
    • AttackerBlind
    • NoScope
    • ThroughSmoke
    • Distance
  • Added GameState.Rules().RoundTime() - returns the total round time in the current match
  • Added GameState.Rules().BombTime() - returns the total bomb time in the current match
  • Added GameState.Rules().FreezeTime() - returns the total freeze time in the current match
  • Added GameState.Rules().ConVars() - replaces GameState.ConVars()
Deprecations
  • Deprecated GameState.ConVars() in favour of GameState.Rules().ConVars()

v2.5.0

Compare Source

Operation Broken Fang Update

Operation Broken Fang brings with it some interesting new demo data!

There's a new event events.RoundImpactScoreData, containing initial round conditions, kill events and objective events, each with new odds of winning the round per team.

This might be interesting if you're doing player impact analysis, anomaly detection for round wins/clutches and/or training some kind of AI system.

image

New Features / Changes
  • Added events.RoundImpactScoreData which is dispatched at the end of every round (only demos after the "Operation Broken Fang" update)
    • Initial round conditions (equipment value) and odds
    • Kills (+ damage) and how it affected odds
    • Objective data and how it affected odds

v2.4.0

Compare Source

New Features / Changes
  • Added PlayerHurt.HealthDamageTaken - HealthDamage excluding over-damage (#​247 - thanks @​Julien2313)
  • Added PlayerHurt.ArmorDamageTaken - ArmorDamage excluding over-damage (#​247)
  • Added Player.Color() - returns the players color during the match (#​248 / #​250 - thanks @​Julien2313)
  • Added Player.IsDuckingInProgress() - returns true if the player is currently in the progress of going from standing to crouched (#​241 / #​249)
  • Added Player.IsUnDuckingInProgress() - returns true if the player is currently in the progress of going from crouched to standing (#​241 / #​249)
  • Added Player.IsStanding() - returns true if the player is currently fully standing upright (#​241 / #​249)
Fixes
  • Fixed Player.IsDucking() reporting wrong values

v2.3.0

Compare Source

New Features / Changes
  • Implemented full support for locally recorded (POV) demos (#​2)
    Replays recorded via CS:GO's record command rather than the game server (GOTV) are now fully supported

v2.2.0

Compare Source

New Features / Changes
  • Updated Protobuf descriptors (#​215)
Fixes
  • Added Parser.Close() to fix a memory leak due to an unterminated goroutine (#​216)
    please make sure that this function is called before the parser is discarded,
    for instance by calling defer parser.Close() after demoinfocs.NewParser()

v2.1.0

Compare Source

New Features / Changes
  • Added Player.ResourceEntity() to expose the player's CCSPlayerResource entity

v2.0.1

Compare Source

Fixes
  • Avoid panics in godispatch potentially stopping the whole application
    Instead, Parser.ParseToEnd() will return an error containing the whole stack trace.

v2.0.0

Compare Source

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/v2@​v2.0.0
API docs: https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2@​v2.0.0/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)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the deps Dependency updates label Jan 26, 2024
@shuji-koike shuji-koike deleted the renovate/git.luolix.top-markus-wa-demoinfocs-golang-4.x branch January 26, 2024 19:22
Copy link
Contributor Author

renovate bot commented Jan 26, 2024

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 4.x releases. But if you manually upgrade to 4.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps Dependency updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant