rkon

Crates.iorkon
lib.rsrkon
version0.1.0
created_at2025-04-16 03:41:41.680389+00
updated_at2025-04-16 03:41:41.680389+00
descriptionYet another RCON library.
homepage
repositoryhttps://codeberg.org/redstrate/rkon
max_upload_size
id1635776
size42,696
Joshua Goins (redstrate)

documentation

README

rkon

Yet another RCON library.

Features

  • No dependencies except for std.
  • Exposes the internal Packet structure, useful for writing a server.

Client

An example client is available under examples/client.rs which uses the Client type.

Server

Since an RCON server would be tightly integrated with the game server, it doesn't make sense to provide a generic solution. Instead, you can use this crate to encode packets:

// read from client
let mut resp_bytes = [0u8; MAX_PACKET_SIZE];
stream.read(&mut resp_bytes).unwrap();

// decode
let request = Packet::decode(&resp_bytes);

// send response
let response = Packet {
    request_id: request.request_id,
    PacketType::Command,
    body: "foobar"
};
let encoded = response.encode();

// send to the client
stream.write_all(&encoded).unwrap();

Credits

Thanks to the minecraft-client-rs project where some of this code is based off of. I took a different approach for the API, and plan on expanding support beyond just Minecraft.

License

GPLv3

This project is licensed under the GNU General Public License 3.

Commit count: 0

cargo fmt