For the webserver I use this php scripts to ping my minecraft server:
https://github.com/FunnyItsElmo/PHP-Minecraft-Server-Status-Query
and this code for the actual webpage:
<?php
include_once 'MinecraftStatus/status.class.php';
$status = new MinecraftServerStatus();
$response = $status->getStatus('trondsen.name', 25565, '1.6.0');
if(!$response) {
echo"The Server is offline!";
} else {
echo"Online: ".$response['players']." \nMax: ".$response['maxplayers']." ";
}
?>
This give a simple webpage with the max limmit of players an how many that is online at the moment.
If the server is down the message "The server is offline" is displayed.
(I do know my servername is in the script, but the server is not open...)
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.