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/league_limits.rs
2025-03-08 17:16:02 -05:00

20 lines
769 B
Rust

use polariton_server::operations::SimpleFunc;
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
const PARAM_KEY: u8 = 1;
pub(super) fn league_battle_parameters_provider() -> SimpleFunc<57, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: TypePrefix::Str, //str
val_ty: TypePrefix::Any, // obj
items: vec![
(Typed::Str("playerLevelRequired".into()), Typed::Int(10)),
(Typed::Str("minCpu".into()), Typed::Int(100)),
],
}));
Ok(params.into())
})
}