PlayHistoryTracker Modification - Track kills made by UselessMine

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
Zehra
Private First Class
Private First Class
Posts: 662
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic

PlayHistoryTracker Modification - Track kills made by UselessMine

Post by Zehra » Sun May 03, 2020 6:33 pm

Some people have run quite a few custom flag plug-ins which use world weapons/server shots to kill players, but this leads to where they are not attributed/tracked by PlayHistoryTracker, so this simply modification allows server shots made on the behalf of a player, to be attributed to them.

The requirements are BZFS version of 2.4.20 or above:

So, here is the modification:
Find this section of code:

Code: Select all

        Register(bz_ePlayerDieEvent);
And replace it with:

Code: Select all

        Register(bz_ePlayerDeathFinalizedEvent);
Move on to this section:

Code: Select all

    case bz_ePlayerDieEvent:
    {
        bz_PlayerDieEventData_V1 *deathRecord = (bz_PlayerDieEventData_V1*)eventData;
Modify it to look like this:

Code: Select all

    case bz_ePlayerDeathFinalizedEvent:
    {
        bz_PlayerDieEventData_V2* deathRecord = (bz_PlayerDieEventData_V2*)eventData;
And that's it, the modification is completed.

If for whatever reason, this does not run, let me know.
There also is one issue in where playHistoryTracker does not run at all.
See the following thread for some insights: playHistoryTracker Seems to be Broken

-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

Note: Plug-in developing and requests currently on hold due to technical issues until further notice.

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 770
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: PlayHistoryTracker Modification - Track kills made by UselessMine

Post by allejo » Sat May 16, 2020 11:56 pm

Shouldn't this be committed to the plugin in our main repo?
Here's my personal website and my open source projects are available on GitHub; I work on a lot of cool things.

Image

User avatar
Zehra
Private First Class
Private First Class
Posts: 662
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic

Re: PlayHistoryTracker Modification - Track kills made by UselessMine

Post by Zehra » Wed May 20, 2020 2:20 am

Perhaps, although server owners may wish to only track kills actually made by players and not kills made on their behalf. (This could be a useful addition to the plug-in, if made an option.)

Additionally, if anyone wishes to integrate this and/or submit it, feel free to do so, as the plug-in modification is released without any restrictions, as it is released into the public domain.

-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

Note: Plug-in developing and requests currently on hold due to technical issues until further notice.

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Post Reply