adrien-nf/minecraft-server-status
Composer 安装命令:
composer require adrien-nf/minecraft-server-status
包简介
Get informations from a Minecraft server in real time.
README 文档
README
Get informations from a Minecraft server in real time.
Installation
Via composer
composer require adrien-nf/minecraft-server-status
Usage
Server List Ping
No configuration needed from the server, this is the easiest method.
use Ping\Ping; $infos = (new Ping("localhost", 25565))->getInfos(); echo $infos->getVersion(); // 1.20.1 echo $infos->getServerType(); // Vanilla echo $infos->getMotd(); // A Minecraft Server echo $infos->getMaxPlayers(); // 20 echo $infos->getPlayersCount(); // 3 echo $infos->getIp(); // localhost echo $infos->getPort(); // 25565 // With Ping, you only get a partial player list var_dump($infos->getPlayers()); // ["Notch", "Deadmau5"] // Some helper functions echo $infos->isPlayerConnected("Notch"); // true echo $infos->isVanilla(); // true echo $infos->isBukkit(); // false echo $infos->isSpigot(); // false echo $infos->isPaper(); // false
Query
Requires configuration in server.properties:
enable-query=truequery.port=25565
Once this is done, usage is pretty straightforward.
use Queries\JavaServerQuery; $infos = (new JavaServerQuery("localhost", 25565))->getInfos(); echo $infos->getGameType(); // SMP echo $infos->getWorldName(); // world // With Query, you get a full players list var_dump($infos->getPlayers()); // ["Notch", "Deadmau5", "Jeb"] var_dump($infos->getPlugins()); // [["name" => "Shopkeepers", "version" => "2.17.1"], ["name" => "HolographicDisplays", "version" => "3.0.2"]] // Some helper functions echo $infos->getPluginsAsString(); // "Shopkeepers, HolographicDisplays" echo $infos->getPluginsAsString(true); // "Shopkeepers 2.17.1, HolographicDisplays 3.0.2" echo $infos->hasPlugin("Shopkeepers"); // true var_dump($infos->getPluginsAsArray()) // ["Shopkeepers", "HolographicDisplays"] var_dump($infos->getPluginsAsArray(true)) // ["Shopkeepers 2.17.1", "HolographicDisplays 3.0.2"]
Credits
This package has been inspired by xPaw's package, extended and corrected for simpler usage.
adrien-nf/minecraft-server-status 适用场景与选型建议
adrien-nf/minecraft-server-status 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 08 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 adrien-nf/minecraft-server-status 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 adrien-nf/minecraft-server-status 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-06