{"id":22100612,"url":"https://github.com/mrgraversen/rust-rcon","last_synced_at":"2026-06-07T13:01:05.513Z","repository":{"id":39960839,"uuid":"135890451","full_name":"MrGraversen/rust-rcon","owner":"MrGraversen","description":"An async, fault-tolerant Java RCON client for the Rust game. Seamlessly integrate with Rust's RCON over websockets, translating game events into actionable insights.","archived":false,"fork":false,"pushed_at":"2026-05-29T17:01:24.000Z","size":469,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-05-29T19:04:53.906Z","etag":null,"topics":["playrust","rcon","rust-game","rust-rcon","rust-server","server-admin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrGraversen.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,"zenodo":null}},"created_at":"2018-06-03T09:25:08.000Z","updated_at":"2026-05-29T17:01:18.000Z","dependencies_parsed_at":"2025-05-09T20:37:16.124Z","dependency_job_id":null,"html_url":"https://github.com/MrGraversen/rust-rcon","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/MrGraversen/rust-rcon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGraversen%2Frust-rcon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGraversen%2Frust-rcon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGraversen%2Frust-rcon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGraversen%2Frust-rcon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrGraversen","download_url":"https://codeload.github.com/MrGraversen/rust-rcon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGraversen%2Frust-rcon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34022032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["playrust","rcon","rust-game","rust-rcon","rust-server","server-admin"],"created_at":"2024-12-01T05:15:05.713Z","updated_at":"2026-06-07T13:01:05.505Z","avatar_url":"https://github.com/MrGraversen.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust RCON 🎮\n\nAn asynchronous, fault-tolerant Rust RCON client built in Java.\n\nRust RCON connects to a Rust game server over WebRCON, exposes command codecs for common admin tasks, and translates server output into application-friendly events. It is designed for server tooling, dashboards, automation, and admin assistants that need a resilient connection to a live Rust server.\n\n## About 📝\n\nThis library is the Rust counterpart to [minecraft-rcon](https://github.com/MrGraversen/minecraft-rcon).\n\nOut of the box, Rust RCON works with a vanilla Rust server by parsing events from the RCON stream. For richer event coverage, it can also run in an optional uMod bridge mode. In that mode, a small uMod plugin emits structured event envelopes through the server log, while the Java client continues to use RCON for commands and server interaction.\n\nThe connection is resilient. If the game server goes offline or restarts, the client reconnects once the server becomes available again.\n\n## Event Source Strategies\n\nRust RCON supports two event source strategies:\n\n### RCON\n\n`RCON` is the default strategy and works with vanilla Rust servers. Events are parsed from the normal RCON/log output that Rust exposes.\n\nUse this when compatibility matters most or when the server does not run uMod.\n\n```java\nimport io.graversen.rust.rcon.DefaultRustRconService;\nimport io.graversen.rust.rcon.RustRconConfiguration;\n\npublic class VanillaRustRconExample {\n    public static void main(String[] args) {\n        final var configuration = new RustRconConfiguration(\n                \"localhost\",\n                28016,\n                \"rcon-password\"\n        );\n\n        final var service = new DefaultRustRconService(configuration);\n        service.start();\n    }\n}\n```\n\n### UMOD\n\n`UMOD` is an opt-in strategy for servers running uMod. It uses `src/main/umod/RustRconBridge.cs` to emit structured bridge events that the Java client maps into normal Rust RCON events.\n\nIn UMOD mode, the server still receives commands through RCON. The difference is event sourcing: events come from the uMod bridge instead of vanilla log parsing.\n\n```java\nimport io.graversen.rust.rcon.DefaultRustRconService;\nimport io.graversen.rust.rcon.RustRconConfiguration;\nimport io.graversen.rust.rcon.event.RustEventSourceStrategy;\n\npublic class UmodRustRconExample {\n    public static void main(String[] args) {\n        final var configuration = new RustRconConfiguration(\n                \"localhost\",\n                28016,\n                \"rcon-password\",\n                RustEventSourceStrategy.UMOD\n        );\n\n        final var service = new DefaultRustRconService(configuration);\n        service.start();\n    }\n}\n```\n\nYou can check whether the bridge plugin is loaded:\n\n```java\nimport io.graversen.rust.rcon.DefaultRustRconService;\nimport io.graversen.rust.rcon.RustRconConfiguration;\nimport io.graversen.rust.rcon.event.RustEventSourceStrategy;\nimport lombok.extern.slf4j.Slf4j;\n\n@Slf4j\npublic class UmodBridgeCheckExample {\n    public static void main(String[] args) {\n        final var configuration = new RustRconConfiguration(\n                \"localhost\",\n                28016,\n                \"rcon-password\",\n                RustEventSourceStrategy.UMOD\n        );\n\n        final var service = new DefaultRustRconService(configuration);\n        service.start();\n\n        final var isInstalled = service.umodBridgeManagement()\n                .isRustRconBridgeInstalled()\n                .join();\n\n        log.info(\"RustRconBridge installed: {}\", isInstalled);\n        service.stop();\n    }\n}\n```\n\n## Installation 💾\n\nRust RCON is available through Maven from GitHub Packages.\n\n⚠️ Even though this project is public, GitHub Packages still requires authentication.\n\nFrom the GitHub documentation:\n\n\u003e If you want to download and use a package from a public repository, you don't need access to the repository. However, you must be authenticated to GitHub Packages under a user account that has a GitHub Free plan.\n\nCreate a GitHub Personal Access Token with at least the `read:packages` scope:\n\n[Create token](https://github.com/settings/tokens/new?scopes=read:packages\u0026description=Rust+Rcon+GitHub+Packages+Access)\n\nConfigure Maven in `~/.m2/settings.xml`:\n\n```xml\n\u003cservers\u003e\n  \u003cserver\u003e\n    \u003cid\u003egithub\u003c/id\u003e\n    \u003cusername\u003eYOUR_GITHUB_USERNAME\u003c/username\u003e\n    \u003cpassword\u003eYOUR_PERSONAL_ACCESS_TOKEN\u003c/password\u003e\n  \u003c/server\u003e\n\u003c/servers\u003e\n```\n\nAdd the GitHub Packages repository:\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003egithub\u003c/id\u003e\n        \u003curl\u003ehttps://maven.pkg.github.com/MrGraversen/rust-rcon\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\nAdd the dependency:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.graversen\u003c/groupId\u003e\n    \u003cartifactId\u003erust-rcon\u003c/artifactId\u003e\n    \u003cversion\u003e${io.graversen.rust.rcon-version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage ⚗️\n\n```java\nimport com.google.common.eventbus.Subscribe;\nimport io.graversen.rust.rcon.DefaultRustRconService;\nimport io.graversen.rust.rcon.RustRconConfiguration;\nimport io.graversen.rust.rcon.event.player.PlayerChatEvent;\nimport io.graversen.rust.rcon.event.server.WorldEvent;\nimport lombok.extern.slf4j.Slf4j;\n\n@Slf4j\npublic class RustRconEventsExample {\n    public static void main(String[] args) throws InterruptedException {\n        final var configuration = new RustRconConfiguration(\n                \"localhost\",\n                28016,\n                \"rcon-password\"\n        );\n\n        final var service = new DefaultRustRconService(configuration);\n        service.registerEvents(new RustEventSubscriber());\n        service.start();\n\n        Thread.currentThread().join();\n    }\n\n    static class RustEventSubscriber {\n        @Subscribe\n        public void onPlayerChat(PlayerChatEvent event) {\n            log.info(\"{}: {}\", event.getPlayerName().get(), event.getMessage());\n        }\n\n        @Subscribe\n        public void onWorldEvent(WorldEvent event) {\n            log.info(\"{} {}\", event.getEvent(), event.getAttributes());\n        }\n    }\n}\n```\n\nThe service also exposes management APIs for server info, players, teams, Oxide/uMod plugins, and command codecs:\n\n```java\nimport io.graversen.rust.rcon.DefaultRustRconService;\nimport io.graversen.rust.rcon.RustRconConfiguration;\nimport lombok.extern.slf4j.Slf4j;\n\n@Slf4j\npublic class RustRconManagementExample {\n    public static void main(String[] args) {\n        final var configuration = new RustRconConfiguration(\n                \"localhost\",\n                28016,\n                \"rcon-password\"\n        );\n\n        final var service = new DefaultRustRconService(configuration);\n        service.start();\n\n        final var serverInfo = service.serverInfo().join();\n        final var players = service.players();\n        final var teams = service.teams();\n        final var adminCodec = service.codec().admin();\n        final var oxideCodec = service.codec().oxide();\n\n        log.info(\"Server info: {}\", serverInfo);\n        log.info(\"Players: {}\", players);\n        log.info(\"Teams: {}\", teams);\n        log.info(\"Admin codec: {}\", adminCodec);\n        log.info(\"Oxide codec: {}\", oxideCodec);\n\n        service.stop();\n    }\n}\n```\n\n## Events 🚀\n\nRust RCON exposes events through a small event bus. Supported events depend on the configured event source strategy.\n\nYou can inspect supported events at runtime:\n\n```java\nimport io.graversen.rust.rcon.DefaultRustRconService;\nimport io.graversen.rust.rcon.RustRconConfiguration;\nimport io.graversen.rust.rcon.event.player.PlayerChatEvent;\nimport lombok.extern.slf4j.Slf4j;\n\n@Slf4j\npublic class RustRconCapabilitiesExample {\n    public static void main(String[] args) {\n        final var configuration = new RustRconConfiguration(\n                \"localhost\",\n                28016,\n                \"rcon-password\"\n        );\n\n        final var service = new DefaultRustRconService(configuration);\n        final var capabilities = service.eventCapabilities();\n\n        log.info(\"Event strategy: {}\", capabilities.getStrategy());\n        log.info(\"Supports chat events: {}\", capabilities.supports(PlayerChatEvent.class));\n    }\n}\n```\n\n### RCON Events\n\nThe default RCON strategy supports events that can be inferred from vanilla Rust server output.\n\nPlayer events:\n\n- `PlayerChatEvent`\n- `PlayerConnectedEvent`\n- `PlayerDeathEvent`\n- `PlayerDisconnectedEvent`\n- `PlayerMiniCopterCrashedEvent`\n- `PlayerSuicideEvent`\n\nServer and world events:\n\n- `EasyAntiCheatEvent`\n- `EntityCommandEvent`\n- `ItemDisappearedEvent`\n- `SaveEvent`\n- `ServerInfoEvent`\n- `WorldEvent`\n\nOxide log events:\n\n- `OxidePluginEvent`\n\nRCON and websocket events:\n\n- `RconProtocolExchangeEvent`\n- `RconReceivedEvent`\n- `WsOpenedEvent`\n- `WsMessageEvent`\n- `WsErrorEvent`\n- `WsClosedEvent`\n\n### UMOD Bridge Events\n\nThe UMOD strategy emits structured bridge events through `RustRconBridge.cs`. It currently supports the following event families.\n\nPlayer activity:\n\n- `PlayerChatEvent`\n- `PlayerConnectedEvent`\n- `PlayerDisconnectedEvent`\n- `PlayerDeathEvent`\n- `PlayerRespawnedEvent`\n- `PlayerWoundedEvent`\n- `PlayerRecoveredEvent`\n\nModeration and admin insight:\n\n- `PlayerKickedEvent`\n- `PlayerBannedEvent`\n- `PlayerUnbannedEvent`\n- `PlayerReportedEvent`\n- `PlayerViolationEvent`\n\nServer lifecycle:\n\n- `ServerInitializedEvent`\n- `SaveEvent`\n- `ServerShutdownEvent`\n\nTeam and explosive use:\n\n- `TeamEvent`\n- `ExplosiveUseEvent`\n\nWorld and objective events:\n\n- `WorldEvent`\n\n`WorldEvent` includes an event type and optional string attributes. In UMOD mode this covers low-volume, high-signal objective events such as:\n\n- `AIRDROP`\n- `SUPPLY_DROP_DROPPED`\n- `SUPPLY_DROP_LANDED`\n- `CARGO_SHIP_HARBOR_APPROACH`\n- `CARGO_SHIP_HARBOR_ARRIVED`\n- `CARGO_SHIP_HARBOR_LEFT`\n- `LOCKED_CRATE_LANDED`\n- `LOCKED_CRATE_HACK_STARTED`\n- `LOCKED_CRATE_HACK_COMPLETED`\n- `PATROL_HELICOPTER_KILLED`\n- `BRADLEY_APC_DESTROYED`\n- `MLRS_FIRED`\n\nBridge diagnostics:\n\n- `UmodBridgeDiagnosticEvent`\n\nDiagnostics are emitted when bridge payloads are malformed, unsupported, or unknown to the Java client.\n\n## uMod Bridge Plugin\n\nThe bridge plugin source lives at:\n\n```text\nsrc/main/umod/RustRconBridge.cs\n```\n\nInstall it like a normal uMod plugin by placing it in the server's uMod plugins folder. Once loaded, it writes structured messages with the `[rust-rcon]` prefix. The Java client consumes those messages only when configured with `RustEventSourceStrategy.UMOD`.\n\nThe bridge intentionally focuses on low-volume, high-value signals. It avoids broad hooks such as general entity damage, item pickup, resource gathering, player input, and weapon fire because those can become noisy and expensive on a live server.\n\n## Useful Resources\n\n- https://steamid.io/ - translate between Steam IDs\n- https://www.corrosionhour.com/rust-item-list/ - Rust items and short names\n- https://umod.org/documentation/games/rust - uMod Rust documentation\n- https://docs.oxidemod.com/hooks/ - Oxide/uMod hook reference\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrgraversen%2Frust-rcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrgraversen%2Frust-rcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrgraversen%2Frust-rcon/lists"}