mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add social server and implement all op codes up until chat room connection blocks further requests
This commit is contained in:
1 parent
d8885d811f
commit
2907376722
76 files changed
+3052
-7
No files matched your search
@@ -0,0 +1,25 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::operation::{ParameterTable, Typed, Dict};
|
||||
|
||||
const PARAM_KEY: u8 = 1;
|
||||
|
||||
pub(super) fn garage_upgrades_provider() -> SimpleFunc<1, 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::HashMap(vec![
|
||||
(Typed::Str("cpuIncreaseCost".into()), Typed::Dict(Dict {
|
||||
key_ty: 110, // int
|
||||
val_ty: 110, // int
|
||||
items: vec![
|
||||
// (CPU limit, upgrade cost)
|
||||
(Typed::Int(100), Typed::Int(100)),
|
||||
(Typed::Int(200), Typed::Int(200)),
|
||||
(Typed::Int(1_000), Typed::Int(1_000)),
|
||||
(Typed::Int(2_000), Typed::Int(2_000)), // max regular bot CPU
|
||||
(Typed::Int(10_000), Typed::Int(10_000)), // max mega bot cpu
|
||||
],
|
||||
}))
|
||||
].into()));
|
||||
Ok(params.into())
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user