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.

Pickles47 08-28-2014 23:59

Re: [TF2] Kill log and Web Panel
 
The head and navbar are contained in inc/nav.php, edit that. For what you want, you may just need to edit within jumbotron class.

Pickles47 08-29-2014 22:09

Re: [TF2] Kill log and Web Panel
 
Updated to improve map logging and update timer for players and maps.

dstoler 08-30-2014 14:28

Re: [TF2] Kill log and Web Panel
 
I downloaded the latest plugin mentioned above this post and I installed it. I then restarted the server and it has been going all day but I do not see any map information. Do I need to do something else to get this to track map stats (or whatever it is supposed to do?)

I really feel this is easily the best stats plugin for server owners. I uninstalled my other stats plugin due to the fact this one covers everything I need and then some. I hope you can stay motivated to keep improving/adding things.

Pickles: How may I go about sending you a donation for your hard work. Just a little something to say thanks.

Pickles47 08-31-2014 19:42

Re: [TF2] Kill log and Web Panel
 
I appreciate the kind words, if you wish to donate you can send me PM and I will provide details on how you can go about that.

I have updated the plugin with minor improvements and added an optional addon that will track items found. Web panel pages for this are in development. Player profile will show items similar to how weapons are currently shown, a new items page will be added with overall items info. Like the plugin, these pages will be optional.

dstoler 09-01-2014 23:17

Re: [TF2] Kill log and Web Panel
 
I got the klog_items plugin added to my server/site. I dont think the database is tracking item finds/crafts etc. I was on my server and purposely crafted some things and 30 minutes later they are not there and there were also things found and it is still empty on the server. I checked out your demo as well and saw that it too is empty. This could be from nobody on since you installed it too but just pointing it out. Thanks again

Pickles47 09-02-2014 00:13

Re: [TF2] Kill log and Web Panel
 
I don't currently have klog_items loaded on that server. I do have it loaded on my test server and it is working correctly, check that you have itemlogs table in your database and if it is being populated. You can also check your error logs and see if there are any sql errors or if it is failing to connect to your database.

Pickles47 09-03-2014 02:31

Re: [TF2] Kill log and Web Panel
 
I added updater support and fixed an issue with the say commands.

Pickles47 09-11-2014 19:48

Re: [TF2] Kill log and Web Panel
 
The web panel has been updated. New version fixes css issues, scaling issues, adds new tabs to player profile and provides daily/weekly/monthly top 10 players.

markg 09-12-2014 15:44

Re: [TF2] Kill log and Web Panel
 
I installed the plugins (klog 0.9.3 and klog_items 1.0) and the web pages (downloaded zip file today). they are connecting fine, and data is flowing.

Three issues:

The weapons and kill streak tabs don't work, saying that table killlog.weapons doesn't exist. When I checked the sql db, they are right. but a killlog.weapon (without the s) does exist. typo somewhere?

The items tab doesn't work, saying that table killlog.item doesn't exist. In this case they are correct, there is no killlog.item column entry.

There is no Top 10 tab.

Any ideas? I grabbed the latest zip file, but perhaps don't have the latest materials?

Pickles47 09-12-2014 16:01

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

Originally Posted by markg (Post 2197679)
I installed the plugins (klog 0.9.3 and klog_items 1.0) and the web pages (downloaded zip file today). they are connecting fine, and data is flowing.

Three issues:

The weapons and kill streak tabs don't work, saying that table killlog.weapons doesn't exist. When I checked the sql db, they are right. but a killlog.weapon (without the s) does exist. typo somewhere?

The items tab doesn't work, saying that table killlog.item doesn't exist. In this case they are correct, there is no killlog.item column entry.

There is no Top 10 tab.

Any ideas? I grabbed the latest zip file, but perhaps don't have the latest materials?

`weapons` is the correct tablename. I'm not certain what is causing that issue but the included weapons.sql is correct and the corresponding queries are also correct, pointing to `weapons`. You can rename the table to `weapons` or drop the table and re-import weapons.sql.

There are `itemlog`, which is populated by klog_items and `items` which is also an included mysql file. There seems to be an error in the ITEM_PAGES addon where the sql is not correct, using the one in the main panel will fix it.

The missing Top 10 page is an error caused by using the ITEMS_PAGES nav.php being outdated. I will correct this on git now.

*I have corrected these issues on git. The particular files you would need are panel_addons/ITEMS_PAGES/inc/nav.php and items.sql in the sql directory. Ensure that you import the .sql files: items, weapons, and profiles.
* Also noticed an issue with not being able to view weapon info on weapons page, this is now fixed on git.

markg 09-12-2014 16:44

Re: [TF2] Kill log and Web Panel
 
1 Attachment(s)
that fixed most of it, thanks!

the only issue I have now is the items tab, which at least is there!
I am getting some missing items (png attached).
I had imported the items/weapons/profiles sql files.
my first thought was that I needed to also import the items sql file that comes with the panel addons, but when I tried to do that I received an error.

I suspect it might be best to drop the table and start over, but im not sure if I need to import both items sql files or just the one? I need some help here. I don't think its the table but who knows.

mark

Pickles47 09-12-2014 17:01

Re: [TF2] Kill log and Web Panel
 
Missing images, images should be in your image folder like FOLDER/images/items/weapon_name.png. It's possible that when you extracted them they ended up like items/items/weapon.png. You only import items.sql once, the sql file in the main panel should not be there and will be removed from git.

While testing I discovered a few small problems, weapons.php and css/stats.css have been adjusted and are on git.

markg 09-12-2014 17:24

Re: [TF2] Kill log and Web Panel
 
thanks for the quick response!

i didn't notice that the items folder had all the png files zipped up, so that fixed it!

note; there are still a few missing icons, but i figure they were just not completed yet (tipped lid and tide turner so far)

we are now up and running, so i will let you know if i find anything else acting up, but so far so good!

mark

markg 09-13-2014 14:26

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

in the items tab, when you look at a item, there is a method column - mostly they are 'crafted', 'found' or 'traded' but every so often I get a -1, or 19 which isn't right.

otherwise things so far are great!!

Pickles47 09-14-2014 20:41

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

Originally Posted by markg (Post 2198140)
Issue:

in the items tab, when you look at a item, there is a method column - mostly they are 'crafted', 'found' or 'traded' but every so often I get a -1, or 19 which isn't right.

otherwise things so far are great!!

I've made some major changes to the items page, images are no longer required, instead they are pulled from the steamcommunity. Also added every weapon. Old `items` table needs to be truncated or dropped and the new items.sql can then be imported. images/items/ can be deleted. I have also fixed items overflowing the body container.

Jammy 09-27-2014 12:57

Re: [TF2] Kill log and Web Panel
 
I'm getting a blank white page while loading the stats page. I am using the files available on the GitHub repo and not from this thread. Looking at my /apache2/error.log I'm getting this spammed:

Code:

PHP Fatal error:  Call to a member function prepare() on a non-object in /var/www/stats/inc/database.class.php on line 32
PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'stats.playerlog' doesn't exist' in /var/www/stats/inc/database.class.php:55\nStack trace:\n#0 /var/www/stats/inc/database.class.php(55): PDOStatement->execute()\n#1 /var/www/stats/inc/database.class.php(59): Database->execute()\n#2 /var/www/stats/index.php(13): Database->resultset()\n#3 {main}\n  thrown in /var/www/stats/inc/database.class.php on line 55

My database is named "stats" and I imported the sql files to it.
Code:

+-----------------+
| Tables_in_stats |
+-----------------+
| profiles        |
| weapons        |
+-----------------+
2 rows in set (0.00 sec)

Would appreciate a fix if possible :)

Pickles47 09-27-2014 16:54

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

Originally Posted by Jammy (Post 2204324)
I'm getting a blank white page while loading the stats page. I am using the files available on the GitHub repo and not from this thread. Looking at my /apache2/error.log I'm getting this spammed:

Code:

PHP Fatal error:  Call to a member function prepare() on a non-object in /var/www/stats/inc/database.class.php on line 32
PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'stats.playerlog' doesn't exist' in /var/www/stats/inc/database.class.php:55\nStack trace:\n#0 /var/www/stats/inc/database.class.php(55): PDOStatement->execute()\n#1 /var/www/stats/inc/database.class.php(59): Database->execute()\n#2 /var/www/stats/index.php(13): Database->resultset()\n#3 {main}\n  thrown in /var/www/stats/inc/database.class.php on line 55

My database is named "stats" and I imported the sql files to it.
Code:

+-----------------+
| Tables_in_stats |
+-----------------+
| profiles        |
| weapons        |
+-----------------+
2 rows in set (0.00 sec)

Would appreciate a fix if possible :)

The tables not provided in sql are created and populated by the plugin so if the plugin was not able to connect to your database, those tables won't exist. With this error all I can say is to make sure that inc/config.php has the correct database information as well as your database config in sourcemod folder, then try changing map/restarting server.

Jammy 09-27-2014 17:00

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

Originally Posted by Pickles47 (Post 2204416)
The tables not provided in sql are created and populated by the plugin so if the plugin was not able to connect to your database, those tables won't exist. With this error all I can say is to make sure that inc/config.php has the correct database information as well as your database config in sourcemod folder, then try changing map/restarting server.

-snip-

I'm using ip address now instead of localhost. Appears to have been my issue. Thanks

braak0327 09-29-2014 01:55

Re: [TF2] Kill log and Web Panel
 
clearly awesome webpanel and features

if this 'feature and webpanel + player analytics' it will be the best plugin in this planet

Jammy 10-05-2014 10:11

Re: [TF2] Kill log and Web Panel
 
It seems that unicode chars in players names are blank from the webpanel. Any chance for a fix?

Pickles47 10-09-2014 18:34

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

Originally Posted by Jammy (Post 2207430)
It seems that unicode chars in players names are blank from the webpanel. Any chance for a fix?

Check playerlog table in your database and see if the plugin is correctly adding unicode chars.

King Cnut 10-11-2014 19:15

Re: [TF2] Kill log and Web Panel
 
I've noticed a typo in the Player Stats.

Code:

Total Plytime
:)

Edit: and to build on the point that unicode names are being displayed as blank on the webpage. I can confirm this. The unicode chars are being stored correctly in the database but are not displaying correctly on the webpage.

markg 10-13-2014 02:10

Re: [TF2] Kill log and Web Panel
 
Thanks for doing this plugin. It has been a nice addition.

Everything seems to work fine, but I started getting a ton of errors

Spoiler


any ideas?

Sarabveer 10-19-2014 02:23

Re: [TF2] Kill log and Web Panel
 
How would you transfer stats from DahNinja's plugin?

Pickles47 10-19-2014 06:53

Re: [TF2] Kill log and Web Panel
 
You can't. Currently there is no way to do that since TF2_Stats saves everything in a single row, this creates entries per weapon for each player, removing the need for weapons to be manually added to the plugin and allowing for greater detail tracking for each weapon. It would be possible to create a script that could do so, but you would still be missing information such as death, killstreak, custom kill, and crit count. Weapon entries in `smalllog` use the default weaponlogname.

King Cnut 10-30-2014 18:48

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

L 10/29/2014 - 20:03:06: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 10/29/2014 - 20:03:06: [SM] Displaying call stack trace for plugin "klog.smx":
L 10/29/2014 - 20:03:06: [SM]  [0]  Line 561, C:\sourcemod\scripting\klog.sp::Event_teamplay_flag_event()

Please fix.

Pickles47 10-31-2014 19:18

Re: [TF2] Kill log and Web Panel
 
I've added spells to the actions page and then new halloween items to git, run the sql in ITEMS_Pages/sql.

Code:

L 10/29/2014 - 20:03:06: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 10/29/2014 - 20:03:06: [SM] Displaying call stack trace for plugin "klog.smx":
L 10/29/2014 - 20:03:06: [SM]  [0]  Line 561, C:\sourcemod\scripting\klog.sp::Event_teamplay_flag_event()

I will look into these errors and update soon.

dave_with_beer_bottle 11-01-2014 14:18

Re: [TF2] Kill log and Web Panel
 
any chance you could add future that would track players and the time they have spent on servers per week and would reset every week (like sunday to sunday),
like another stat to the existing ones,
idk how others ,but would like to see this,
it would be really easy to choose "player of the week" this way
thanks for reading

King Cnut 11-01-2014 20:41

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

Originally Posted by Pickles47 (Post 2218580)
I've added spells to the actions page and then new halloween items to git, run the sql in ITEMS_Pages/sql.

Code:

L 10/29/2014 - 20:03:06: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 10/29/2014 - 20:03:06: [SM] Displaying call stack trace for plugin "klog.smx":
L 10/29/2014 - 20:03:06: [SM]  [0]  Line 561, C:\sourcemod\scripting\klog.sp::Event_teamplay_flag_event()

I will look into these errors and update soon.

Code:

ERROR 1068 (42000) at line 2514: Multiple primary key defined
Getting this error when attempting to import your items.sql into the database.

Pickles47 11-01-2014 21:30

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

Originally Posted by King Cnut (Post 2218971)
Code:

ERROR 1068 (42000) at line 2514: Multiple primary key defined
Getting this error when attempting to import your items.sql into the database.

Should be fixed now.

Added Necro-Smasher and Nostromo Napalmer killicons and info in weapons.sql


All times are GMT -4. The time now is 20:11.

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