1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00
Files
ojrc/rc_services_room/src/operations/versioner.rs
2025-03-08 17:16:02 -05:00

31 lines
911 B
Rust

use polariton_server::operations::{Operation, OperationCode};
pub struct VersionTeller;
impl VersionTeller {
const VERSION_NUMBER_KEY: u8 = 112;
const LATEST_VERSION: i32 = 2855;
}
impl <C> Operation<C> for VersionTeller {
type State = ();
type User = crate::UserTy;
fn handle(&self, _: polariton::operation::ParameterTable<C>, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse<C> {
let mut resp_params = std::collections::HashMap::new();
resp_params.insert(Self::VERSION_NUMBER_KEY, polariton::operation::Typed::Int(Self::LATEST_VERSION));
polariton::operation::OperationResponse {
code: 103,
return_code: 0,
message: polariton::operation::Typed::Null,
params: resp_params.into(),
}
}
}
impl OperationCode for VersionTeller {
fn op_code() -> u8 {
103
}
}