Skip to content

micschwarz/PHP-Rcon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Rcon

PHP 7.4

A small and easy to use rcon connector

Example

A complete example can be found in /example. It requires composer and docker-compose You can test it with the docker-minecraft-server by running docker-compose up. To start the included example run composer run-script start-example and navigate to localhost:8000

Usage

Connect

1.Step: Create Rcon Connector

$rcon = new Rcon('localhost', '28016', 'testing'); // Connect to localhost:28016 with Password "testing"

2.Step: Connect and Authorize Throws ConnectionException on Connection Error (Rcon Server not available, etc.). Returns false if supplied password is wrong.

$authorized = $rcon->connect();

Execute Command

Throws ConnectionNotOpenException if connection has not been opened yet.

$playerList = $rcon->execCommand('list'); // List all players

About

A small and easy to use rcon connector

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages