承接 dev-lancer/minecraft-rcon 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

dev-lancer/minecraft-rcon

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
}

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固