• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

spravil/PHP-Minecraft-Server-Status-Query: Minecraft Server Status Query, writte ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

spravil/PHP-Minecraft-Server-Status-Query

开源软件地址(OpenSource Url):

https://github.com/spravil/PHP-Minecraft-Server-Status-Query

开源编程语言(OpenSource Language):

PHP 100.0%

开源软件介绍(OpenSource Introduction):

Minecraft Server Status Query [Discontinued]

Latest Stable Version Total Downloads Latest Unstable Version License

Minecraft Server Status Query, written in PHP, with online players, motd, favicon and more server related informations without plugins and enable-query.

Tested with Spigot 1.9 and Bungeecord 1.9 & 1.8

Installation

composer require funnyitselmo/minecraftserverstatus

Tutorial

use MinecraftServerStatus\MinecraftServerStatus;

require '../vendor/autoload.php';

$response = MinecraftServerStatus::query('lostforce.com', 25565);

if (! $response) {
    echo "The Server is offline!";
} else {
    echo "<img width=\"64\" height=\"64\" src=\"" . $response['favicon'] . "\" /> <br>
		The Server " . $response['hostname'] . " is running on " . $response['version'] . " and is online,
		currently are " . $response['players'] . " players online
		of a maximum of " . $response['max_players'] . ". The motd of the server is '" . $response['description'] . "'.
		The server has a ping of " . $response['ping'] . " milliseconds.";
}

If the server is offline MinecraftServerStatus::query returns false else it returns an array which contains the server informations.

Variables

The following table contains the available variables the response can contain. The default value of each variable is false.

Array Index Description
'hostname'
Exact server address in 127.0.0.1 format
'port'
The servers port for example 25565
'ping'
The time in ms the server needs to answer
'version'
The server version
(for example: 1.9)
'protocol'
The server protocol
(for example: 107)
'players'
Amount of players who are currently online
'max_players'
Number of the slots of the server
'description'
The message of the day of the server
'description_raw'
The raw version of description
(contains color codes etc.)
'favicon'
The favicon of the server in a base64 string
(Can be displayed with the html img tag by setting the string as src)
'modinfo'
Informations about the plugins



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap