-
Notifications
You must be signed in to change notification settings - Fork 174
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
Added knife kills, utility damage and enemies/friendlies-flashed tracking + use in-game flash-assist logic #612
Conversation
|| weaponId == CSWeapon_KNIFE_GHOST | ||
|| weaponId > CSWeapon_MAX_WEAPONS_NO_KNIFES) { | ||
IncrementPlayerStat(attacker, STAT_KNIFE_KILLS); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change to this method instead of StrContains("knife"). As mentioned in the comments here, there's one knife that does not contain "knife"; the regular bayonet. This method should also be future-proof.
@PhlexPlexico Note the additional fields added. |
if (flash_assister > 0) | ||
AddPlayer(params, "flash_assister", flash_assister); | ||
params.SetBool("flash_assist", flash_assist); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a breaking change, but I don't know how much semantic versioning you normally apply to the event-logger.
Resolved merge conflicts stemming from merging #613. |
I run this "in production" with no issues, but it does make changes to both the MySQL tables (and would break for people who copy-pasted the SQL script for their schemas) and the event-logger for the API-status addon. |
That will definitely be some users. Would you be able to paste the command necessary for users to update their schema (to add the new columns)? I can add that to the release changelog then. Otherwise this looks mostly fine, but I'll want to take one more pass at it to be sure. Sorry for the delay here. |
For this PR alone it's as simple as: ALTER TABLE `get5_stats_players`
ADD COLUMN `knife_kills` SMALLINT(5) UNSIGNED NOT NULL AFTER `teamkills`,
ADD COLUMN `utility_damage` SMALLINT(5) UNSIGNED NOT NULL AFTER `damage`,
ADD COLUMN `enemies_flashed` SMALLINT(5) UNSIGNED NOT NULL AFTER `utility_damage`,
ADD COLUMN `friendlies_flashed` SMALLINT(5) UNSIGNED NOT NULL AFTER `enemies_flashed`; Even with no default value set, all existing rows will just have a value of 0 for these columns. |
Also, you can close #405 if you merge this. |
Added check to prevent spectators or unteamed players from affecting flash stats: 346dbcd |
@splewis are there anything preventing this to be merged? Because of the Get5 dependacies will PhlexPlexico/get5-webapi#14 not be merged until this have been merged |
…tracking Use game-provided flash-assist logic
Brought this up to date with master. No conflicts. |
Hey @splewis |
I'm very open to volunteers there. (perhaps I should add something to the readme...) In the future, I'd suggest breaking up such a PR into 2:
|
Add in global forwards. Update debug calls. Update misused sizeof. Include timer to make sure unpause event fires off. Having to create new timer to keep track of unpause event. Additional comments. Move team for when timer is finished. Include global handler for p;ause time. This is needed if users !pause during the match. Use freeze time, it works as intended. Fixes based on comments. Remove Handler. Bump to 0.8.0-dev, since splewis#612 will have breaking eventlogger changes. (Squashed): Added knife kills, utility damage and enemies/team-flash tracking (splewis#612) Use game-provided flash-assist logic Stats in JSON format (splewis#686) * Dump stats in JSON format * update sm-json * Fix malformed JSON stats Fixed code not entering the inital "Stats" section. Moved the section name extraction to avoid messing with the traversal stack. * Reduced JSON stats buffer to avoid "out of heap" errors * Add debug log when trying to JSON encode unsupported type * Only dump stats in JSON format if stats file have json extension * Util function for checking json extension IsJSONPath checks if the path ends in ".json". Change DumpToFilePath and LoadMatchFile to use IsJSONPath.
Add in global forwards. Update debug calls. Update misused sizeof. Include timer to make sure unpause event fires off. Having to create new timer to keep track of unpause event. Additional comments. Move team for when timer is finished. Include global handler for p;ause time. This is needed if users !pause during the match. Use freeze time, it works as intended. Fixes based on comments. Remove Handler. Bump to 0.8.0-dev, since splewis#612 will have breaking eventlogger changes. (Squashed): Added knife kills, utility damage and enemies/team-flash tracking (splewis#612) Use game-provided flash-assist logic Stats in JSON format (splewis#686) * Dump stats in JSON format * update sm-json * Fix malformed JSON stats Fixed code not entering the inital "Stats" section. Moved the section name extraction to avoid messing with the traversal stack. * Reduced JSON stats buffer to avoid "out of heap" errors * Add debug log when trying to JSON encode unsupported type * Only dump stats in JSON format if stats file have json extension * Util function for checking json extension IsJSONPath checks if the path ends in ".json". Change DumpToFilePath and LoadMatchFile to use IsJSONPath.
Hey @splewis - I'd like to be made co-maintainer if possible. I would maybe also suggest we create a Discord and add it to the readme so people can ask questions on there instead of creating issues. It would probably help a little with communication in general. What do you think? |
I did some local rebasing which auto-deleted my previous PR. I apologize.
This is the same.
#609