rkon 0.1.0

Yet another RCON library.
Documentation
  • Coverage
  • 95%
    19 out of 20 items documented0 out of 8 items with examples
  • Size
  • Source code size: 42.22 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.04 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • redstrate

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.