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:
25
rc_services_room/src/operations/special_items.rs
Normal file
25
rc_services_room/src/operations/special_items.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::operation::{ParameterTable, Typed, Dict};
|
||||
|
||||
use crate::data::special_item::*;
|
||||
|
||||
const PARAM_KEY: u8 = 1;
|
||||
|
||||
pub(super) fn special_item_list_provider() -> SimpleFunc<6, 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: 115, // str
|
||||
val_ty: 104, // hashtable
|
||||
items: vec![
|
||||
//(u32 in base16 aka hex, hashtable)
|
||||
(Typed::Str("DEADBEEF".into()), SpecialItem {
|
||||
name: "cool".to_string(),
|
||||
sprite: "chair".to_string(),
|
||||
size: 1,
|
||||
}.as_transmissible())
|
||||
].into(),
|
||||
}));
|
||||
Ok(params.into())
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user