{"id":15693371,"url":"https://github.com/cortexpe/pmrcon","last_synced_at":"2025-05-08T03:50:04.694Z","repository":{"id":137222665,"uuid":"162882653","full_name":"CortexPE/PMRCON","owner":"CortexPE","description":"A PocketMine-MP Virion to easily send RCON Commands to remote Minecraft / PocketMine-MP Servers","archived":false,"fork":false,"pushed_at":"2020-04-01T16:05:28.000Z","size":37,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T03:49:58.110Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CortexPE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-23T10:48:28.000Z","updated_at":"2021-04-27T11:43:50.000Z","dependencies_parsed_at":"2024-03-30T20:30:59.090Z","dependency_job_id":null,"html_url":"https://github.com/CortexPE/PMRCON","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CortexPE%2FPMRCON","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CortexPE%2FPMRCON/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CortexPE%2FPMRCON/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CortexPE%2FPMRCON/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CortexPE","download_url":"https://codeload.github.com/CortexPE/PMRCON/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252996228,"owners_count":21837617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T18:43:08.022Z","updated_at":"2025-05-08T03:50:04.658Z","avatar_url":"https://github.com/CortexPE.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003ePMRCON\u003cimg src=\"https://raw.githubusercontent.com/CortexPE/PMRCON/master/pmrcon.png\" height=\"64\" width=\"64\" align=\"left\"\u003e\u003c/img\u003e\u0026nbsp;\u003cimg src=\"https://poggit.pmmp.io/ci.shield/CortexPE/PMRCON/~\"\u003e\u003c/img\u003e\u003c/h1\u003e\r\n\u003cbr /\u003e\r\n\r\nA PocketMine-MP Virion to easily send RCON Commands to remote Minecraft / PocketMine-MP Servers\r\n\r\n# Usage:\r\nInstallation is easy, you may get a compiled phar [here](https://poggit.pmmp.io/ci/CortexPE/PMRCON/~) or integrate the virion itself into your plugin.\r\n\r\nThis virion is purely object oriented. So, to use it you'll just have to import the `RCONClient` object.\r\n\r\n## Basic Usage:\r\n### Import the classes\r\nYou'll need to import this class in order to easily use it within our code.\r\n```php\r\n\u003c?php\r\n\r\nuse CortexPE\\PMRCON\\RCONClient;\r\nuse pocketmine\\Server; // optional, only used here in the example to easily get the server's logger\r\n```\r\n### Construct the `RCONClient` object\r\nYou'll need the remote server's IP Address, Port, and the RCON Password for this.\r\n\r\nYou'll have to supply the timeout seconds as well, `2` seconds is the recommended value.\r\n\r\nSupply the server's logger (You cannot use the plugin's logger) and that's all that's needed.\r\n\r\nThis will start a new `RCONClientThread` thread and automatically attempt to login.\r\n```php\r\n// $rcon = new RCONClient(\"tcp://ADDRESS HERE\", PORT, \"PASSWORD\", TIMEOUT, Server::getInstance()-\u003egetLogger());\r\n$rconClient = new RCONClient(\"tcp://127.0.0.1\", 19133, \"SuperStronkPassword\", 2, Server::getInstance()-\u003egetLogger());\r\n```\r\n### Sending the commands\r\nYou can easily send commands to the remote server now! This will enqueue the command to the `RCONClientThread`s command queue then send it to the remote server, whenever possible.\r\n```php\r\n$rconClient-\u003esendCommand(\"say Hello World!\");\r\n```\r\n### Stopping the client\r\nThis is necessary for a smooth, clean shutdown of the server, This should usually be done on your plugin's `onDisable` method.\r\n\r\nExecuting it will stop the thread's loop, then close the socket used to connect to the remote server.\r\n```php\r\n$rconClient-\u003estop();\r\n```\r\nEasy as 1-2-3! :tada:\r\n# Sample Code used to test this API earlier:\r\n```php\r\n$rconClient = new RCONClient(\"tcp://127.0.0.1\", 19133, \"ILYErinUwU\", 2, Server::getInstance()-\u003egetLogger());\r\n$rconClient-\u003esendCommand(\"say IT WORKS!\");\r\n$this-\u003egetScheduler()-\u003escheduleDelayedTask(new ClosureTask(function(int $currentTick) use ($rconClient) : void {\r\n\t$rconClient-\u003estop();\r\n}), 100); // Stop the RCON Client after 5 seconds\r\n```\r\n-----\r\n**This API was made with :heart: by CortexPE, Enjoy!~ :3**\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcortexpe%2Fpmrcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcortexpe%2Fpmrcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcortexpe%2Fpmrcon/lists"}