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

Feat/watch killrate #794

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Feat/watch killrate #794

wants to merge 6 commits into from

Conversation

cemathey
Copy link
Collaborator

This is a mostly port of ElGuillermo's kill rate plug in but I changed a few things and added some different options.

This uses the stats calculated by CRCON instead of calculating the KPM again (with different math) so they should always be consistent.

I integrated it into the services stuff, it's off by default.

The KPM is adjustable for different weapon categories (everything, armor, artillery and machine guns) so people can adjust as they see fit.

By default it will only report a player once a match to cut down on KPM spam because presumably they only need to be investigated once.

I did not touch the UI so right now it's only configurable through the API.

Otherwise it is pretty straight forward, it pulls stats, checks for people that exceed the KPM threshold who aren't whitelisted in some way and then sleeps for the poll period.


# TODO: move these to a common location and get translations from T17
# sourced from https://gist.github.com/timraay/5634d85eab552b5dfafb9fd61273dc52#playerinfo-player_name
ARTILLERY: dict[str, bool] = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

With the weapons.py file from #797 this could be removed. We should, no matter which one we keep, not have to maintain two different sets of Weapon lists in CRCon 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I very much agree; do you want to approve for now and then I will update once that gets merged?

I have asked T17 (and just bumped the request) to get translations for map names/weapon names for all the versions they've localized for, and once we have those I'd like to add some options to localize that in places where it gets displayed to the user (like chat commands and so on)

Signed-off-by: C. Eric Mathey <48801688+cemathey@users.noreply.github.com>
Copy link
Collaborator

@FlorianSW FlorianSW left a comment

Choose a reason for hiding this comment

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

approved, considering the before-submitted comment is worked on :)

@cemathey
Copy link
Collaborator Author

I forgot to put the reported cache in redis, so the hook to clear it on match start currently does nothing.

@FlorianSW
Copy link
Collaborator

@cemathey this one is finished right? As in: This can be released with the next release?

@cemathey
Copy link
Collaborator Author

@cemathey this one is finished right? As in: This can be released with the next release?

AFAIK nobody has updated the frontend to include it; I realized the other day we're using JSON forms to generate settings pages, so I think it's possible it's simple enough for me to add when I have some time this week if nobody beats me to it

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.

2 participants