在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):noxifoxi/minecraft-server-status开源软件地址(OpenSource Url):https://github.com/noxifoxi/minecraft-server-status开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):Lightweight Minecraft server status script for PHPCopyright noxifoxi https://github.com/noxifoxi/minecraft-server-status This lightweight script queries the server information from Minecraft java servers.
Features
Requirements
How to use the scriptThe server.properties has to include the following settings: enable-query=true
query.port=25565 <?php
require_once('MinecraftServerStatus.class.php');
$Server = new MinecraftServerStatus('example-minecraft-host.com');
?> MinecraftServerStatus($Host, $Port = 25565, $Timeout = 1) Check online/offline$Server->Get('online'); If the server is online the return value is true otherwise its false. Get player countecho $Server->Get('numplayers').' / '.$Server->Get('maxplayers'); Get a list of the online players namesforeach($Server->Get('players') as $Player)
echo $Player.'<br>';
Get everything$ServerStatus = $Server->Get(); Returns an array with every information the script was able to fetch. All available "hooks"Most of these hooks are only available if the server has query enabled or is non-vanilla.
Check if Fallback
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论