This repository was archived by the owner on Mar 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueryjp.php
84 lines (83 loc) · 2.7 KB
/
queryjp.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
//The following script is tested only with servers running on pmmp1.6.
$SERVER_IP="127.0.0.1"; //ipアドレス
$port = 19132; //ポート
$url = "http://minecraft-api.com/api/query/";
$ipp = ".php?ip=".$SERVER_IP."&port=".$port;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MC PHP Query</title>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css">
<link href='http://fonts.googleapis.com/css?family=Lato:300,400' rel='stylesheet' type='text/css'>
<link href="https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script type="text/javascript" src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script>
jQuery(function ($) {
$("a").tooltip()
});
</script>
<style>
/*Custom CSS Overrides*/
body {
font-family: 'Lato', sans-serif !important;
}
</style>
</head>
<body>
<div class="container">
<h1>MC PHP Query</h1><hr>
<div class="row">
<div class="span4">
<h3>サーバー情報</h3>
<table class="table table-striped">
<tbody>
<tr>
<td><b>サーバー名</b></td>
<td><?php echo file_get_contents($url."motd".$ipp); ?></td>
</tr>
<tr>
<td><b>IP</b></td>
<td><?php echo $SERVER_IP.":".$port; ?></td>
</tr>
<tr>
<td><b>バージョン</b></td>
<td><?php echo file_get_contents($url."version".$ipp); ?></td>
</tr>
<tr>
<td><b>プレイヤー数</b></td>
<td><?php echo "".file_get_contents($url."playeronline".$ipp)." / ".file_get_contents($url."maxplayer".$ipp)."";?></td>
</tr>
<tr>
<td><b>ステータス</b></td>
<td><? if(file_get_contents($url."statut".$ipp) == 'En ligne') { echo "<i class=\"icon-ok-sign\"></i>オンライン"; } else { echo "<i class=\"icon-remove-sign\"></i>オフライン";}?></td>
</tr>
<!-- not working!
<tr>
<td><b>Latency</b></td>
<td><?php echo "".file_get_contents('http://minecraft-api.com/api/ping/ping.php?ip='.$SERVER_IP.'&port='.$port)."ms"; ?></td>
</tr>
-->
</tbody>
</table>
</div>
<div class="span8">
<h3>プレイヤーリスト</h3>
<?php
$list = file_get_contents($url."playerlist".$ipp);
if($list != null) {
echo $list;
}
//何も表示されなければ
else {
echo "<div class=\"alert\"> プレイヤーがいないようです。</div>";
}
?>
</div>
</div>
</div>
</body>
</html>