Short and sweet: this project allows you to have native server stats via PHP without having to use an external program to collect the server stats.
In other words, everyone should be able to host their own server stats on their site as long as they have a capable web server. I've tested locally and on a remote host, so it should be fine with most modern hosts. Unfortunately, as tricky as this code was to write, there is nothing that can be done if your server does not support all the components.
This is a bare minimal release, so you will need some web designing skills to make it look "pretty" or additional php/database skills to enhance it more.
readme.txt
Also, using these concepts, you can use this code for other games and projects in a similar fashion! PHP is quite capable afterall.
Enjoy! :)
Troubleshooting:
Make a test page with the following code:
Upload the page, run the script, and save the results. Delete the page afterwards.
Q. Why do I see an empty page when I try to use the server stats?
A. This usually means a needed php component is not there. Check for the following strings in "Configure Command": '--enable-sockets', '--with-mcrypt=', and '--enable-bcmath'.
Look for each section in the configuration. It should look something like the following.
BCMath: [Only registered and activated users can see links. Click Here To Register...]
mcrypt: [Only registered and activated users can see links. Click Here To Register...]
sockets: [Only registered and activated users can see links. Click Here To Register...]
Q. Can more/less debugging information be provided for PHP errors?
A. In short, no. It all depends on how PHP is configured and most hosts are really restrictive to changes made to PHP. Unless you are running your own server where you can reconfigure PHP!
Q. What do the different errors mean?
A. Most errors should be self descriptive. Try to search the text in the php files to see what they are associated with.
Q. I get a bunch of MCRYPT warnings when trying to run the stats?
A. Please see [Only registered and activated users can see links. Click Here To Register...].
More Q/A will be added as they arise.
In other words, everyone should be able to host their own server stats on their site as long as they have a capable web server. I've tested locally and on a remote host, so it should be fine with most modern hosts. Unfortunately, as tricky as this code was to write, there is nothing that can be done if your server does not support all the components.
This is a bare minimal release, so you will need some web designing skills to make it look "pretty" or additional php/database skills to enhance it more.
readme.txt
Just a helpful hint: if you wonder how to "loop" updates, take a look into CRON jobs (your web host must support them!). If not, you will have to come up with another solution (such as using a program that always runs to force the refresh).Quote:
[PHP] Clientless Silkroad Security + ServerStats
pushedx
Please read "license.txt" first!
This is a native PHP port of my Silkroad Security API.
Included is a fully functional ServerStats example.
To use, your server must support: PHP, Sockets, BCMATH, and MCRYPT.
If your server does not support or allow use of all components, you cannot use this code.
To customize the ServerStats script, you must know PHP, HTML/CSS/etc.., and optionally database programming (MySQL/MSSQL).
*** No support will be provided for ServerStats customization. ***
To test ServerStats:
0. Demo "http://edxlabs.web44.net/rsro". This is a free host, so it might be down time to time...
1. Upload all *.php files to a folder on your website.
2. Access "index.php" in that folder (you might need to update the hard-coded version if it changes).
IMPORTANT: You will probably want to set file permissions or add additional security restrictions to the scripts to prevent any abuse. I cannot help you with this, but it should be looked into.
To use ServerStats:
1. Read and follow "examples.txt".
2. Open "index.php" and read through the concepts.
3. To understand what goes on behind the scenes go through "ServerStats.php".
4. For everything else, refer to the rest of the php files code.
Also, using these concepts, you can use this code for other games and projects in a similar fashion! PHP is quite capable afterall.
Enjoy! :)
Troubleshooting:
Make a test page with the following code:
Code:
<?php phpinfo(); ?>
Q. Why do I see an empty page when I try to use the server stats?
A. This usually means a needed php component is not there. Check for the following strings in "Configure Command": '--enable-sockets', '--with-mcrypt=', and '--enable-bcmath'.
Look for each section in the configuration. It should look something like the following.
BCMath: [Only registered and activated users can see links. Click Here To Register...]
mcrypt: [Only registered and activated users can see links. Click Here To Register...]
sockets: [Only registered and activated users can see links. Click Here To Register...]
Q. Can more/less debugging information be provided for PHP errors?
A. In short, no. It all depends on how PHP is configured and most hosts are really restrictive to changes made to PHP. Unless you are running your own server where you can reconfigure PHP!
Q. What do the different errors mean?
A. Most errors should be self descriptive. Try to search the text in the php files to see what they are associated with.
Q. I get a bunch of MCRYPT warnings when trying to run the stats?
A. Please see [Only registered and activated users can see links. Click Here To Register...].
More Q/A will be added as they arise.