omegga-rs
Omegga RPC interface library for Rust.
Usage
To enable support for serializing/deserializing into brickadia-rs
save objects, use the optional feature brs
:
omegga = { version = "1.0", features = "brs" }
The following is a sample plugin:
use omegga::{events::Event, Omegga};
#[tokio::main]
async fn main() {
let omegga = Omegga::new();
let mut events = omegga.spawn();
while let Some(event) = events.recv().await {
match event {
Event::Init { id, .. } => omegga.register_commands(id, &["ping"]),
Event::Stop { id, .. } => omegga.write_response(id, None, None),
Event::Command {
player, command, ..
} => match command.as_str() {
"ping" => omegga.whisper(player, "Pong!"),
_ => (),
},
_ => (),
}
}
}
It is recommended to check the Omegga RPC reference.
Credits
- voximity - creator, maintainer
- Meshiest - Omegga