1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Add server for game data (implement login sequence)

This commit is contained in:
NGnius (Graham)
2025-02-12 18:46:27 -05:00
parent ca4a0ce675
commit d8885d811f
52 changed files with 2734 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
use std::collections::HashMap;
use polariton_server::operations::{Operation, OperationCode};
pub struct MaintenanceModeTeller;
impl Operation for MaintenanceModeTeller {
type State = ();
type User = crate::UserTy;
fn handle(&self, _: polariton::operation::ParameterTable, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse {
let mut resp_params = HashMap::new();
resp_params.insert(20 /* is in maintenance mode? */, polariton::operation::Typed::Bool(false.into()));
resp_params.insert(19 /* maintenace mode message */, polariton::operation::Typed::Str("OpenJam's servers are currently undergoing maintenance".into()));
polariton::operation::OperationResponse {
code: 20,
return_code: 0,
message: polariton::operation::Typed::Null,
params: resp_params.into(),
}
}
}
impl OperationCode for MaintenanceModeTeller {
fn op_code() -> u8 {
20
}
}