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: 915
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

PlayHistoryTracker Modification - Track kills made by UselessMine

Post by Zehra »

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

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

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 809
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: PlayHistoryTracker Modification - Track kills made by UselessMine

Post by allejo »

Shouldn't this be committed to the plugin in our main repo?
User avatar
Zehra
Private First Class
Private First Class
Posts: 915
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

Re: PlayHistoryTracker Modification - Track kills made by UselessMine

Post by Zehra »

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

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

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
Post Reply