Ejemplo n.º 1
0
<?php

include_once 'status/status.class.php';
include_once 'config/rcon_config.php';
$status = new MinecraftServerStatus();
$response = $status->getStatus($server);
if (!$queryPort == '') {
    if (!$response) {
        echo "Serwer jest <span id='offline' style='height:20px; font-size:14px'>OFFLINE</span>";
    } else {
        $min1 = $response['players'];
        $max1 = $response['maxplayers'];
        $procenty = $min1 / $max1 * 100;
        echo "\n\t\t<div id='menubez' style='float:right; width:230px; height:auto'>\n\t\t\t\n\t\t\t<div class='st' style='width:100px; float:left'>\n\t\t\t\t<p class='link3'>Wersja: " . $response['version'] . " </p>\n\t\t\t</div>\n\t\t\t<div class='st' style='width:100px; float:right'>\n\t\t\t\t<p class='link3'>Ping: " . $response['ping'] . " </p>\n\t\t\t</div>\n\t\t\t<div class='st' style='width:220px; margin-top: 70px'>\n\t\t\t\t<p class='link3'><span id='online' style='height:20px; font-size:14px'>ONLINE</span>    Gracze: " . $response['players'] . "/" . $response['maxplayers'] . " </p>\n\t\t\t\t\n\t\t\t\t<div class='meter'>\n\t\t\t\t\t<span style='width: " . $procenty . "%'></span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t\t";
    }
}
Ejemplo n.º 2
0
function getMinecraftPlayers($port)
{
    $server = new MinecraftServerStatus('127.0.0.1', $port);
    $players = false;
    $numplayers = 0;
    if ($server->Get('numplayers') > "0") {
        $players = true;
        $numplayers = $server->Get('numplayers');
    }
    return array($players, $numplayers);
}
Ejemplo n.º 3
0
<?php

$status = new MinecraftServerStatus();
$response = $status->getStatus('www.gnosisparadox.net', '1.6.4', '25566');
$Server = "Server Status: ";
$Offline = "Offline";
$Online = "Online";
$Blue = 'blue';
$Green = 'green';
$Red = 'red';
if (!$response) {
    echo '<div class="status" style="Color:' . $Blue . '">' . $Server . '</div>';
    echo '<div class="output" style="display: inline-block; Color:' . $Red . '">' . $Offline . '</div>';
} else {
    if ($response) {
        echo '<div class="status" style="color:' . $Blue . '">' . $Server . '</div>';
        echo '<div class="output" style="display: inline-block; Color:' . $Green . '">' . $Online . '</div>';
    }
}
<!DOCTYPE html>
<html lang="en">
<?php 
require_once 'MinecraftServerStatus.class.php';
$Server_MC = new MinecraftServerStatus('127.0.0.1', 25564);
?>
<!-- MC Online check -->
<?php 
if ($Server_MC->Get('online')) {
    ?>
	<!-- MOTD -->
	<button class="btn btn-info disabled"></i> <?php 
    echo $Server_MC->Get('hostname');
    ?>
</button>
<?php 
}
?>
<!-- MC Online check -->
<?php 
if ($Server_MC->Get('online')) {
    ?>
	<button class="btn btn-success disabled"><i class="icon-ok icon-white"></i> Online</button>
<?php 
} else {
    ?>
	<button class="btn btn-danger disabled"><i class="icon-remove icon-white"></i> Offline</button>
<?php 
}
Ejemplo n.º 5
0
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>RITCraft - the unofficial RIT Minecraft Server</title>

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="css/portfolio-item.css" rel="stylesheet">

<?php 
include_once 'status.class.php';
// Include the server status monitor script
$status = new MinecraftServerStatus();
?>

</head>

<body>
    <!-- Navigation -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
Ejemplo n.º 6
0
<!DOCTYPE html>
<html lang="en">
	<script>
	// Enable bootstrap tooltips
	$(function ()
	        { $("[rel=tooltip]").tooltip();
	        });
	</script>
<?php 
require_once 'MinecraftServerStatus.class.php';
$Server_FTB = new MinecraftServerStatus('127.0.0.1', 25565);
?>
<!-- FTB Online Players -->
<?php 
if ($Server_FTB->Get('numplayers') > "0") {
    foreach ($Server_FTB->Get('players') as $Player_FTB) {
        if (file_exists('/Users/zeus/Sites/d4rk.co/mc/img/avatars/' . $Player_FTB . '.png')) {
            echo '<img src="/mc/img/avatars/' . $Player_FTB . '.png" rel="tooltip" data-toggle="tooltip" title="' . $Player_FTB . '" style="margin-right: 1px; margin-left: 1px" class="img-polaroid">';
        } else {
            $f = file_put_contents("/Users/zeus/Sites/d4rk.co/mc/img/avatars/" . $Player_FTB . ".png", fopen("https://minotar.net/helm/" . $Player_FTB . "/30.png", 'r'));
            if ($f) {
                echo '<img src="/mc/img/avatars/' . $Player_FTB . '.png" rel="tooltip" data-toggle="tooltip" title="' . $Player_FTB . '" style="margin-right: 1px; margin-left: 1px" class="img-polaroid">';
            } else {
                echo '<p>Unable to download avatar</p>';
            }
        }
    }
}
Ejemplo n.º 7
0
<?php

// do DOS commands here and pipe output to $out
require_once 'MineCraftServerStatus/MinecraftServerStatus.class.php';
$Server = new MinecraftServerStatus($_GET['host'], $_GET['port'], 2);
$out = array('online' => $Server->Get('online'), 'hostport' => $Server->Get('hostport'), 'hostip' => $Server->Get('hostip'), 'motd' => $Server->Get('hostname'), 'numplayers' => $Server->Get('numplayers'), 'maxplayers' => $Server->Get('maxplayers'), 'version' => $Server->Get('version'), 'map' => $Server->Get('map'), 'gametype' => $Server->Get('gametype'), 'game_id' => $Server->Get('game_id'), 'software' => $Server->Get('software'));
header('Content-type: application/json');
echo json_encode($out);
Ejemplo n.º 8
0
<!DOCTYPE html>
<html lang="en">
	<script>
	// Enable bootstrap tooltips
	$(function ()
	        { $("[rel=tooltip]").tooltip();
	        });
	</script>
<?php 
require_once 'MinecraftServerStatus.class.php';
// Assign variables
$Server_MC = new MinecraftServerStatus('127.0.0.1', 25564);
// MC Online Players
if ($Server_MC->Get('numplayers') > "0") {
    foreach ($Server_MC->Get('players') as $Player_MC) {
        $avatarLocal = '/Users/zeus/Sites/d4rk.co/mc/img/avatars/' . $Player_MC . '.png';
    }
    // If our local avatar file exists and is less than 24 hours old
    if (file_exists($avatarLocal) && filemtime($avatarLocal) > time() - 60 * 60 * 24) {
        echo '<img src="/mc/img/avatars/' . $Player_MC . '.png" rel="tooltip" data-toggle="tooltip" title="' . $Player_MC . '" style="margin-right: 1px; margin-left: 1px" class="img-polaroid">';
    } else {
        $f = file_put_contents($avatarLocal, fopen("https://minotar.net/helm/" . $Player_MC . "/30.png", 'r'));
        if ($f) {
            echo '<img src="/mc/img/avatars/' . $Player_MC . '.png" rel="tooltip" data-toggle="tooltip" title="' . $Player_MC . '" style="margin-right: 1px; margin-left: 1px" class="img-polaroid">';
        } else {
            echo '<p>Unable to download avatar</p>';
        }
    }
}
Ejemplo n.º 9
0
<?php

include_once 'ServerStatus.php';
$status = new MinecraftServerStatus();
$response = $status->getStatus('104.243.39.107');
$staff = array('Chaka');
if (!$response) {
    echo '<h2>STATUS: <span class="label label-danger">Offline</span></h2>';
} else {
    echo '<h2>STATUS: <span class="label label-success">Online</span></h2>';
    echo "Online Players " . $response['players'] . "/" . $response['maxplayers'];
    echo '<table class="table"><tr><th></th><th>Username</th><th>UUID</th><th>Actions</th></tr>';
    foreach ($response['sample'] as $player) {
        echo '<tr>';
        echo '<td><img src="https://crafatar.com/avatars/' . $player->id . '?helm" alt="' . $player->name . 's head" height="16" width="16"></td>';
        echo '<td>' . $player->name . '</td><td>' . $player->id . '</td>';
        echo '<td>';
        echo '<div class="dropdown">';
        echo '<button class="btn btn-default dropdown-toggle" id="ss-dp" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">';
        echo 'Actions';
        echo '<span class="caret"></span>';
        echo '</button>';
        echo '<ul class="dropdown-menu" aria-labelledby="ss-dp">';
        echo '<li><a href="?kick="' . $player->name . '>Kick</a></li>';
        echo '<li><a href="?ban="' . $player->name . '>Ban</a></li>';
        echo '</ul>';
        echo '</div>';
        echo '</td>';
        echo '</tr>';
    }
    echo '</table>';
Ejemplo n.º 10
0
    private static function readVarInt($socket)
    {
        $a = 0;
        $b = 0;
        while (true) {
            $c = socket_read($socket, 1);
            if (!$c) {
                return 0;
            }
            $c = Ord($c);
            $a |= ($c & 0x7f) << $b++ * 7;
            if ($b > 5) {
                return false;
            }
            if (($c & 0x80) != 128) {
                break;
            }
        }
        return $a;
    }
}
$response = MinecraftServerStatus::query('mc.ritcraft.net', 30000);
if (!$response) {
    echo "<strong class=\"glyphicon glyphicon-remove\">  Server is offline.</strong>";
} else {
    echo "<img width=\"64\" height=\"64\" src=\"" . $response['favicon'] . "\" /> <br>";
    echo "<strong>mc.ritcraft.net is online</strong>";
    echo "</br><span><em>Version</em>: " . $response['version'] . "</span>";
    echo "</br><span><em>Players</em>: " . $response['players'] . " / " . $response['max_players'] . "</span>";
    echo "</br><span><em>MOTD</em>: " . $response['description'] . "</span>";
}
<?php

include_once 'MinecraftServerStatus/status.class.php';
$status = new MinecraftServerStatus();
$response = $status->getStatus('pvp24.com');
if (!$response) {
    echo "The Server is offline!";
} else {
    echo "<img width=\"64\" height=\"64\" src=\"" . $response['favicon'] . "\" /> <br>\n\t\tThe Server " . $response['hostname'] . " is running on " . $response['version'] . " and is online,\n\t\tcurrently are " . $response['players'] . " players online\n\t\tof a maximum of " . $response['maxplayers'] . ". The motd of the server is '" . $response['motd'] . "'. \n\t\tThe server has a ping of " . $response['ping'] . " milliseconds.";
}
<?php

require_once "status.class.php";
$status = new MinecraftServerStatus();
$ip = $_POST["address"];
if (!isset($ip)) {
    $ip = "afteremerald.us";
}
$port = $_POST["port"];
if (!isset($port)) {
    $port = 25565;
}
$response = $status->getStatus($ip, $port, '1.8.*');
if (!$response) {
    echo "Server is Offline";
} else {
    echo preg_replace("§[0-z]", "", json_encode($response));
}
#!/usr/bin/php
<?php 
// Munin plugin for monitoring number of players connected to Minecraft
// Written by pazpop and grobux for http://demineurs.fr/
//
// Prerequisite : MinecraftServerStatus.class.php (https://github.com/NoxNebula/Minecraft-Server-Status)
// Compatible and tested with : Minecraft Spigot 1.8.3
//
// First release : (v0.1) 2015-10-29
// Last release :
// Configuration
$ip_host = '127.0.0.1';
$mc_port = '25565';
$path_class = '/usr/share/munin/plugins/MinecraftServerStatus.class.php';
// Main script
if (count($argv) == 2 && $argv[1] == 'config') {
    echo "graph_title Minecraft Users\n";
    echo "graph_vlabel Users\n";
    echo "users.label Users\n";
    echo "users.type GAUGE\n";
    echo "graph_category Minecraft\n";
    echo "graph_info Number of players connected to Minecraft\n";
    exit;
}
require_once $path_class;
$mc = new MinecraftServerStatus($ip_host, $mc_port);
echo "users.value ";
echo $mc->Get('numplayers') . "\n";
exit;
Ejemplo n.º 14
0
						<h2>Sazinies ar mums</h2>
						<p>Tiešā vēstule SkyCore darbiniekiem</p>
					</header>
				</div>
				<div class="container 50%">
				<div class="monitor_block" style="background:url('http://noob.lv/template/nooblv_original/template_images/maps/minecraft/world.png')" >
					<div class="monitor_info">
						<div class="monitor_info_1 pull-left radius3_top-right radius3_bottom-right">mc.skycore.eu</div>
							<div class="monitor_players pull-left radius3_top-right radius3_bottom-right"><b>22</b> / 100</div>
							<div class="monitor_info_2 pull-left radius3_top-right radius3_bottom-right">
						</div>
					</div>
				</div>
					<?php 
include_once 'MinecraftServerStatus/status.class.php';
$status = new MinecraftServerStatus();
$response = $status->getStatus('skycore.eu', 25565, '1.8');
if (!$response) {
    echo "The Server is offline!";
} else {
    echo "<img width=\"64\" height=\"64\" src=\"" . $response['favicon'] . "\" /> <br>\n\t\t\t\t\t\t\tThe Server " . $response['hostname'] . " is running on " . $response['version'] . " and is online,\n\t\t\t\t\t\t\tcurrently are " . $response['players'] . " players online\n\t\t\t\t\t\t\tof a maximum of " . $response['maxplayers'] . ". The motd of the server is '" . $response['motd'] . "'. \n\t\t\t\t\t\t\tThe server has a ping of " . $response['ping'] . " milliseconds.";
}
if ($response['players'] > 0) {
    $players = "Serverī pieslēdzies " . $response['players'] . " spēlētājs";
} elseif ($response['players'] == 0) {
    $players = "Serveris ir tukš!";
}
echo "\n\t\t\t\t\t\t" . $players;
?>
				</div>
			</section>
Ejemplo n.º 15
0
<!DOCTYPE html>
<html>

<head>

<?php 
require_once 'MinecraftServerStatus.class.php';
$Server = new MinecraftServerStatus('Your.servers.IP.address.when.port.number.equals.25565');
?>

<title>TXP-MC Server Admin - Home</title>
<font size="2" face="arial, helvetica" color="silver">


<center>

<h1>Server CPanel - Home</h1>

</head>
<body>
<h3>
To complete setup, please make sure to edit this file, so that in: 

<br/>

$Server = new MinecraftServerStatus('Your.servers.IP.address.when.port.number.equals.25565'); 

<br/>

your server's current (static, if possible) IP address has replaced "Your.servers.IP.address.when.port.number.equals.25565".
Ejemplo n.º 16
0
    <title>RITcraft - unofficial RIT Minecraft Server</title>

    <!-- Favicon -->
    <link rel="icon" type="image/ico" href="favicon.ico">

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="css/portfolio-item.css" rel="stylesheet">

<?php 
include_once 'status.class.php';
// Include the server status monitor script
$status = new MinecraftServerStatus();
?>

</head>

<body>
    <!-- Navigation -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>