Skip to content

alex-cool-tech/php-rcon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP-Rcon

Scrutinizer Code Quality Build Status

Simple Rcon class for php.

Project forked from thedudeguy/PHP-Minecraft-Rcon

Installation

Using Composer

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

$ composer require alex.cool/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.

require_once __DIR__ . '/vendor/autoload.php';

use AlexCool\Rcon\Client\MinecraftClient;

$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.

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

if ($rcon->connect()) {
  $rcon->sendCommand("say Hello World!");
}

About

RCON library for PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%