( search forums )
SX4 - Soldat Server Stats Script - ver. 1.4.0.0
Soldat Forums - Soldat Fans - Fan Apps
mar77a
February 20, 2005, 3:48 am
History
--------------

12/13/05: Version 1.4.0.0 out.

10/03/05: (almost) Completely reliable version 1.3 released. Hope someone can test this.

10/02/05: Added Console Log Parsing for INF, CTF & HTF.

10/02/05: Released stable versions 1000, 1100, 1101, 1102. Enjoy.

9/26/05: Im starting to work on this again. Expect more features to come, more speed and a demo of this.

EDIT: Demo added. New version out.

3/17/05: Another release. Lost of bugs fixed, speed increase a bit.

2/5/05: Second release 0.7.5. Code hugely optimized.

2/5/05: First public release. Thanks a lot to FliesLikeABrick for the help at testing/programming.

2/4/05: Im preparing the code for the first release...cleaning up stuff and optimizing...

README:

Intro
Ok, I made a PHP Script, SX4. The objetive is the same as U13sss, but Text-Based, no MySQL Database needed. But as my programming skills are very basic, the features include are few:

Requirements
* Webserver with PHP
* Soldat Server with Kill-Logs

Installing
* Get a webserver with PHP or run yours. I recommend the first one, cause it's easier: try at http://www.freepgs.com or try googling.
* Unzip all the files in the desired directory.
* Configure config.php
* If you are running on a linux server, you have to chmod to 0777 the hole directory.
* Run install.php

To update the stats run statsupdate.php . To display the stats, you will have to use include(). Eg. To show player stats write:

<? include('playerstats.php'); ?>

Demo

* Generated image.

[IMAGE]

* Top 10's -> http://mar77a.llsc.us/sx4/top10.php

Updates to version 1.4.0.0

* Joined some files together.
* New encoding system and storing for players.
* Script is 100% faster.
* Database is now smaller in files and more organized.
* Fixed all ranking issues.
* Fixed image activating issues.
* Fixed search engine.
* Fixed all the html encoding on players missing in some parts.
* Improved compatibility with CTF, HTF and INF.

Updates to version 1.3.0.0

* Added completedb.php
* New DB handling with all players stored and noone ignored.
* Improved speed a bit.
* Improved stats updating engine.
* Fixed weaponstats.php ranking bugs.
* Fixed general ranking issues.

Updates to version 1.2.0.0

* Fixed searching bugs.
* Added INF, CTF & HTF support.
* Added statsupdate.php
* Added some more options.
* Fixed playerstats.php bug
* Added rankpoints.php, rankgrabs.php, rankreturns.php, etc.
* Wow.

Updates to version 1.1.0.2

* Added case sensitive search option.
* Fixed some search problems.

Updates to version 1.1.0.1

* All nicknames are stored now. :)
* Fixed: muted some ranking "Warning" errors (Division by zero).


Updates to version 1.1.0.0

* Fixed Ranking by KD bugs again.
* Added rankkills.php & rankdeaths.php
* Fixed minor bugs.

Updates to version 1.0.0.0

* Faster engine.
* Better nickname control.
* Improved storing system.
* More flexible HTML for customization.
* Fixed Rankaing by KD bugs.
* Added search engine actually working.
* Improved engine on soldat.ini.
* Fixed form "action" bugs.
* Fixed hole install thingo.
* Improved admin interface.

First public beta
* Supports Gamemodes: Deathmatch, Pointmatch, Teammatch & Rambomatch.
* Playerstats: Kills, Deaths, K:D.
* Weaponstats: Kills, Most used Weapons.
* Serverstats: Lastupdated, Total Kills, Stats Since, Total Players.
* Generated stats IMG
* Player ranking based on K:D

Still to do

* Nothing.

Download

* V 1.4.0.0

Please post Suggestions/Ideas/Improvements/Bugs.

bbqchips
February 20, 2005, 6:02 am
I think a project like this would be better suited as a stand-alone application. It could be scheduled to run automatically every day or so to parse log files, outputting static HTML.

There is a free VB.NET/C# IDE called SharpDevelop available here: http://www.icsharpcode.net/opensource/sd/ . It is very easy for beginners to learn (drag and drop GUI, code completion) and there are lots of VB.NET source code samples floating around the internet.

blackdevil0742
February 20, 2005, 10:43 am
Maybe you can make a detalied tutorial how to use the script.

mar77a
March 5, 2005, 2:15 am
I will.

AWH_ReApEr
March 14, 2005, 1:45 am
I'd love to use this, but can't figure out how to make it work. =S

I ran install.php and got a blank page. So I checked the directory and there were a few new things:

-images (empty)
-stats
--logs (empty)
--players (empty)
--weapons (empty)
-error_log

Did I do something wrong?

FliesLikeABrick
March 14, 2005, 2:50 am
install.php might take a bit to run. are you sure you let it finish loading?

AWH_ReApEr
March 14, 2005, 7:56 am
Yep, it finished loading...3 times. =S

Yukwunhang
March 14, 2005, 4:57 pm
Lemme try dis one..

mar77a
March 14, 2005, 9:03 pm
Reaper, add me to MSN please @ jmartty@hotmail.com

AWH_ReApEr
March 15, 2005, 7:23 am
I did, but have yet to see you on it. =D

Your stats in collaboration with the new SARJ could be quite... harmonious. ;)

mar77a
March 15, 2005, 8:56 pm
Ok, just try chmoding the DIR/FILES (where the install.php is) to 777.

AWH_ReApEr
March 15, 2005, 11:56 pm
Will do. I'll let you know whether or not it works out fine.

[EDIT]
Now I get an Internal Server Error. >.<
[/EDIT]

mar77a
March 16, 2005, 2:35 am
Weird, well, i'll post the files here for you instead of the install.php.

Edit: Here

AWH_ReApEr
March 16, 2005, 4:34 am
Mkay, now I have everything, but no clue what I'm doing with it all. -_-"

mar77a
March 16, 2005, 8:28 pm
Do you know/have PHP in your webserver?

FliesLikeABrick
March 16, 2005, 9:19 pm
yes he does, i believe he was using my scripts for a while

AWH_ReApEr
March 16, 2005, 11:24 pm
Yes, I have PHP. I was going to use yours, FliesLikeABrick, but I changed the server to TDM.

While it is installed on my webserver, I know little to nothing about it. >.<

I wouldn't worry too much about it. I may be changing the server to CTF again for SCTFL.

Deleted User
July 20, 2005, 12:39 pm
http://dyn.u13.net:6080/host/arg/newsx4/sx4.zip
Link down.

rabidhamster
July 20, 2005, 6:00 pm
i like it a lot, but it would be better as a stand-alone app.

FliesLikeABrick
July 21, 2005, 4:14 am
http://sx4.u13.net


http://ww2.u13.net/host/arg/newsx4/sx4.zip
link fixed here, the file has moved

Deleted User
July 21, 2005, 4:45 am
Thanks flies!

Deleted User
July 24, 2005, 4:21 am
Would anybody be willing to help me set up stats for my server with this?

mar77a
July 24, 2005, 2:59 pm
Yeah, me add me on MSN jmartty@hotmail.com ...

Deleted User
September 6, 2005, 5:16 pm
Is this project completely dead? If not, I'm looking forward to the next release and the GUIDE because I'm having difficulties getting this to work...

mar77a
September 6, 2005, 9:35 pm
Well, it is a bit dead, im sorry. If you need help, contact me on MSN.

EDIT: Im planning to get back to work on this again. Just for the moment, I fixed the download link and added a demo version.

PureGrain
October 12, 2005, 1:18 am
I like this script. Very easy to use.

Therier
November 22, 2005, 6:46 pm
will this working on with webhotel? or must it be on own computer with apache or something?

nfsjunkie91
December 16, 2005, 3:17 am
I'm having some problems... it keeps looking for lognum.txt when installing, and a bunch of other .txt files, but it doesn't create them/ tell me to put them where they are uspposed to go... what should i do about this?

Mar77a has used antoher host for this *yay* because mine sucked. hard. But i really do like the way he is going with the Population Control Clan Stats site.

mar77a
December 16, 2005, 2:55 pm
heh, like here yo have a cool demo i've setup for PC's server.

http://www.freepgs.com/soldat/stats/

Jaska
December 19, 2005, 2:06 pm
Hi

Just registered to this forum.

Im getting this error on stats page

Warning: Error parsing C:\Soldat\soldat.ini on line 165 in C:\xitami\xitami-25\app\webpages\soldat stats\engine.php on line 48

what seems to be the problem? does it effect into anything? I don't know much from php so im kinda stuck, it was an miracle that i got this far.

mar77a
December 19, 2005, 3:14 pm
Hmn, it has to do with the parse_ini_file() function:
quote:Note: There are reserved words which must not be used as keys for ini files. These include: null, yes, no, true, and false. Values null, no and false results in "", yes and true results in "1". Characters |&~![()" must not be used anywhere in the key and have a special meaning in the value.

Remove any of those characters from the line 165, in:
[Player]
Name=

Jaska
December 19, 2005, 4:59 pm
It's me again, I'm just wondering how often Top10.php is being updated? and total kills? and other stats.
After server is restarted and new kill log created? is there a way to auto-update itself, like every 30min?

mar77a
December 19, 2005, 5:32 pm
You have to update the stats by running statsupdate.php manually. Stats will be updated when a new kill log or console log is created.

Glucose
December 24, 2005, 4:37 am
Very nice script, e-z to set-up, update, run, config...
There are however a few little typos in the script, in weaponstats.php for getting num of kills for each wep when parsing cluster files it checks for wrong filename:

if(file_exists("stats/weapons/Cluster-K.txt")){
$clukills = @file("stats/weapons/Clusters-K.txt");
$clukills = count($clukills);
}else{
$clukills = 0;
}
(should be :
if(file_exists("stats/weapons/Clusters-K.txt")){
...)

similar problem with AK-74...
is...
if(file_exists("stats/weapons/AK_74-K.txt")){
$akkills = @file("stats/weapons/AK_74-K.txt");
$akkills = count($akkills);
}else{
$akkills = 0;
}
(should be...
lowercase k in Ak-74 not uppercase)

And is there any ext for php i need for creating the forum-safe images (i'm running php4).


Ty and good job!

eman45008
December 31, 2005, 7:38 am
Hmm. Having trouble in a Linux install. It reads the log files, but shows everything as 0 and not showing any stats. My server is located in /root/. Would this have anything to do with it? U13 stats don't work either. -Eric

Ken the Great
January 6, 2006, 11:30 am
Error: [code]Warning: fopen(stats/logs/lognum.txt): failed to open stream: No such file or directory in /home/ethal/public_html/stats/install.php on line 19

Warning: fwrite(): supplied argument is not a valid stream resource in /home/ethal/public_html/stats/install.php on line 21

Warning: fclose(): supplied argument is not a valid stream resource in /home/ethal/public_html/stats/install.php on line 23
Couldnt open lognum.txt[/code]

help me :(

mar77a
January 23, 2006, 12:20 am
Let's seeee...

Thanks Glucose, i'll fix that small bugs and other i have to in the next release.
Ken, you need to chmod to 0777 the main script directory,

nfsjunkie91
January 23, 2006, 3:26 am
mar77a's back! huzzah! I'm wondering if it is possible to rename the server for the stats you setup for me.

Ken the Great
February 25, 2006, 7:00 pm
..And how exactly do I "chmod to 0777 the main script directory"? :D

Me=nub with this stuff..

mar77a
February 25, 2006, 8:12 pm
Using any ftp client, for example www.web2ftp.com

Mikeman
March 1, 2006, 6:00 pm
mar77a can u help me out? i never see u on MSN :S
anyway when i run serverinfo.php it says server is offline even if its online, and i get lot of internal server errors (error 500) :S
help!!!

Ken the Great
May 1, 2006, 2:30 pm
umm I give it a new try (didn't even remember I tried to use it :D) and got this error/warning when I wanted it to show the serverinfo:

Warning: parse_ini_file(): Cannot open '' for reading in /home/ethal/public_html/test/resources/sx4/engine.php on line 48

it shouldn't be anything with the directory since the the file who shows it is in /resources..

mar77a
May 1, 2006, 4:04 pm
Mmm, if your filesystem is EXT2 or similar (Linux), you'll have to chmod the file so that the script can read it. Also, make sure you dont have special characters (listed in http://php.net/parse_ini_file ) in your soldat.ini.

Minkus
May 20, 2006, 5:17 pm
This script confused me...

I got it to work properly. I just can't get it to work on my site. But that is fine, because I can still access it through IRC to view ranks from there.

Also, is there a way to count suicides as suicides?

mar77a
May 20, 2006, 5:55 pm
Mmm, no, because of the kill-log parsing system. It does kills in one loop, and deths in another one, so there's no way of merging them.