-
-
Notifications
You must be signed in to change notification settings - Fork 126
/
serverinfo.php
34 lines (34 loc) · 961 Bytes
/
serverinfo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<div class="well widget">
<div class="header">
Server Information
</div>
<div class="body">
<ul>
<?php
$status = true;
if ($config['status']['status_check']) {
@$sock = fsockopen ($config['status']['status_ip'], $config['status']['status_port'], $errno, $errstr, 1);
if(!$sock) {
echo "<span style='color:red;font-weight:bold;'><center>Server Offline!</center></span><br/>";
$status = false;
}
else {
$info = chr(6).chr(0).chr(255).chr(255).'info';
fwrite($sock, $info);
$data='';
while (!feof($sock))$data .= fgets($sock, 1024);
fclose($sock);
echo "<span style='color:green;font-weight:bold;'><center>Server Online!</center></span><br />";
}
}
if ($status) {
?>
<li><a href="onlinelist.php">Players online:
<?php echo user_count_online(); ?></a></li>
<?php
}
?>
<li>Registered accounts: <?php echo user_count_accounts();?></li>
</ul>
</div>
</div>