View Full Version : Game Server Stats & Status Downloads

10-05-2004, 10:20 AM
Here is a list of available scripts for Status of game servers and stats.

SWBF Server Status PHP - Ver. 1.3 for Dedicated server 1.1

Linux SWBF Server Status CGI

Linux SWBF Server Status PHP

WinBlows SWBF Server Status PHP

Linux SWBF Server Stats

PHP SWBF Server Stats

All patches for SWBF Stats and Status will be located on

SWBF PHP Stats Patch v 1.2.1 released: 25-Oct-2004
Fixes issues with admin login

SWBF PHP Stats Patch 0.1 was released: 21-Oct-2004
Minor fix for the admin login.. there was an issue the password field

SWBF PHP Stats getstats.php was released: 19-Oct-2004
This is a minor patch to fix the issue of multiple entries in the database for a single users for a single map.
It should also fix the issue of the wrong team showing up for a specified player

Server Status PHP

Update for KaeseGewitter status script:

I will keep adding to this post when more software comes available.

10-08-2004, 07:52 AM
How are you doing the stats I haven't seen anythign useful in either log files to make stats on? Are you just polling the server like every 30 seconds and getting the updated kills that way? Curious as I want to make a stats program for my server.


10-08-2004, 08:00 AM
correct I am getting info from the specified server and updated based on kills, deaths, teams, and maps

10-08-2004, 10:24 AM
Be sure to add the server stats to lucasfiles when you got php done ;)

10-08-2004, 10:29 AM
I had planned on it.. I should have it done this weekend. I am still testing on it right now..

10-10-2004, 06:25 PM
Due to a little test on my server the php version of the stats will not be released this week. Due to the lack of intrest in the server over the weekend I could not get enough people on at one time to get the system stable. I should be working on it the rest of this week and next weekend so hopefully by the following week I should have a release.

Sorry guys.

If you are curious on what test I ran this weekend please see this post:

10-11-2004, 09:02 PM
Ok thanks to not having the tps set above the default limit.
I actually had people on the server for the past 3 hours.
So I actually go some testing done on the SWBF Server Stats PHP Version.

It looks like all the bugs are out of the system but I want to run it one more day to make sure. This will also give me time to clean up my code and add some comments. I should be able to release it on Thursday.

If you want to check out the progress then go here

10-11-2004, 10:30 PM
Great going there LoRdNaTaS.
I'm kinda looking forward to that once you release it.... um just outta interest, is the back end to that using mySQL?

10-11-2004, 11:10 PM
currently yes..

I play on modify it to work with just about any db..

But I just wanted to get a working copy of the php stats out asap. The next port will work with postgres..

I will probabaly not add much WinBlows support to it unless there is a call for it. Seeing most of the admin here want a Linux port of the server I figure I am some what safe setting up for just that.

10-12-2004, 08:56 AM
Yeah, prolly the best (and safest) route.
Shame, I'll have to dust off the old linux machine and fire her up.... I'm running the dedicated server on one of my own desktop machines, plus abyss web server, and a cut down winblows php.... I tried installing mysql and it wasnt best happy!!! LOL!... But I noticed that each time I ran the php (or left it on 60 seconds refresh) while i was playing it'd get a brief network flash up).... poxy windows.

But hey ho, its manageable... and only an iccle server... but at least its one I can guarantee is up :) muhhaah the control!!

But thanks again for all the hard work :)

10-12-2004, 09:05 AM
No prob..

If I get time I will make a dedicated Winblows version but it is not that high on my proirty list.. Sorry to all you Winblow users.

10-16-2004, 06:29 PM
Does the stat page keep a rolling score (all games played).

or does it just display the current game?

I want to use this in a closed lan party.. and SQL is to pricy to put on a closed server. Any plans on adding a file based database?

We will prolly be running it on a 2003 web server. (what the school has). Will that be a problem.

10-16-2004, 11:16 PM
The stats keep a total for all games not just the currently active one. The DB is MySQL of which is free. It will run on both windows and Linux.

I have to double check on the php stats system to make sure it will function on a Winblows box. Due to I do not run any winblows web servers. But if for some reason it does not I will just modify the Winblows php status script to work with the stats system.

I nomally do not due much development for winblows but I have had to make some sacrifices due to the lack of linux server files.

If they release a true log system that will be able to be parsed easily I could make a flat file system but as the server currently stats I do not have any plans of making a flat file stats system.

10-17-2004, 08:46 PM
MySql is free???

Where do i get it for free.. i seem to only find where to buy it.

10-18-2004, 04:26 AM

10-18-2004, 06:15 AM
Yes MySQL is free use the link that stevader posted pick your os and download and install....

And just if you are wondering php is also free.


You can also get apache for winBlows to if you want a real web server.


Sorry I really hate winblows.

10-18-2004, 07:13 AM
I have relased the php stats.


10-18-2004, 07:30 AM
No prob.. Thats the great thing about OPEN SOURCE....
As long as the copyright is in tacked I am happy.

10-18-2004, 03:58 PM
I got a message asking how to setup the cron on WinBlows.

Ok so here is what you will have to do if you want to try the php stats on Winblows.

Create a .bat or .cmd file depending on your OS.. Most of you will be able to use .cmd file without any issue... If you are using 2000 or 2003.

Here is example 1 of the cmd file.
If you can run php scripts from the command line anywhere on your server this will work for you.

php -q /path/to/file/getstats.php

If you can not run php scripts from the command without the php files being located in the PHP directory then use this file.

Make sure that you copy the getstats.php file to your php directory.

cd \
cd php
php -q getstats.php

Now that you have your getstats.cmd file you can create your scheduled task.

click start->programs->accessories->system tools->scheduled tasks

click on add task
click next then click on browse.
Browse to where you saved your getstats.cmd file
Select Daily
Set the start time and date (Use the default)
If your user has admin rights of which it should then just use your user info in the next window or fill in the admin info.
Select "Open Advanced options"

Select the schedule tab -> advanced button

Check the repeat tack box

Set Every to what ever you want.. I currently have the cron to run every minute. I would not go less then that though.

In the duration hours box set it to 24.

This will allow the task to run every minute for 24 hours straight.

Then just hit ok on both winblows and then you are set.

Now again I have not tested this script on any WinBlows boxes.. So if you have issues let me know.

10-19-2004, 09:28 AM
There is a small patch for the SWBF PHP Stats. And also instructions on how if you would like to set it up for WinBlows.

All info can be found here: http://www.apocalypce.net...

And just an FYI for everyone all updates and patches will be available for download off of apocalypce..

I will keep everyone posted on an patches or upgrades that become available.

10-19-2004, 09:29 AM
sorry i have a a question.

until there is another way i am using the script on my site. but what i need to know(since i dont know php) is how to create a link on the webpage back to my home page. thanks.

10-19-2004, 09:49 AM
If you go to the includes folder and open functions.php. Find the function that says Footing.

You will see a line like this:

print"<td align='center'>$back Ver $ver<bR> &copy <a href='http://www.apocalypce.net' target='blank'>-=DOA=- / -=SLOA=- $year</a><br></td>\n";

before the closing </td> put this in:

<a href='http://yourdomain.com'>Back to main site</a>

you can modify that link to what ever fits for you.

This will put the link at the bottom of the page on both the main listing and also the details.

10-19-2004, 10:00 AM
thank you :)

10-19-2004, 10:13 AM
No prob

10-19-2004, 10:13 AM
ok i tried to install the server stats.php
and have trouble with sql

this is what i get


SQL-query :

------------------------------------------------------- --

MySQL said:

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '---------------------------------------------------------

can you please help?? sorry.

10-19-2004, 10:31 AM
Remove the first part of the SQL (before the first drop table if exists), that worked for me.

10-19-2004, 10:48 AM
Sorry about that guys. I will mod the sql file right now so no one else should have this issue.

10-19-2004, 11:24 AM
I have got SWBF PHP Stats to work on Winblows... :P
Anyways this is what you have to do to get it to work...

If your Winblows Box is setup to only run command line php from within the php directory download this file:

If your Winblows Box is setup to run command line php from anywhere download this file:

Once you have one or the others downloaded then you will need to copy your includes directory from the root swbf_php_stats folder to your php directory if you downloaded the first file.

If you downloaded the second file then you need to put the extracted file into your root directory of swbf_php_stats.

To test to make sure these work just double click the .cmd file that was extracted.

If you get an error like this "[b]php is not recognized as an internal or external command, operable program or batch file.[\b]"

Then this means that you have to run command line php from your root php directory which should be something like this: "c:\php"

Once you have it setup here is the full readme plus how to setup a scheduled task on Winblows

Here is a working example of the system:

10-20-2004, 10:46 AM
ok now it;s a new error lok at this


SQL-query :


MySQL said:

#1044 - Access denied for user: 'web30@localhost' to database 'usr_web30_1'

can you help?

10-20-2004, 10:52 AM
#1044 - Access denied for user: 'web30@localhost' to database 'usr_web30_1'

your user web30 does not have lock enabled in its setting on the databases.

Remove this from all the create statements

That should fix it.

10-20-2004, 05:32 PM
I'm trying to get the php stats running on a freebsd 4.10 system but am having troubles.

when I run the getstats.php from a command line, i see the following:
PHP Fatal error: Call to undefined function mysql_connect() in /usr/local/www/data-dist/stats/includes/conn.php on line 18

Also, when calling the scripts in apache2, it seems to not process the mysql_connect either. The headers and footers display, but no server stats.

The machine is running freebsd 4.10
apache 2
php 5.0.2
mysql 4.0.21

Any help?

10-20-2004, 05:56 PM
PHP Fatal error: Call to undefined function mysql_connect() in /usr/local/www/data-dist/stats/includes/conn.php on line 18

One of two things is happening..

1. PHP was not compiled with mysql as an option..
FIX: Recompile PHP with --mysql

2. You do not have this line in your httpd.conf file

AddType application/x-httpd-php .html .php .phtml

I personally would try reason 2 first and if that line is there then you are most likly going to have to recompile php with the --mysql option.

10-20-2004, 10:48 PM
fixed the php issue, but ran into a whole new one.

from the command line, I would get the following errors:
PHP Notice: Undefined variable: buf in /usr/local/www/data-dist/stats/getstats.php on line 37
PHP Notice: Undefined offset: 1 in /usr/local/www/data-dist/stats/getstats.php on line 41
PHP Notice: Undefined offset: 3 in /usr/local/www/data-dist/stats/getstats.php on line 42
PHP Notice: Undefined offset: 5 in /usr/local/www/data-dist/stats/getstats.php on line 43
PHP Notice: Undefined offset: 7 in /usr/local/www/data-dist/stats/getstats.php on line 44
PHP Notice: Undefined offset: 9 in /usr/local/www/data-dist/stats/getstats.php on line 45
PHP Notice: Undefined offset: 11 in /usr/local/www/data-dist/stats/getstats.php on line 46
PHP Notice: Undefined offset: 13 in /usr/local/www/data-dist/stats/getstats.php on line 47
PHP Notice: Undefined offset: 15 in /usr/local/www/data-dist/stats/getstats.php on line 48
PHP Notice: Undefined offset: 17 in /usr/local/www/data-dist/stats/getstats.php on line 49
PHP Notice: Undefined offset: 19 in /usr/local/www/data-dist/stats/getstats.php on line 50
PHP Notice: Undefined offset: 21 in /usr/local/www/data-dist/stats/getstats.php on line 51
PHP Notice: Undefined offset: 23 in /usr/local/www/data-dist/stats/getstats.php on line 52
PHP Notice: Undefined offset: 25 in /usr/local/www/data-dist/stats/getstats.php on line 53
PHP Notice: Undefined offset: 27 in /usr/local/www/data-dist/stats/getstats.php on line 54
PHP Notice: Undefined offset: 29 in /usr/local/www/data-dist/stats/getstats.php on line 55
PHP Notice: Undefined offset: 43 in /usr/local/www/data-dist/stats/getstats.php on line 68
PHP Notice: Undefined offset: 45 in /usr/local/www/data-dist/stats/getstats.php on line 69

(the line numbers might be different than the original since I added some debug lines.)

In short, the getstats.php would fail on fread($socket,1) therefore setting the unread_bytes to 0. $buf never gets created, and the rest of the script bombs out.

I debugged for several hours trying to figure out why I wasn't getting data from the server... until it finally hit me.

*&%^$*$) LAN GAME!

I switched the server off of lan game and the stats came up in a flash... 301 bytes came in from the server.

SO my question is: When running in LAN game, is there another way to request data from the server?

10-20-2004, 10:52 PM
just another update:
running the getstats.php from the cmd line, I now get the following warning:

PHP Warning: Unknown: 2 result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query() in Unknown on line 0

Any ideas? (perhaps it's just the empty databases, i'll fill them tomorrow when I play)

10-21-2004, 04:52 AM
ok now that i have seemed to get the data in mysql when i try to login as server admin i get this.

Warning: main(): Unable to access ../../includes/conn.php in /srv/www/htdocs/web30/html/bf/stats/admin/includes/functions.php on line 8

Warning: main(../../includes/conn.php): failed to open stream: No such file or directory in /srv/www/htdocs/web30/html/bf/stats/admin/includes/functions.php on line 8

Warning: main(): Failed opening '../../includes/conn.php' for inclusion (include_path='.:/usr/share/php') in /srv/www/htdocs/web30/html/bf/stats/admin/includes/functions.php on line 8

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /srv/www/htdocs/web30/html/bf/stats/admin/includes/functions.php on line 254
Could not access the db not auth given:

fyi i do not have shell access.

10-21-2004, 05:38 AM
I saw this on a test machine as well.
I fixed it by hardcoding the paths for the include (I know, I know, bad programming practice to hardcode, but it did the trick for me)

so edit the /admin/functions.php and change the includes.
from "../../includes/conn.php"
to "/srv/www/htdocs/web30/html/bf/stats/includes/conn.php"
(minus the quotes)

do this for all the main php pages and see if the errors goes away.

I assume this is just a misconfigured apache setting.

10-21-2004, 06:25 AM
On the lan game I will have to look into that. I have not test it on a lan game at all.

I will see what I can come up with over the weekend.

PHP Notice: Undefined offset: 1 in /usr/local/www/data-dist/stats/getstats.php on line 41

This usally is just because the settings in the php.ini for errors is set to check everything which should not be on a production server. But I will aslo looking into this. It should just be that I have not declared all the vars before calling them. I know bad programming..

Could not access the db not auth given:

This is due to not getting the conn.php file. This holds all the database info and if you don't have that then the sql will fail.

The hard coding of the the includes should fix this. Which I would guess is another issue in the php.ini not in the apache config.

Check to see if you have included defined in your php.ini file on winblows for included to work anywhere it should be set to ./
and the same should be on Linux.

10-21-2004, 11:58 AM
not using winblows am using linux.

10-21-2004, 12:10 PM
lol i gotta have every bad thing in the book lol

it now says this

Could not access the db not auth given: Unknown column 'password' in 'field list'

FYI i do have all the correct setting in my conn.php file also. i copied them from my config.php on my forums.

also just so you can see it your self here is the page


10-21-2004, 01:40 PM
easy fix...
Change password to passwd my fault. that should fix it..

The field in the table admin is passwd.. I will release a patch for that shortly.

Sorry about that.

10-22-2004, 08:35 AM
New Patch for SWBF PHP Stats.

SWBF PHP Stats Patch 0.1 was released: 21-Oct-2004
Minor fix for the admin login.. there was an issue the password field

10-25-2004, 09:38 AM
Any luck with LAN game monitoring?

10-25-2004, 09:39 AM
thanks man it seems to be working now .i updated my whole site yesterday .wen t with a little different style looks better .put the live staus and the stats on the there also .

check it out

njoc site (http://www.njoc.org)

10-25-2004, 10:26 AM
Looks good. I was just running through my referers on my site and noticed that your stats were not working... thats why I sent the email.

I do check on those sometimes. One to see if anyone is having issues and if they are to see if I can fix it just from the error codes that I have put into the code.

I try to keep you guys happy. :)

10-25-2004, 10:41 AM
thanks but yes here are some more errors. when i try to login to admin this is the new info a get since i updated with patch

You are not authorized to enter this area.

lol sorry but if you could help i would be greatful :)

by the way iedited it but i still cannot login to admin page.

10-25-2004, 11:20 AM
try this download. It is a moded admin functions include file


10-25-2004, 11:34 AM
m,an i am so sorry but i most have every problem in the book.here is the newest

Could not access the db not auth given: Unknown column 'password' in 'field list'

you think i should just give up??

10-25-2004, 01:53 PM
Sorry I forgot to change the password field to passwd.. Download the rar file again and that should fix it.


10-25-2004, 02:46 PM
bad link this is what i get when i click it .

The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.


Please try the following:

If you typed the page address in the Address bar, make sure that it is spelled correctly.

Open the www.apocalypce.net home page, and then look for links to the information you want.
Click the Back button to try another link.
Click Search to look for information on the Internet.

10-25-2004, 02:53 PM
try this: http://www.apocalypce.net/downloads/swbf_stats_admin.rar

10-25-2004, 03:01 PM
If you are still having issues you can log on to my IRC server I will be on for the next hour then I will be back on later tonight.

I have a web irc client on my site that you can use.
its apocalypce.net

10-25-2004, 05:05 PM
Ok new patch that should fix all the admin issues.
Patch v 1.2.1


Download and extract the file.
Upload to the functions.php to your /swbf_stats/admin/includes/ folder.

The functions.php file should overwrite your current functions.php file.

This will fix the login issues that some people are having to deal with.

10-26-2004, 09:45 AM
ok that link doesn't work .the one right above me that is .and the other one didn;t help stioll getting this
You are not authorized to enter this area.
after i enter username and password.

10-26-2004, 09:51 AM
just go to the mysql value and change password to passwd, fixed.

Seems i'm not able to set-up a cron for the place where I host it. Any chance of finding something that auto loads it each minute?

10-26-2004, 09:55 AM
ok lol i finally logged in but now i;lm not able to change the info. man can i have anymore trouble /??and i swear i followed your instructions.

10-26-2004, 10:40 AM
Dude pop onto my IRC server.. It will make it much faster then doing this. I will then post all the info from our conversation up here for support for others that might be having the same issues.


10-26-2004, 11:58 AM
ok i am there now .on irc i will keep it open but the only problem now is that i am not receiving the stats.

10-26-2004, 12:02 PM
what server and what room?? for IRC.

If you are on my server the join room #SLOA

10-26-2004, 12:09 PM
i used the link on your site.

10-26-2004, 12:49 PM
Just an FYI to everyone I am in the process of modifing the getstats.php file so it runs more like a bot. This will eliminate the need for people to run crons or scheduled tasks. But you will still need to have ssh access to the server or remote console so you can start the file.

I have not figured out a way to by pass that as of yet.

Once they setup the servers so we can actually get useful logs then it should stop the need for most of this. Hopefully.

10-26-2004, 04:14 PM
there is some info about the newest version of SWBF PHP Stats on the web site.

It will not require cron or task scheduler.
Tks will be tracked
Images for maps
Limit the number of players displayed on the main display ( next and previous links to run through the list of players)

Possible Features:

For more info check out http://www.apocalypce.net

10-27-2004, 01:21 PM
thanks again LordNatas without your help i'd still not be able to use this . but it works great and i'm very happy with it .

10-27-2004, 03:38 PM
No worries...
I worked on the bot last night and it seems to be working but I want to run some more tests on it. The only thing is you anyone using it will still need either Remote Desktop for WinBlows or SSH for Linux so that they can start the script. But I will see if I can do something with that.

10-27-2004, 10:46 PM
Well I have been working on the next version of SWBF PHP Stats and I have the bot working very well and now I have some of the front end does as well..

you can see it here: http://www.apocalypce.net/swbf_stat_v130/index.php

Current Working Features:

Number of players displayed on the main page.
Previous and next links for the main page.
TK counting.
Player Details (Not Modified Yet) .
Map Details.
Awards (top killer, top tks, top target).

10-29-2004, 05:09 AM
well . if upload that new version . will it affect what we have done??? i may not get back till tommorrow for reply.

10-29-2004, 06:34 AM
It will some what.. It will just have the new features added and the db will have to be alter a little bit but I am going to try to make it so that any changes that have been made to the look of the system will stick. Hopefully.

10-29-2004, 11:57 AM
np i'll just wait now till it is all finished then .

11-04-2004, 08:30 AM
With the new update for SWBF I am in the process of updating the Status and Stats scripts. I should have it completed by the first of next week. I will keep everyone posted. If you would like to see what new info the server puts out check out the server status.

I have modifed that some what I still have to finish but that will give you an idea of what is coming.


11-04-2004, 03:29 PM
SWBF server status v 1.3 for dedicated server version 1.1 has been released.

There is an upgrade from the previous version of status and a full download.

They both can be found here:

11-06-2004, 08:28 PM
SWBF PHP Stats v1.3 should be relased soon. I have it working with the 1.1 server patch but I just want to make sure I have 99% of the bugs out of the system.

I have also modified the SWBF PHP Stats v1.2 to work with the same swbf_bot. It should be relased around the same time.

The 1.3 will only work with the 1.1 Server and 1.2 will only work with 1.0 servers so when I do release them please make sure you are using the correct one for your server.

11-23-2004, 05:26 PM
Well I was hoping they would fix the issue with the server carring over the last games scores after the map change but after running my bot on about 10 servers and watching roughly 50 games. I have come to the conclusion they have not fixes this issues as of yet.

I am still working on some way to make the stats auto reset but I have been really busy at work and have not been able to dedicate as much time as I would like.

11-28-2004, 06:44 PM
Ok guys I am going to say this for the last time cause I am getting tired of emails saying my software does not work and then finding out the user downloaded the software from some site that I did not even know had my software.

If you want the most recent copies of SWBF STATS and SWBF STATUS the check here and my site www.apocalypce.net.

Sorry to be such a pain in the ass but I have reived a couple of emails over the past couple of days bitching, then I find out they are using version 1.0 of my software.

Thanks for eveyones support that actually read the readme files and know where to go for help and updates.


11-30-2004, 07:13 AM
Finish ??

No Stats Vers 1.3 ?

sorry my englisch is not so good

better speak german ,,:D

11-30-2004, 10:55 AM
The issue with 1.3 of the stats is I am trying to figure out a way to reset the values at the end of the map..

When they released the 1.1 and 1.11 server updates for some they messed up the kill and death variables at the end of a map change instead of resetting like they did on version 1.0 they just carry over to the next map.. Which I think is a big issue due to the vars not resetting it could be messing with the gamespy stats as well as personal server stats.

Now when I can either figure out how to reset those on every map change and make sure they are correct for the next game or when LA decides to pull their heads out of there ass and fix this issue, I will release 1.3 version but not untill one of these two things happen.

It sucks I know.

I will keep everyone posted on my progress.

Oh and hey dj@43th.de thanks for all the traffic to my site.

12-01-2004, 01:34 PM
hm,,, traffic to your Site ???

where is my mistake ???

12-01-2004, 07:22 PM
Well thanks though and I will keep you guys posted on the progress.

12-06-2004, 07:52 PM

one way would be to just index all players and their stats at the end of the map/round..

then at the end of the next round.. their rounds "stat" is just the difference between the end of that round and the end of the previous round...

if you need some help let me know (i've been out of the battlefront loop for quite a while)..

i actually am working right now on my BF1942 league stat dealy.


its still a work in progress..

12-07-2004, 05:15 AM
that would work I did not think of that thank man.. I will work on that tonight.

10-18-2005, 10:32 PM
I see http://www.apocalypce.net is down. Are these PHP scripts still available?