Wintrmte Posted April 5, 2002 Share Posted April 5, 2002 I have written a small Perl app that goes throught the JK2 server logs and computes statistics for users. It generates a nice HTML output (which is customizable through a template). I need testers though. I have tested this on my server which is running FFA mode, but have not tested it against any other game mode. SO... If you want to help test, please visit the following link: http://jk2.gamersimpact.com/index.php You can see the output of this analyzer by clicking this link: http://jk2.gamersimpact.com/player-stats.html Thanks. Link to comment Share on other sites More sharing options...
MatrixCPA Posted April 5, 2002 Share Posted April 5, 2002 I've always been one of those "experimental" people. I've got the stats running on my CTF Saber Only server. Obviously, there isn't much weapon data to look at because only MOD_SABER, MOD_FALLING, and MOD_DARK_FORCE...few other miscellaneous things. I'd like to know if the script can tell the difference between falling because you were clumsy (suicide really) and being PUSHED. From what I can tell, the console output is identical...except that the victim name is the same as the killer name when it's just "oops". Also, does the script maintain a database of it's own? Or does it need the full log file? I ask because the script appears to leave the log file intact (which is fine with me) and that would make me believe that it does not maintain any database. Thus, if you reset your log file then you lose all prior data. The only problem with that being once your log starts to get a bit large and you want to archive (or just delete it), you lose all the prior data. Not a big deal, but I was just wondering. Is there any way to determine how much time a player has spent playing? That would make for a good analysis of frag/hour vs deaths/hour, etc. I know that the JO logs items with a timestamp that represents how long the server has been up...perhaps not the most useful. Anyway, if you'd like to get a hold of me to collaborate in any way. I can be reached via icq (74850239), aim (MatrixCPA), or msn messenger/mail (matrixcpa@msn.com). *UPDATE* Yep, I did some grep parsing and figured out that it counts falling to death (suicide) the same as if you pushed someone else. I believe I added just a quick bit to fix that. I'll test it out some more. *UPDATE 2* Ok, I fixed that issue...suicides by any weapon are not counted as anything (for now). I think I'll add a piece to count them as "suicides". Link to comment Share on other sites More sharing options...
Awol Posted April 5, 2002 Share Posted April 5, 2002 BTW if you fall without being pushed a player called <world> kills you by MOD_FALLING. Making my own server stats program as well http://www.puregamer.com and looks for them not hard Link to comment Share on other sites More sharing options...
MatrixCPA Posted April 5, 2002 Share Posted April 5, 2002 Originally posted by Awol BTW if you fall without being pushed a player called <world> kills you by MOD_FALLING. Making my own server stats program as well http://www.puregamer.com and looks for them not hard Oddly, that's not true very often. The vast majority of the time, it's logged as playerx killed playerx by MOD_FALLING. Although, there are a few ways the <world> does end up killing you as well, and MOD_FALLING and MOD_CRUSH are the two I've seen so far. Out of about 1000 MOD_FALLING kills...the world has so far only been responsible for about 5. It would probably be a good idea if we all got together for a "log mapping project". I'm sure it would benefit all of us. Link to comment Share on other sites More sharing options...
gimli_aa Posted April 5, 2002 Share Posted April 5, 2002 Just looking for a simple perl script. I'm slowly teaching myself Perl and all I want is a small list that perhaps has top 10 players and kills... Though the book I have I dont think it shows me how to extract data from a file or safe it back into a file, cause I would also like to use my website to show the total kills on the index.html page *shrug* Any ideas or URL's and stuff or if you wana make me a small script I'd be more than happy to learn from it Link to comment Share on other sites More sharing options...
[UoM]Epidemic Posted April 5, 2002 Share Posted April 5, 2002 You definitely need to lookup filehandles then. That allows you to open files for reading, writing, appending, etc. Then you should look up regular expressions (basically how to pattern match.) That will get you a long way for sure. Link to comment Share on other sites More sharing options...
Morcalivan7 Posted April 5, 2002 Share Posted April 5, 2002 Can someone add hw many times you healed or energized a teammate to that list? Hopefully make the stats similar to Globa Ops' stats. http://206.190.89.62/fstats/index.html Kinda like that with everyone having a stat profile. Link to comment Share on other sites More sharing options...
HellfireSK Posted April 5, 2002 Share Posted April 5, 2002 *edit* I threw your parser up this morning, quite impressive for a first-run at things. It seems to work as intended under CTF with no modifications. A few things I noticed is that it does not properly handle events which contain similar strings. MOD_DISRUPTOR_SNIPER and MOD_DISRUPTOR for example appear to intermingle. I noticed it's trying to pull an "Administrator" variable from somewhere - personally I'd prefer it to be either overridden by the config, or set outright. I already extended the "Padawan" filter slightly to allow for more invisible people, preferably that would be read from a list... Great work, I look forward to the next revisions! -h Link to comment Share on other sites More sharing options...
MatrixCPA Posted April 5, 2002 Share Posted April 5, 2002 Originally posted by Morcalivan7 Can someone add hw many times you healed or energized a teammate to that list? Hopefully make the stats similar to Globa Ops' stats. http://206.190.89.62/fstats/index.html Kinda like that with everyone having a stat profile. Unfortunately, the logging system (like RtCW's) is lacking. The only things that get logged are: Player Connects/Disconnects Playing Info Changes (name/skin/team) Kills/Suicides (what weapon/how/by whom) Item Pickups (what item/by whom) Flag Pick ups/Drops/Scores (by whom/team--but they all get logged the same) Say/Teamsay Round End w/Scores Rcon Commands (just the command, eg rcon exec) Nothing is logged regarding the use of force powers, only kills that result from them. To figure out when a flag is picked up vs. recovered vs. captures takes some work. It's kinda lame that item pickups were more important to log than the differences in flag actions. RtCW is the same way. The pickup of a medpack/ammopack is logged, but not which player provided it. It'll probably take a mod to "fix" that. Link to comment Share on other sites More sharing options...
kleaver Posted April 6, 2002 Share Posted April 6, 2002 I will add to this because I have been looking for a program to log my server and create webstats for it. So far I have not found one that that was easy enough to convert to read the statslog file. Here is some info for you on what was in the file I was using. My servers create 2 seperate log files. I have a question for you on the stats, and why not use the statlog file instead. At the moment I have these log settings in my config file for the server seta g_log "games.log" //Logs connects and pickups seta g_logSync "0" seta g_statLog "1" seta g_statLogFile "statlog.log" // Logs death and kill stats This produces a very large log covering all the types of kills and death on the server ------------------------- Level: ffa_bespin Weapon Pickups per Player: Weapon Shots per Player: Weapon Use Time per Player: Weapon Deaths per Player: Weapon Damage per Player: Weapon Kills per Player: Typed Damage per Player: Damage-Typed Kills per Player: ------------------------------------------ It seems to log for each map that is played so a fresh setting is created on each map restart. It looks like to get the stats for who killed who the two files need to be merged together. Maybe this will hold the information you seek. In windows you need to view the log with wordpad or the formatting is out. In Linux most of the editors show it correctly. This is what is in the statslog file for one map (note will look messed up in post so probably better to check the file yourself) The page would need to be about 5 pages wide to display correctly. I removed the scores and totals that the logs create and just left the headers so you can see what is included in this log file. Level: ffa_bespin Weapon Pickups per Player: Player No Weapon Stun Baton Saber Bryar Pistol Blaster Disruptor Bowcaster Repeater Demp2 Flechette Rocket Launcher Thermal Tripmine Detpack Emplaced gun Turret Weapon Shots per Player: Player No Weapon Stun Baton Saber Bryar Pistol Blaster Disruptor Bowcaster Repeater Demp2 Flechette Rocket Launcher Thermal Tripmine Detpack Emplaced gun Turret Weapon Use Time per Player: Player No Weapon Stun Baton Saber Bryar Pistol Blaster Disruptor Bowcaster Repeater Demp2 Flechette Rocket Launcher Thermal Tripmine Detpack Emplaced gun Turret Weapon Deaths per Player: Player No Weapon Stun Baton Saber Bryar Pistol Blaster Disruptor Bowcaster Repeater Demp2 Flechette Rocket Launcher Thermal Tripmine Detpack Emplaced gun Turret Weapon Damage per Player: Player No Weapon Stun Baton Saber Bryar Pistol Blaster Disruptor Bowcaster Repeater Demp2 Flechette Rocket Launcher Thermal Tripmine Detpack Emplaced gun Turret Weapon Kills per Player: Player No Weapon Stun Baton Saber Bryar Pistol Blaster Disruptor Bowcaster Repeater Demp2 Flechette Rocket Launcher Thermal Tripmine Detpack Emplaced gun Turret Typed Damage per Player: Player MOD_UNKNOWN MOD_STUN_BATON MOD_MELEE MOD_SABER MOD_BRYAR_PISTOL MOD_BRYAR_PISTOL_ALT MOD_BLASTER MOD_DISRUPTOR MOD_DISRUPTOR_SPLASH MOD_DISRUPTOR_SNIPER MOD_BOWCASTER MOD_REPEATER MOD_REPEATER_ALT MOD_REPEATER_ALT_SPLASH MOD_DEMP2 MOD_DEMP2_ALT MOD_FLECHETTE MOD_FLECHETTE_ALT_SPLASH MOD_ROCKET MOD_ROCKET_SPLASH MOD_ROCKET_HOMING MOD_ROCKET_HOMING_SPLASH MOD_THERMAL MOD_THERMAL_SPLASH MOD_TRIP_MINE_SPLASH MOD_TIMED_MINE_SPLASH MOD_DET_PACK_SPLASH MOD_FORCE_DARK MOD_SENTRY MOD_WATER MOD_SLIME MOD_LAVA MOD_CRUSH MOD_TELEFRAG MOD_FALLING MOD_SUICIDE MOD_TARGET_LASER MOD_TRIGGER_HURT Damage-Typed Kills per Player: Player MOD_UNKNOWN MOD_STUN_BATON MOD_MELEE MOD_SABER MOD_BRYAR_PISTOL MOD_BRYAR_PISTOL_ALT MOD_BLASTER MOD_DISRUPTOR MOD_DISRUPTOR_SPLASH MOD_DISRUPTOR_SNIPER MOD_BOWCASTER MOD_REPEATER MOD_REPEATER_ALT MOD_REPEATER_ALT_SPLASH MOD_DEMP2 MOD_DEMP2_ALT MOD_FLECHETTE MOD_FLECHETTE_ALT_SPLASH MOD_ROCKET MOD_ROCKET_SPLASH MOD_ROCKET_HOMING MOD_ROCKET_HOMING_SPLASH MOD_THERMAL MOD_THERMAL_SPLASH MOD_TRIP_MINE_SPLASH MOD_TIMED_MINE_SPLASH MOD_DET_PACK_SPLASH MOD_FORCE_DARK MOD_SENTRY MOD_WATER MOD_SLIME MOD_LAVA MOD_CRUSH MOD_TELEFRAG MOD_FALLING MOD_SUICIDE MOD_TARGET_LASER MOD_TRIGGER_HURT Link to comment Share on other sites More sharing options...
Hulceantor Posted April 6, 2002 Share Posted April 6, 2002 It is working great for me thanks a bunch!! I also emailed you! http://hulce.servehttp.com/jedi/player-stats.html Hulceantor http://www.clanomni.net Link to comment Share on other sites More sharing options...
Awol Posted April 6, 2002 Share Posted April 6, 2002 Originally posted by MatrixCPA Oddly, that's not true very often. The vast majority of the time, it's logged as playerx killed playerx by MOD_FALLING. Although, there are a few ways the <world> does end up killing you as well, and MOD_FALLING and MOD_CRUSH are the two I've seen so far. Out of about 1000 MOD_FALLING kills...the world has so far only been responsible for about 5. It would probably be a good idea if we all got together for a "log mapping project". I'm sure it would benefit all of us. <world> only kills you if you run off a cliff and fall if there is a player and it was done by MOD_FALLING its means they pushed you off or use grip and moved you over a pit. Agreed we should work together on this, lots of things I'm still trying to figure out Originally posted by kleaver Here is some info for you on what was in the file I was using. My servers create 2 seperate log files. I have a question for you on the stats, and why not use the statlog file instead. At the moment I have these log settings in my config file for the server seta g_log "games.log" //Logs connects and pickups seta g_logSync "0" seta g_statLog "1" seta g_statLogFile "statlog.log" // Logs death and kill stats This produces a very large log covering all the types of kills and death on the server ------------------------- Level: ffa_bespin Weapon Pickups per Player: Weapon Shots per Player: Weapon Use Time per Player: Weapon Deaths per Player: Weapon Damage per Player: Weapon Kills per Player: Typed Damage per Player: Damage-Typed Kills per Player: ------------------------------------------ Actually I am working using this file as well I don't have much still trying to figure all the information. Also the only problem with the statslog is it doesn't tell you how killed who. Which I plan to add so you and look up detail stats on players. Awol Link to comment Share on other sites More sharing options...
MatrixCPA Posted April 6, 2002 Share Posted April 6, 2002 Actually, 99% of the time if you fall off a ledge on your own...it says: playername killed playername by MOD_FALLING Believe me, I could grep my log right now and put it up somewhere and you'd see 1000's of suicides by falling listed that way while only a very few instances of the world being involved. Seeing that I run ctf_ns_streets in my rotation, I'm sure you know just how often players manage to "oops" there. Get a old of me via ICQ (74850239), AIM (MatrixCPA), or MSN Messenger/Email (matrixcpa@yahoo.com). Link to comment Share on other sites More sharing options...
Leo Posted April 6, 2002 Share Posted April 6, 2002 Good job Wintrmte, it works fine for me also. Could you please tell me where to input my email in the script. I don't want to mess it up. Link to comment Share on other sites More sharing options...
rivmin Posted April 6, 2002 Share Posted April 6, 2002 Good work, Wintrmte My output is here: http://uv.orangenet.dk One thing I really would love to request.....is a day/week/month page, to show connections/games/kills pr hour/daily/weekly. /riv Link to comment Share on other sites More sharing options...
dave77034 Posted April 7, 2002 Share Posted April 7, 2002 Bump Great work... Thanks Link to comment Share on other sites More sharing options...
Generique Fin Posted April 7, 2002 Share Posted April 7, 2002 http://www.ownclan.com/ This clan has succesfully started using this program. Their server is really good. Link to comment Share on other sites More sharing options...
pcmacman Posted April 7, 2002 Share Posted April 7, 2002 Seems to be working for me too, thanks stompbox.dhs.org private server Link to comment Share on other sites More sharing options...
gimli_aa Posted April 7, 2002 Share Posted April 7, 2002 Ok I downloaded and put the script into the cgi-bin of the webserver im running. In the log file I get this error msg: [sat Apr 6 22:56:47 2002] [error] [client 127.0.0.1] Premature end of script headers: /var/www/cgi-bin/logparse.pl The only lines in the whole script I changed were: #!/usr/bin/perl ... my $LOGFILE = "/home/anubis/.jkii/base/logs/jedi-ctf.log"; # This is the JK2 Logfile location my $OUTPUTDIR = "/var/www/html"; # This is your web output directory my $STYLESHEET = "/home/anubis/stats.css"; # This is your Stylesheet location inside the OUTPUTDIR my %TEMPLATE = ( "TEMPLATE1" => "/home/anubis/main-stats.html", ); my $TOPNUM = 10; # Number of players to display and keep stats The log file is in the home directory. The .pl script is in the main webserver directory (cgi-bin) and the casscade stylesheet file is in the home directory too.. Well in the spots that the above URLs show anyway. The file also has 755 attached to it and stuff.. all my other cgi scripts work.. just I cant get this one to work. Anyone have any ideas? I'm re-teaching myself perl and my next self lession is to go over the script and learn how to pull off the infomation I want. All i want is the servers top 10 kills by player and stuff.. nothing more nothing less =) Thanx for info!! **Added by User ** Curious, how would I get an html document to reload a cgi file every so often so that I updates itself? Or do I have to do it myself? by going to my cgi-bin file and running the script? Also many thanx to Wintrmte and the rest who have posted bout the server stats script I am learning more, and was able to make a small stat file with the kills and total kills on my server! Link to comment Share on other sites More sharing options...
rivmin Posted April 7, 2002 Share Posted April 7, 2002 Hi. A small thing...how do I get the admin-name and e-mail to show on the stat-page ? I have this in my cfg [running FreeBSD]: seta sv_hostname "^1WarGames ^3#1" seta g_motd "Welcome to WarGames JK II #1 - Stats at http://uv.orangenet.dk" seta Administrator "UltraViking][Rivmin" seta adminEmail "rivmin@ultraviking.dk" seta url "We fart in your general direction" seta Location "Denmark Thnx ./riv Link to comment Share on other sites More sharing options...
jediknightii.de Posted April 7, 2002 Share Posted April 7, 2002 ...I can't get my log-files to work on my linux-server - the server just don't writes anything to the log-files. any help would be appreciated. REMARK: Got it! the server put it in the home-directory of the user... sorry. Link to comment Share on other sites More sharing options...
dave77034 Posted April 7, 2002 Share Posted April 7, 2002 Originally posted by gimli_aa Ok I downloaded and put the script into the cgi-bin of the webserver im running. ... In the log file I get this error msg: [sat Apr 6 22:56:47 2002] [error] [client 127.0.0.1] Premature end of script headers: /var/www/cgi-bin/logparse.pl my $OUTPUTDIR = "/var/www/html"; #... You're trying to execute logparse.pl as if it were a perl cgi script. This script was meant to be run periodically and its html output is what you want to link to... I think what you want to do is set up a cron job to execute the script ever so often. Then load player-stats.html to see the update. Also, this line my $OUTPUTDIR = "/var/www/html"; # This is your web output directory should read my $OUTPUTDIR = "/var/www/html/"; # This is your web output directory Hope this helps... Link to comment Share on other sites More sharing options...
Solarian Posted April 7, 2002 Share Posted April 7, 2002 Just a thought here, but, what happens if a player is actually called 'world' ... how does the game interpret this, and also, does the script log them as the same 'players' ? Link to comment Share on other sites More sharing options...
rivmin Posted April 7, 2002 Share Posted April 7, 2002 Originally posted by dave77034 ... Also, this line 'my $OUTPUTDIR = "/var/www/html";' should read 'my $OUTPUTDIR = "/var/www/html/";' Dont think so...there should not be a / at the end of the path....mine doesnt and it works. ./riv Link to comment Share on other sites More sharing options...
Wintrmte Posted April 7, 2002 Author Share Posted April 7, 2002 Wow, you guys are awesome. I've gotten a lot of feedback and the new script should be available later today. Here are the new features that the script will include: Fixes: * My pattern matching was a little bit off, therefore it was mixing weapons of like types. Weapons like MOD_DISRUPTOR and MOD_DISRUPTOR_SNIPER were getting mixed in together. * The script will keep historical data on all the players. So, if you start with a fresh logfile, the script will have retained your old player stats. * The script will also allow you to set the Administrator & Email settings using two variables in the script. * Added a file that contains nicknames of players in which you do NOT want to keep statistics for. * Added command line directives. You can now set the same configuration variables that are used in the script by command line. The command line options are: -logfile <path & file> = Directory and Filename of the logfile that this script will process (overrides the $LOGFILE setting) -stylesheet <path & file> = HTTP Relative directory and filename of the stylesheet to use. This is relative to your http://www.server.com path (i.e. specify /stylesheet/stats.css) (overrides the $STYLESHEET setting) -filter <path & file> = Directory and Filename of the player filter file. This file contains the player nicknames that the script should NOT keep stats for. -htmldir <path> = Directory in which it will store the HTML Files (overrides $OUTPUTDIR) -datadir <path> = Directory in which to store the player datafile(s) (overrides $DATADIR) -template <file & path> = Path and Filename of the template file to use. (overrides the TEMPLATE1 setting) -numplayers <number> = Number of players to keep statistics for (overrides $TOPNUM setting) -reinit = Reinitialize the player statistics file (resets this file) -h = Displays a nice help screen * Lastly, the script will now create individual player statistics! The nicknames on the Top ### Jedi Masters list are clickable. Clicking a name will give you detailed statistics for that user. Thank you everyone who suggested these features. Look for the script later today. (I'll post it here, and on the sites homepage http://jk2.gamersimpact.com Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.