dev-lancer/minecraft-rcon 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dev-lancer/minecraft-rcon

最新稳定版本:v1.0

Composer 安装命令:

composer require dev-lancer/minecraft-rcon

包简介

PHP library to request RCON for Minecraft servers

README 文档

README

PHP library to request RCON for Minecraft servers

Installation

Using Composer

This Rcon library may be installed by issuing the following command:

$ composer require dev-lancer/minecraft-rcon

Example

For this script to work, rcon must be enabled on the server, by setting enable-rcon=true in the server's server.properties file. A password must also be set, and provided in the script.

$host = 'some.minecraftserver.com'; // Server host name or IP
$port = 25575;                      // Port rcon is listening on
$password = 'server-rcon-password'; // rcon.password setting set in server.properties
$timeout = 3;                       // How long to timeout.

use DevLancer\MinecraftRcon;

$rcon = new Rcon($host, $port, $password, $timeout);

if ($rcon->connect()) {
    if ($rcon->sendCommand("say Hello World!") === false) {
        //bad request
    } else {
        echo $rcon->getResponse(); //success
    }
} else {
    echo $rcon->getResponse(); //error
}

统计信息

  • 总下载量: 987
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-26