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

Added knife kills, utility damage and enemies/friendlies-flashed tracking + use in-game flash-assist logic #612

Merged
merged 1 commit into from
Sep 26, 2021

Conversation

nickdnk
Copy link
Collaborator

@nickdnk nickdnk commented Jan 3, 2021

I did some local rebasing which auto-deleted my previous PR. I apologize.

This is the same.

#609

@nickdnk nickdnk changed the title Added knife kills and utility damage tracking (again as I') Added knife kills and utility damage tracking (again as I'm dumb) Jan 3, 2021
|| weaponId == CSWeapon_KNIFE_GHOST
|| weaponId > CSWeapon_MAX_WEAPONS_NO_KNIFES) {
IncrementPlayerStat(attacker, STAT_KNIFE_KILLS);
}
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 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.

@nickdnk nickdnk changed the title Added knife kills and utility damage tracking (again as I'm dumb) Added knife kills, utility damage and enemies/friendlies-flashed tracking + use in-game flash-assist logic Jan 24, 2021
@nickdnk
Copy link
Collaborator Author

nickdnk commented Jan 24, 2021

@PhlexPlexico Note the additional fields added.

if (flash_assister > 0)
AddPlayer(params, "flash_assister", flash_assister);
params.SetBool("flash_assist", flash_assist);
}

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 know this is a breaking change, but I don't know how much semantic versioning you normally apply to the event-logger.

@nickdnk
Copy link
Collaborator Author

nickdnk commented Feb 7, 2021

Resolved merge conflicts stemming from merging #613.

@redismx
Copy link
Contributor

redismx commented Apr 6, 2021

@splewis is there something that is preventing this from being merged? I'm really interested in some of these features.

Good job @nickdnk, by the way.

@nickdnk
Copy link
Collaborator Author

nickdnk commented Apr 6, 2021

@splewis is there something that is preventing this from being merged? I'm really interested in some of these features.

Good job @nickdnk, by the way.

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.

@splewis
Copy link
Owner

splewis commented Apr 20, 2021

but it does make changes to both the MySQL tables (and would break for people who copy-pasted the SQL script for their schemas)

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.

@nickdnk
Copy link
Collaborator Author

nickdnk commented Apr 21, 2021

@splewis

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.

@nickdnk
Copy link
Collaborator Author

nickdnk commented Apr 21, 2021

Also, you can close #405 if you merge this.

@nickdnk
Copy link
Collaborator Author

nickdnk commented Apr 28, 2021

Added check to prevent spectators or unteamed players from affecting flash stats: 346dbcd
Edit: Squashed all the commits into one. It was becoming messy.

@stranden
Copy link

stranden commented Aug 6, 2021

@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
@nickdnk
Copy link
Collaborator Author

nickdnk commented Aug 19, 2021

Brought this up to date with master. No conflicts.

@nickdnk
Copy link
Collaborator Author

nickdnk commented Sep 16, 2021

Hey @splewis
Is there something we can do to get this merged? It seems there are a fair amount of good PRs open that are not being handled. Perhaps you should make someone co-maintainer on the project.

@splewis
Copy link
Owner

splewis commented Sep 26, 2021

Perhaps you should make someone co-maintainer on the project.

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:

  • One that just modifies the core get5 plugin to add stats (no backwards compatibility issues)
  • One that affects the addon sqlstats plugin/schema

@splewis splewis merged commit 1886f82 into splewis:master Sep 26, 2021
PhlexPlexico added a commit to PhlexPlexico/get5 that referenced this pull request Dec 16, 2021
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.
PhlexPlexico added a commit to PhlexPlexico/get5 that referenced this pull request Dec 16, 2021
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.
@nickdnk nickdnk deleted the knife_util_dmg branch December 25, 2021 23:46
@nickdnk
Copy link
Collaborator Author

nickdnk commented Dec 27, 2021

Perhaps you should make someone co-maintainer on the project.

I'm very open to volunteers there. (perhaps I should add something to the readme...)

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?

@nickdnk nickdnk self-assigned this Jul 29, 2022
@nickdnk nickdnk added this to the 0.9 milestone Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants