jfitz / rcon
此包已被废弃,不再维护。未建议替代包。
PHP 7 的 RCON 协议库源代码
1.1
2021-06-20 15:09 UTC
README
RCON 是由源专用服务器使用的协议,它允许通过“远程控制台”向服务器发出控制台命令。此库允许通过 PHP 7 使用 RCON 远程执行游戏服务器命令。
支持 RCON 的游戏服务器包括(但不限于)
- Arma 3
- Garry's Mod
- 7 Days To Die
- Minecraft(Java 版本)
- Rust
- Squad
- ARK:生存进化
安装
使用 composer 安装
composer require jfitz/rcon
用法
# Create new socket $socket = new \Jfitz\Rcon\Socket('127.0.0.1', 'Password123', 25565, 30); # Check connection if ($socket->isConnected()) { # Execute a command $socket->execute('/say Hello World!'); }
贡献
我欢迎对我的所有仓库做出贡献,但请注意以下规则
- 代码必须遵循 PSR 编码标准
- 提交信息必须遵循标准(见下文)
提交信息
任何贡献都必须遵循以下示例的提交信息标准。
Summary of the change
WHAT / WHY: Description of what the change is and why its being done
HOW: Description of how this commit applies to the change
Issue number (if applicable)
示例提交
Implement support for multi-packet responses
When the response packet exceeds 4096 characters it gets split into multiple packets, we need to add support for this so responses don't get truncated
This commit adds support for multi-packet responses by adding a loop in the execute method that will continue to read packets until the end of the response is found