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

fix: users not found in game events with new demos #475

Merged
merged 4 commits into from
Nov 18, 2023
Merged

Conversation

akiver
Copy link
Collaborator

@akiver akiver commented Nov 18, 2023

Since the last update, game events contain "user slot" rather than "user id" that come from the userinfo table.
Tested on a bunch of valve and faceit demos.

fix #476

Copy link

codecov bot commented Nov 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fd1a1f6) 80.51% compared to head (2dbc94e) 80.53%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #475      +/-   ##
==========================================
+ Coverage   80.51%   80.53%   +0.01%     
==========================================
  Files          47       47              
  Lines        6292     6298       +6     
==========================================
+ Hits         5066     5072       +6     
  Misses       1017     1017              
  Partials      209      209              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Otherwise the player may be the GOTV entity in case of damages/kill by the "world".
@@ -119,7 +119,17 @@ func (geh gameEventHandler) gameState() *gameState {
}

func (geh gameEventHandler) playerByUserID(userID int) *common.Player {
return geh.gameState().playersByUserID[userID]
player := geh.gameState().playersByUserID[userID]
if player != nil || !geh.parser.isSource2() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't change it for Source 1 demos because in case of damages/kills done by the "world" it would return the GOTV entity (id 0) instead of nil.

In Source 2 the CSTV entity ID is not always 0 and may have SourceTV or DemoAutoRecorder as a name.

@markus-wa markus-wa merged commit ea35647 into master Nov 18, 2023
6 checks passed
@markus-wa markus-wa deleted the fix-userid branch November 18, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken after last update, missing e.Killer/e.Victim for events.Kill
2 participants