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:
1 parent
ca4a0ce675
commit
d8885d811f
52 files changed
+2734
-5
No files matched your search
@@ -0,0 +1,30 @@
|
||||
use polariton_server::operations::{Operation, OperationCode};
|
||||
|
||||
pub struct VersionTeller;
|
||||
|
||||
impl VersionTeller {
|
||||
const VERSION_NUMBER_KEY: u8 = 112;
|
||||
const LATEST_VERSION: i32 = 2855;
|
||||
}
|
||||
|
||||
impl Operation for VersionTeller {
|
||||
type State = ();
|
||||
type User = crate::UserTy;
|
||||
|
||||
fn handle(&self, _: polariton::operation::ParameterTable, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse {
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user