开源软件名称(OpenSource Name):thedudeguy/PHP-Minecraft-Rcon开源软件地址(OpenSource Url):https://github.com/thedudeguy/PHP-Minecraft-Rcon开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):PHP-Minecraft-RconSimple Rcon class for php. InstallationUsing ComposerThis Rcon library may be installed by issuing the following command: $ composer require thedudeguy/rcon Not Using ComposerIf not using Composer, just place the Rcon.php file in your project and include it in your PHP script: require_once('Rcon.php'); ExampleFor this script to work, rcon must be enabled on the server, by setting $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 Thedudeguy\Rcon;
$rcon = new Rcon($host, $port, $password, $timeout);
if ($rcon->connect())
{
$rcon->sendCommand("say Hello World!");
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论