LucasForums (
-   Server Administration (
-   -   Game Server Stats & Status Downloads (

LoRdNaTaS 10-05-2004 10:20 AM

Game Server Stats & Status Downloads
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.

Awol 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.


LoRdNaTaS 10-08-2004 08:00 AM

correct I am getting info from the specified server and updated based on kills, deaths, teams, and maps

Alegis 10-08-2004 10:24 AM

Be sure to add the server stats to lucasfiles when you got php done ;)

LoRdNaTaS 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..

LoRdNaTaS 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:

LoRdNaTaS 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

vwjoker 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?

LoRdNaTaS 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.

vwjoker 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 :)

LoRdNaTaS 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.

Darth_Larsen 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.

LoRdNaTaS 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.

Darth_Larsen 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.

SteVader 10-18-2004 04:26 AM

LoRdNaTaS 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.

LoRdNaTaS 10-18-2004 07:13 AM

I have relased the php stats.

LoRdNaTaS 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.

LoRdNaTaS 10-18-2004 03:58 PM

This is for WinBlow Users
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.

LoRdNaTaS 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:

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.

(NJOC)MasterJedi[L] 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.

LoRdNaTaS 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='' target='blank'>-=DOA=- / -=SLOA=- $year</a><br></td>\n";

before the closing </td> put this in:

<a href=''>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.

(NJOC)MasterJedi[L] 10-19-2004 10:00 AM

thank you :)

LoRdNaTaS 10-19-2004 10:13 AM

No prob

(NJOC)MasterJedi[L] 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.

Alegis 10-19-2004 10:31 AM

Remove the first part of the SQL (before the first drop table if exists), that worked for me.

LoRdNaTaS 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.

LoRdNaTaS 10-19-2004 11:24 AM

Working copy of SWBF PHP Stats on WinBlows 2003
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:

(NJOC)MasterJedi[L] 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?

LoRdNaTaS 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.

JediCow5 10-20-2004 05:32 PM

FreeBSD errors
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?

LoRdNaTaS 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.

JediCow5 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?

JediCow5 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)

(NJOC)MasterJedi[L] 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.

JediCow5 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.

LoRdNaTaS 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.

(NJOC)MasterJedi[L] 10-21-2004 11:58 AM

not using winblows am using linux.

(NJOC)MasterJedi[L] 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

LoRdNaTaS 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.

All times are GMT -4. The time now is 08:19 AM.

Powered by vBulletin®
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2015 - All rights reserved.