Add some basic commands for sysadmins and permission system for them

This commit is contained in:
NG (Graham) committed 2025-10-31 21:02:10 -04:00
1 parent 77b6d8c11f
commit 3ef1aa20d0
13 files changed
+290 -29

No files matched your search

+6
View File
@@ -39,6 +39,12 @@ impl IntercomHandler {
};
emitter.emit(event);
},
IntercomWebServiceUserMessage::Maintenance(msg) => {
let event = super::MaintenanceMode {
message: msg.message,
};
emitter.emit(event);
}
}
} else {
break;
@@ -0,0 +1,18 @@
pub struct MaintenanceMode {
pub message: String,
}
impl <C: Send + Sync + 'static> polariton_server::events::IntoEvent<C> for MaintenanceMode {
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(1);
params.insert(19, polariton::operation::Typed::Str(self.message.clone().into()));
polariton::operation::Event {
code: 3,
params,
}
}
}
+3
View File
@@ -3,3 +3,6 @@ pub use handler::IntercomHandler;
mod dev_message;
pub use dev_message::DevMessage;
mod maintenance_mode;
pub use maintenance_mode::MaintenanceMode;