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.
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.
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).
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();?>
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: mcrypt:
sockets:
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 .
Array([0]=>[1]=>Warning: mcrypt_ecb()[function.mcrypt-ecb]:Attempt to use an empty IV, which is NOT recommend in/var/site/test/SilkroadSecurity.php on line 174[2]=>[3]=>Warning: mcrypt_ecb()[function.mcrypt-ecb]:Attempt to use an empty IV, which is NOT recommend in/var/site/test/SilkroadSecurity.php on line 134[4]=>[5]=>Warning: mcrypt_ecb()[function.mcrypt-ecb]:Attempt to use an empty IV, which is NOT recommend in/var/site/test/SilkroadSecurity.php on line 231[6]=>[7]=>Warning: mcrypt_ecb()[function.mcrypt-ecb]:Attempt to use an empty IV, which is NOT recommend in/var/site/test/SilkroadSecurity.php on line 231[8]=>Error[9]=>The version packet was rejected because the GatewayServeris closed.[10]=>[11]=>)
Warning: mcrypt_ecb() [function.mcrypt-ecb]: Attempt to use an empty IV, which is NOT recommend in /var/site/test/SilkroadSecurity.php on line 174
Warning: mcrypt_ecb() [function.mcrypt-ecb]: Attempt to use an empty IV, which is NOT recommend in /var/site/test/SilkroadSecurity.php on line 134
Warning: mcrypt_ecb() [function.mcrypt-ecb]: Attempt to use an empty IV, which is NOT recommend in /var/site/test/SilkroadSecurity.php on line 231
Warning: mcrypt_ecb() [function.mcrypt-ecb]: Attempt to use an empty IV, which is NOT recommend in /var/site/test/SilkroadSecurity.php on line 231
This is due to how mcrypt is configured on your host.
You can try to add an "@" right before the 'mcrypt_ecb' function name on lines 134, 174, and 231. That is a PHP directive to suppress warning messages. The changed code would look like:
This is totally awesome.
rayko just told me that he loves you XD
Now we can get rid of the 24/7 running PC with the stats for our site and run it directly on the webhost! No words for this.
This is totally awesome.
rayko just told me that he loves you XD
Now we can get rid of the 24/7 running PC with the stats for our site and run it directly on the webhost! No words for this.
Testing... soon telling the results.
<3
it working on gamerzcorp.com host? Good for you
Quote:
Originally Posted by prot3ctor
Array ( [0] => Error [1] => A connection could not be established. )
The way it works actually its pretty unstable. We have the statistics program running on my home computer 24/7 (doesn't matter at all since I normally left my PC running 24/7 even when the website didn't exist).
Well, the stat program generates a .txt files with the stats, we have another script running every 3 secs gathering the stats from my PC and storing them into the DB. Then, when an user check the capacity page, the php script takes the capacity from the DB and shows to the user. The problem is that this process takes around 10 secs, so the end-user will get statistics from 10 seconds ago as max, which is not very accurate, and also there are some times when I have to restart my PC, so the stats are static for 2 mins or so.
We planned to buy an VPS for the statistics tools the next month, but with this new script we can save that and run the stats directly on the web host.
^The stat tools from klevre.
My only prob that suddenly after some changes stats changed to ratios, hehe
as far as I know,isro has a different structure in that packet and it doesn't send the actual number of people,it just sends the percent..so that's why,I really think so^^
Silkroad Security API 06/09/2011 - SRO Coding Corner - 5 Replies i was trying to run the server_stats example but it just immediately closeed and i cant figure out why..
also i think i need ti configure the ip or port? where can i do this?
edit: I've found the error.. Index was Outside the bounds of the array line 33
the code:
[HELP]silkroad security 05/09/2011 - SRO Coding Corner - 6 Replies what it silkroad security???
what is the packet analyzing???
Silkroad New security? 01/24/2010 - Silkroad Online - 68 Replies This must be a joke or something another wanna be Game Guard? cus silkroad added a new folder called hackshield to the game directory... lol anyone have any inputs on this? maybe for once they trying to do something lol kinda funny... :rtfm:
[Tips] Silkroad Account Security 08/24/2009 - SRO Guides & Templates - 12 Replies Hey,
I know there are some threads about this out there but I think this will be useful though.
Your password should contain at least 7 letters and/or numbers. Hint: Come up with some really senseless sentence with letters and numbers. Here an example : I look forward to the Simpsos Halloween Special on October 31th., Now take the first letter of every word and your password is: “ilfttshsoo31” For a password like this a bruter needs about 107 years and you can remember it easily.
...
Silkroad Security Video 11/06/2008 - SRO Hacks, Bots, Cheats & Exploits - 10 Replies Hi guys,
i just played a bit with Silkroad and c++.
The result was a Undetected Silkroad Keylogger.
I was Scanning it for fun on Virustotal.com
the result was 1/36
The 1 Antivir who said anythink
was Panda - Suspicous File
Maybe you have the Question now
why did you post this here?