Jump to content
Sign in to follow this  
Tommo

Armed Assault PHP Server Statistics!

Recommended Posts

Hi all,

I've been working in my spare time creating a PHP script which makes use of MySQL to store details about every player on a server! Basically it takes the player statistics that the server sends out and adds them to a database, adding new players as they join and continuously updating the scores as the game progresses. It keeps track of player statistics such as name, squad, score, deaths, games, frag rate, average score per game, total playing time and peak players on the server.

This script is now available as a beta, I could go into more details here but its easiest to just direct you to the website:

ArmA PHP Server Stats Homepage

These two pages are also running the script as a bit of a preview:

OGN COOP

OGN VS

The first server being monitored is using the current version but has only been running for a very short time, the second is an older version but shows how it looks after several games have been played.

Enjoy!

Tommo.

Share this post


Link to post
Share on other sites
Quote[/b] ]To start monitoring open the file with the default name of statsserver.php in a web browser, it should say something like incorrect login, click the button to goto the login screen and enter the Server username and password that you specified during the installation. You should be taken to a screen which has a small amount of information about the server being monitored and also a settings button.

Following your instructions, after login page I get this error:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Warning: Cannot modify header information - headers already sent by (output started at /var/www/SFF/stats/statsserver.php:11) in /var/www/SFF/stats/statsserver.php on line 56

Warning: Cannot modify header information - headers already sent by (output started at /var/www/SFF/stats/statsserver.php:11) in /var/www/SFF/stats/statsserver.php on line 61

Server currently being monitored: Special Forces of Finland clan server

Server Address: 192.168.128.8:2302

Is this a bug or what?

EDIT: After that it takes me back to login back in short moment, unless I press settings-button before that. How is the refreshing supposed to work? Should I make cronjob?

Share this post


Link to post
Share on other sites

I'm currently looking into this issue, I didn't experience this error during testing but it seems to have shown up with the public release.

Share this post


Link to post
Share on other sites

I believe I've just found the problem, your using an older version of PHP! I was unable to replicate these errors, but I've been talking with someone else thats been having this problem and their using version 4. I'm using 5.2.1 and some of the functions I've used in the script aren't available till version 5.1 or so. Try updating to the latest version of PHP and it should fix everything, also check your cookies to see if anythings been entered.

Share this post


Link to post
Share on other sites

Is anyone able to comment on what version of PHP their using and if the login feature is working and if the server page automatically refreshes?

Share this post


Link to post
Share on other sites

I'm using debian etch php-version 5.2.0-8+etch.

EDIT: Fixed the problem, without any php skills at all. biggrin_o.gif

Here's fixed version: http://stats.squad-sff.fi/statsserver.php.txt

EDIT2: How do I make stats update? Should I refresh some page, etc.?

EDIT3: Already figured that out. Guess I should make cronjob "wget http://asdf/statserver.php > /dev/null"

I was thinking if updating could be done better way, without web page. Just plain php command line script, that doesn't return anything. Would consume less resources, as cronjob would be like "php5 /var/www/SFF/stats/statserver.php"

Share this post


Link to post
Share on other sites

It should automatically update with a body onload=setTimeout, default is set to refresh every 5 seconds. What changes did you make to get it working? I've only found the css is gone from the top. Its weird, for some the installation has gone like a breeze and everythings working fine straight away, but for others (reports of problems have only been from people running Linux servers so far) there seem to be problems with adding the cookie, the server timezone and refreshing.

Share this post


Link to post
Share on other sites
It should automatically update with a body onload=setTimeout, default is set to refresh every 5 seconds. What changes did you make to get it working? I've only found the css is gone from the top. Its weird, for some the installation has gone like a breeze and everythings working fine straight away, but for others (reports of problems have only been from people running Linux servers so far) there seem to be problems with adding the cookie, the server timezone and refreshing.

Here is patch-file: http://stats.squad-sff.fi/fix_header.patch

Share this post


Link to post
Share on other sites

I'll get onto it sometime soon, I'm just very busy so I'll make changes when I can.

Share this post


Link to post
Share on other sites

Removing security-sensitive information. -Shadow

Share this post


Link to post
Share on other sites

nice 1 PaveQ ! crazy_o.gif ..... do you think a PM would have been a much more security sensitive way of letting the developer know ? ffs

Share this post


Link to post
Share on other sites

I've Pm'd Tommo regarding this. PaveQ's post should be removed asap.

Share this post


Link to post
Share on other sites

Could you please PM me PaveQ? Since your posts been edited I haven't actually been able to see what the problem was since I was just referred to the thread.

Share this post


Link to post
Share on other sites

PM'ed. Didn't want to cause any problem or blame anyone, just pointed out some obvious things. icon_rolleyes.gif

Share this post


Link to post
Share on other sites

Update now available, I'm pretty sure I've fixed this security issue now. Sorry everyone that I made this mistake, I hope it doesn't happen again in the future.

On a side note, I never received that PM huh.gif

Share this post


Link to post
Share on other sites

It's still a disaster security wise.

I won't bother specifying what exactly is though since apparantly that's not allowed on this forum.

Security through obscurity works so well.. banghead.gif

One hint though, start by sanitizing all input variables.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×