View Single Post
Author Message
Pickles47
Member
Join Date: Jun 2013
Old 08-26-2014 , 17:28   [TF2] Kill log and Web Panel
Reply With Quote #1

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.
Attached Files
File Type: smx klog.smx (19.5 KB, 734 views)
File Type: sp Get Plugin or Get Source (klog.sp - 749 views - 43.7 KB)

Last edited by Pickles47; 01-13-2015 at 10:37.
Pickles47 is offline