Raised This Month: $12 Target: $400
 3% 

[TF2] Kill log and Web Panel


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Pickles47
Member
Join Date: Jun 2013
Plugin ID:
4324
Plugin Version:
0.10.5
Plugin Category:
Statistical
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Sourcemod Plugin and Panel to track weapons, players, and events.
    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, 713 views)
    File Type: sp Get Plugin or Get Source (klog.sp - 720 views - 43.7 KB)

    Last edited by Pickles47; 01-13-2015 at 10:37.
    Pickles47 is offline
    Pickles47
    Member
    Join Date: Jun 2013
    Old 08-26-2014 , 17:28   Re: Kill log
    Reply With Quote #2

    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.
    Attached Files
    File Type: sp Get Plugin or Get Source (klog_items.sp - 1473 views - 2.6 KB)

    Last edited by Pickles47; 08-31-2014 at 19:38.
    Pickles47 is offline
    dstoler
    Member
    Join Date: Nov 2012
    Old 08-26-2014 , 22:51   Re: [TF2] Kill log and Web Panel
    Reply With Quote #3

    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.

    Last edited by dstoler; 08-26-2014 at 23:39. Reason: added info for troubleshooting
    dstoler is offline
    Pickles47
    Member
    Join Date: Jun 2013
    Old 08-26-2014 , 23:59   Re: [TF2] Kill log and Web Panel
    Reply With Quote #4

    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.

    Last edited by Pickles47; 08-27-2014 at 02:59.
    Pickles47 is offline
    Pickles47
    Member
    Join Date: Jun 2013
    Old 08-27-2014 , 03:57   Re: [TF2] Kill log and Web Panel
    Reply With Quote #5

    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.
    Pickles47 is offline
    dstoler
    Member
    Join Date: Nov 2012
    Old 08-27-2014 , 19:28   Re: [TF2] Kill log and Web Panel
    Reply With Quote #6

    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.

    Last edited by dstoler; 08-27-2014 at 19:50.
    dstoler is offline
    Pickles47
    Member
    Join Date: Jun 2013
    Old 08-28-2014 , 18:21   Re: [TF2] Kill log and Web Panel
    Reply With Quote #7

    Change RegConsoleCmd("sm_rank", to whatever you want.
    Pickles47 is offline
    dstoler
    Member
    Join Date: Nov 2012
    Old 08-28-2014 , 23:02   Re: [TF2] Kill log and Web Panel
    Reply With Quote #8

    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!
    dstoler is offline
    Pickles47
    Member
    Join Date: Jun 2013
    Old 08-28-2014 , 23:34   Re: [TF2] Kill log and Web Panel
    Reply With Quote #9

    Quote:
    Originally Posted by dstoler View Post
    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.
    Pickles47 is offline
    dstoler
    Member
    Join Date: Nov 2012
    Old 08-28-2014 , 23:55   Re: [TF2] Kill log and Web Panel
    Reply With Quote #10

    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.

    Last edited by dstoler; 08-28-2014 at 23:56.
    dstoler is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 18:06.


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