mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add proof-of-concept server intercom service through auth server
This commit is contained in:
20
rc_services_room/src/events/dev_message.rs
Normal file
20
rc_services_room/src/events/dev_message.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
pub struct DevMessage {
|
||||
pub message: String,
|
||||
pub duration: i32,
|
||||
}
|
||||
|
||||
impl <C: Send + Sync + 'static> polariton_server::events::IntoEvent<C> for DevMessage {
|
||||
const CHANNEL: u8 = 0;
|
||||
const ENCRYPT: bool = true;
|
||||
const RELIABLE: bool = true;
|
||||
|
||||
fn into_event(self) -> polariton::operation::Event<C> {
|
||||
let mut params = polariton::operation::ParameterTable::with_capacity(2);
|
||||
params.insert(2, polariton::operation::Typed::Bytes(self.message.as_bytes().to_vec().into()));
|
||||
params.insert(15, polariton::operation::Typed::Int(self.duration));
|
||||
polariton::operation::Event {
|
||||
code: 1,
|
||||
params,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user