AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Kill log and Web Panel (https://forums.alliedmods.net/showthread.php?t=247043)

Pickles47 08-26-2014 17:28

[TF2] Kill log and Web Panel
 
2 Attachment(s)
TF2 Kill Log

This is an update to, and complete rewrite of, Darthninja's TF2 Stats plugin, fixing the need for plugin updates when new weapons are added, and improving weapon tracking and player tracking. New weapons will only need to be added to the web panel's database, they will still be tracked and viewable.

The web panel is the only interface for players to communicate with the database. MySQL is required, SQLlite is not supported. Using !rank will open a large MOTD window showing the players profile.

CVARs
Code:

klog_extended - 1 Enables / 0 Disables extended log features - Enabled by default
klog_url - Kill Log URL, example: yoursite.com/path/to/folder/ - Must be set to show player !rank
klog_cleanup_killlog - 1 Enables / 0 Disables purging killlog  - Enabled by default
klog_cleanup_playerlog - 1 Enables / 0 Disables purging playerlog & smalllog
klog_cleanup_span - Delete old killlog entries after X amount of weeks  - 8 by default

CHAT COMMANDs
Code:

rank- Opens player's Kill Log profile
Code:

"killlog"
{
    "driver"        "mysql"
    "host"            "HOST"
    "database"    "DATABASE"
    "user"            "USERNAME"
    "pass"            "PASSWORD"
}

Improvements and/or differences over other stats plugins:
  • No points system, possibly added to web panel later but will not be determined by the plugin.
  • Tracks every weapon and customkill per player allowing for individual weapon stats such as killstreak & crits.
  • Tracks objects destroyed, flag events, and control point events.
  • The optional tracking of every kill and it's circumstances (enabled by default).
  • Allow for detailed stats by selected time range, not yet implemented in web panel.

The web panel is in early beta and will be an ongoing project, you may encounter performance issues and CSS issues. Steam API key is needed to retrieve player avatar, once a profile is viewed the avatar is saved.
DEMO HERE

Per weapon statistics and Kill Log player panel require the cvar klog_extended enabled, this allows for detailed analysis, ie. most killed player, most killed BY player, dominations, revenges with weapon etc.

Killlog table can get very big very quickly if it's being filled by multiple, high activity servers, it is advised to use separate databases per server if you expect high activity, more than 60,000 inserts (kills) a day.

Whats next:
Continued improvement to core plugin and panel.
Adding optional add-ons to the plugin and web panel for the tracking of MVM, items, maps.

Credits to:
DarthNinja, database connection and query format.
Dr.McKay, player analytics handling of client connects and disconnects.
Aderic, enum hack for storing player actions until disconnect, map or plugin change and purging of client data.

Download web panel and contribute at github.


Install script for panel is in the works, sql dumps are provided in the panel download folder.

It's been tested extensively for the past two weeks, but changes and updates have been ongoing and some bugs may have slipped through the cracks. This is a learning experience for me so any improvements are welcome.

Changelog:

Code:

0.10.5 - Fix invalid client errors, add convars and database cleaning, add stats.
0.9.3 - Add Updater support, fix rank command.
0.8.3 - Minor improvements and convar changes.
0.8.2 - Fix for players playtime.
0.8.1 - Add update interval every 5 minutes.
      - Add Map logging
0.7.1 - Fix incorrectly recording kills and deaths in playerlog table for suicides.
      - Fix incorrectly recording obj_built and obj_destroy in playerlog table.
      - Revert to SQL_TQuery

0.7.0 - Initial release.


Pickles47 08-26-2014 17:28

Re: Kill log
 
1 Attachment(s)
Addons

Item Logging:
Like other item loggers, this tracks the item_found event, will create a new table called itemlog in your killlog database. Web Panel addon will be available on github.

dstoler 08-26-2014 22:51

Re: [TF2] Kill log and Web Panel
 
No freaking way. Adding this to my server right away! Once finished can be viewed at http://s4lservers.site.nfoservers.com/killlog/index.php

So I opened the .sp and attempted to put in my url on line
Code:

CreateConVar("klog_url","","Kill Log URL, example: http://yoursite.com/stats/",
Mine looks like this:
Code:

CreateConVar("klog_url","http://s4lservers.site.nfoservers.com","Kill Log URL, example:
I do not know anything about coding and not sure if I put it in the right spot. I compiled the .sp on sourcemods webcompiler after entering in my website info into the .sp (edit: now the plugin isnt loading so I am thinking I did something wrong or I should have compiled it with some includes? I may be way off track?? I added the info to my databases.cfg and obviously created the database. I started my server and it said could not find database killlog. So I found the mysql scripts players and weapons in the sql folder and I imported them each into my database and it was successful. I also edited my database info in the include/config.php file just like I have done with other plugins like playerranks and tf2stats in the past.

What am I missing? Do you think you could add a step by step for this? I would like to get it activated right away so I may help you test it out.

Pickles47 08-26-2014 23:59

Re: [TF2] Kill log and Web Panel
 
You do not need to edit the source, you just need to add the cvar to your server.cfg

Using your example and link:
Code:

klog_url        "s4lservers.site.nfoservers.com/killlog/"
You can do it by editing the source but you do not use "http://" and the url must end with a /. Thats my fault for leaving the example like that in the source.

If the plugin cannot connect to your database then your database information is incorrect or you changed the database.cfg and did not restart the server, which I believe is a requirement to update database.cfg. If this is not the case, ensure that your database and or user has remote access.

Pickles47 08-27-2014 03:57

Re: [TF2] Kill log and Web Panel
 
Small update to playerlog table, obj_built, obj_destroy, and tele_player were ordered incorrectly thus the wrong information was being logged. Kills and deaths were being logged instead of just kills to the playerlog table, this has been also been fixed. cvar klog_url example has been changed to reflect the accepted format.

dstoler 08-27-2014 19:28

Re: [TF2] Kill log and Web Panel
 
Ok I made the changes from my previous post, redownloaded the .smx and loaded it and it said connected to database. Using my site as an example, what would the url be? .com/killlog/index.php ?? the reason I ask is because it is not coming up for me when I type that url in. Sorry, I did not realize url's can be case sensitive! For me it is .com/Killlog

I also have a question about database.class.php do I have to enter database info in that as well or just the config.php

since I am a stats junkie, I run the playerranks plugin and was wondering how I could go about changing some of the in-game commands like !rank etc, so that it will not interfere with each other.

Pickles47 08-28-2014 18:21

Re: [TF2] Kill log and Web Panel
 
Change RegConsoleCmd("sm_rank", to whatever you want.

dstoler 08-28-2014 23:02

Re: [TF2] Kill log and Web Panel
 
Thanks Pickles! I do not understand why more people have not tried this out yet? It has such a clean look to it and reminds me of logs.tf the way the web panel looks. I highly enjoy it.

I noticed that when their are players actively playing on my server the "current" tab tends to show one player with all of his kills correctly and others actively on the server with 0 kills. Since I am working so many hours right now I haven't been able to analyze it as well as I would of liked to. Maybe it is just a delay and catches up shortly after? Anyways, looking forward to your progress!

Pickles47 08-28-2014 23:34

Re: [TF2] Kill log and Web Panel
 
Quote:

Originally Posted by dstoler (Post 2191170)
Thanks Pickles! I do not understand why more people have not tried this out yet? It has such a clean look to it and reminds me of logs.tf the way the web panel looks. I highly enjoy it.

I noticed that when their are players actively playing on my server the "current" tab tends to show one player with all of his kills correctly and others actively on the server with 0 kills. Since I am working so many hours right now I haven't been able to analyze it as well as I would of liked to. Maybe it is just a delay and catches up shortly after? Anyways, looking forward to your progress!

Thanks, the problem you are seeing will hopefully be fixed in my next update. It currently only shows who is connected and their total kills, deaths, etc. I will be adding a timer to update the playerlog table to correct the issue, this won't provide stats for the current session and I don't intend to do that. Currently the playerlog table is only filled when a player connects/disconnects, plugin ends or a mapchange.

The next update will provide better map information tracking and the next panel update will too.

dstoler 08-28-2014 23:55

Re: [TF2] Kill log and Web Panel
 
Ok, thanks for addressing that! I am not very good with php and currently trying to customize my web panel just slightly without taking away from the crisp feel you have going on. I would like a custom header so would I just make a header.php in the include folder just as you did with the footer? Sorry, probably not the best place to ask for web design questions, I will stick directly to plugin questions/issues.


All times are GMT -4. The time now is 08:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.