RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Resource icon

WebStats 0.0.5

No permission to download
Okay, so this is a web stats system that will allow your website to see various stats from your server(Online player count + names and server uptime + peak players connected per sevrer session).

This will take some coding skills to set up, if you aren't familiar with php or aren't willing to try to figure it out please leave now, I won't set it up for you, and no one else should have to either, its very simple.

First step, download the resource and put the folder in your customs/ folder inside your runuo directory.

Copy the stats.php file to your webserver(rename as desired).


At the top of the php script edit the following lines(Default port for the webstats is 3000, unless you edit the CS files included, leave it as 3000):
PHP:
$service_port = 3000;
$address = gethostbyname('127.0.0.1');


Now at the bottom of the php script is where it displays the received data, feel free to alter as you see fit.
PHP:
echo "There are currently $client_count players connected, and the server has been running for $uptime. During this uptime, we have had a peak of $most_connected connected players.<br>";
 
foreach ($players as $key => $value) {
        if($value != ""){
$staff = explode($STAFF_ID, $value);
if(count($staff) > 1){
echo "{Staff}";
echo "[" . $staff[1] . "]";//Player is a staff member
} else {
echo "[" . $value . "]"; //Player is just a player
}
        }
}


You should be all set up and working now, keep in mind whatever port you choose for WebStats(Default 3000) you must allow the port on your host computers firewall.

Enjoy!


Changes:

4/5/2013 - No changes were made to stats.php, you can continue to use your versions if you are upgrading.
4/5/2013 - Added a safeguard to make sure *if* something goes wrong, the shard will not be effected.
4/5/2013 - Added a few settings in Settings.cs

4/2/2013 - Fixed bug from last release.
4/2/2013 - Shows peak clients connected(Resets at server restart)

4/1/2013 - Now able to differentiate players from staff.
Okay, so this is a web stats system that will allow your website to see various stats from your server(Online player count + names and server uptime + peak players connected per sevrer session).

This will take some coding skills to set up, if you aren't familiar with php or aren't willing to try to figure it out please leave now, I won't set it up for you, and no one else should have to either, its very simple.

First step, download the resource and put the folder in your customs/ folder inside your runuo directory.

Copy the stats.php file to your webserver(rename as desired).


At the top of the php script edit the following lines(Default port for the webstats is 3000, unless you edit the CS files included, leave it as 3000):
PHP:
$service_port = 3000;
$address = gethostbyname('127.0.0.1');


Now at the bottom of the php script is where it displays the received data, feel free to alter as you see fit.
PHP:
echo "There are currently $client_count players connected, and the server has been running for $uptime. During this uptime, we have had a peak of $most_connected connected players.<br>";
 
foreach ($players as $key => $value) {
        if($value != ""){
$staff = explode($STAFF_ID, $value);
if(count($staff) > 1){
echo "{Staff}";
echo "[" . $staff[1] . "]";//Player is a staff member
} else {
echo "[" . $value . "]"; //Player is just a player
}
        }
}


You should be all set up and working now, keep in mind whatever port you choose for WebStats(Default 3000) you must allow the port on your host computers firewall.

Enjoy!


Changes:

4/2/2013 - Fixed bug from last release.
4/2/2013 - Shows peak clients connected(Resets at serve restart)
4/1/2013 - Now able to differentiate players from staff.
Okay, so this is a web stats system that will allow your website to see various stats from your server(Online player count + names and server uptime + peak players connected per sevrer session).

This will take some coding skills to set up, if you aren't familiar with php or aren't willing to try to figure it out please leave now, I won't set it up for you, and no one else should have to either, its very simple.

First step, download the resource and put the folder in your customs/ folder inside your runuo directory.

Copy the stats.php file to your webserver(rename as desired).


At the top of the php script edit the following lines(Default port for the webstats is 3000, unless you edit the CS files included, leave it as 3000):
PHP:
$service_port = 3000;
$address = gethostbyname('127.0.0.1');


Now at the bottom of the php script is where it displays the received data, feel free to alter as you see fit.
PHP:
echo "There are currently $client_count players connected, and the server has been running for $uptime. During this uptime, we have had a peak of $most_connected connected players.<br>";
 
foreach ($players as $key => $value) {
        if($value != ""){
$staff = explode($STAFF_ID, $value);
if(count($staff) > 1){
echo "{Staff}";
echo "[" . $staff[1] . "]";//Player is a staff member
} else {
echo "[" . $value . "]"; //Player is just a player
}
        }
}


You should be all set up and working now, keep in mind whatever port you choose for WebStats(Default 3000) you must allow the port on your host computers firewall.

Enjoy!


Changes:

4/2/2013 - Shows peak clients connected(Resets at serve restart)
4/1/2013 - Now able to differentiate players from staff.
Okay, so this is a web stats system that will allow your website to see various stats from your server(Online player count + names and server uptime).

This will take some coding skills to set up, if you aren't familiar with php or aren't willing to try to figure it out please leave now, I won't set it up for you, and no one else should have to either, its very simple.

First step, download the resource and put the folder in your customs/ folder inside your runuo directory.

Next create a new php file(stats.php should work fine, but name it whatever you want).

EDIT: The php file is now included in the zip file.

At the top of the php script edit the following lines(Default port for the webstats is 3000, unless you edit the CS files included, leave it as 3000):
PHP:
$service_port = 3000;
$address = gethostbyname('127.0.0.1');


Now at the bottom of the php script is where it displays the received data, feel free to alter as you see fit.
PHP:
echo "There are currently $client_count players connected, and the server has been running for $uptime<br>";
 
foreach ($players as $key => $value) {
        if($value != ""){
$staff = explode($STAFF_ID, $value);
if(count($staff) > 1){
echo "{Staff}";
echo "[" . $staff[1] . "]";//Player is a staff member
} else {
echo "[" . $value . "]"; //Player is just a player
}


You should be all set up and working now, keep in mind whatever port you choose for WebStats(Default 3000) you must allow the port on your host computers firewall.

Enjoy!


Changes:

Now able to differentiate players from staff.
Top