loper/minecraft-query-client
Composer 安装命令:
composer require loper/minecraft-query-client
包简介
Minecraft Query Client by TCP and UDP protocols.
README 文档
README
Simple implementation of Server List Ping and Query for getting status of Minecraft Server.
Installation
composer require loper/minecraft-query-client
Examples
Server List Ping
examples/java-ping.php
#!/usr/bin/env php <?php declare(strict_types=1); use Loper\Minecraft\Protocol\Struct\JavaProtocolVersion; use Loper\MinecraftQueryClient\MinecraftQuery; require_once __DIR__ . '/bootstrap.php'; return static function (string $host, int $port) { var_dump(MinecraftQuery::javaPing( host: $host, port: $port, protocol: JavaProtocolVersion::JAVA_1_7_1 )); };
Query
examples/java-query.php
#!/usr/bin/env php <?php declare(strict_types=1); use Loper\Minecraft\Protocol\Struct\JavaProtocolVersion; use Loper\MinecraftQueryClient\MinecraftQuery; require_once __DIR__ . '/bootstrap.php'; return static function (string $host, int $port) { var_dump(MinecraftQuery::queryPing( host: $host, port: $port, protocol: JavaProtocolVersion::JAVA_1_7_1 )); };
Aggregated result from Query protocol & Minecraft server ping
examples/java-both.php
#!/usr/bin/env php <?php declare(strict_types=1); use Loper\Minecraft\Protocol\Struct\JavaProtocolVersion; use Loper\MinecraftQueryClient\MinecraftQuery; require_once __DIR__ . '/bootstrap.php'; return static function (string $host, int $port) { var_dump(MinecraftQuery::javaQueryPing( host: $host, port: $port, protocol: JavaProtocolVersion::JAVA_1_7_1 )); };
Bedrock
examples/bedrock-ping.php
#!/usr/bin/env php <?php declare(strict_types=1); use Loper\Minecraft\Protocol\Struct\BedrockProtocolVersion; use Loper\MinecraftQueryClient\MinecraftQuery; require_once __DIR__ . '/bootstrap.php'; return static function (string $host, int $port) { var_dump(MinecraftQuery::bedrockPing( host: $host, port: $port, protocol: BedrockProtocolVersion::BEDROCK_1_20_15 )); };
Credits
统计信息
- 总下载量: 356
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-02