mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
### Description This implements and completes #87 (to the best of my knowledge) ### Game Robocraft ### Please confirm - [x] I am the legal owner or represent the owner of all work submitted - [x] I consent to my submission being added to this FOSS project - [ ] This PR used LLMs to generate some or all of the code changes Reviewed-on: https://git.ngram.ca/OpenJam/rc-servers/pulls/91 Co-authored-by: NG (Graham) <ngniusness@gmail.com> Co-committed-by: NG (Graham) <ngniusness@gmail.com>
29 lines
1.0 KiB
Rust
29 lines
1.0 KiB
Rust
use polariton_server::operations::SimpleFunc;
|
|
use polariton::operation::{ParameterTable, Typed, Arr};
|
|
|
|
//use crate::data::clan_invite::*;
|
|
|
|
const PARAM_KEY: u8 = 42;
|
|
|
|
pub(super) fn clan_invites_provider<C: Send + Sync>() -> SimpleFunc<39, crate::UserTy, impl (Fn(ParameterTable<C>, &crate::UserTy) -> Result<ParameterTable<C>, i16>) + Sync + Sync, C> {
|
|
SimpleFunc::new(|params, _| {
|
|
let mut params = params.to_dict();
|
|
params.insert(PARAM_KEY, Typed::<C>::Arr(Arr {
|
|
ty: polariton::serdes::TypePrefix::HashMap, // hashmap
|
|
custom_ty: None,
|
|
/*items: vec![
|
|
ClanInviteInfo {
|
|
username: "RE_user1".to_owned(),
|
|
display_name: "RE_user1".to_owned(),
|
|
clan_name: "RE_clan_invite1".to_owned(),
|
|
clan_size: 42,
|
|
use_custom_avatar: false,
|
|
avatar_id: 0,
|
|
}.as_transmissible()
|
|
],*/
|
|
items: vec![],
|
|
}));
|
|
Ok(params.into())
|
|
})
|
|
}
|