mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Update to work with polariton v0.2
This commit is contained in:
1 parent
f004ca8565
commit
be37f8913a
83 files changed
+428
-1202
No files matched your search
@@ -6,18 +6,14 @@ use crate::data::friend::*;
|
||||
const FRIENDS_PARAM_KEY: u8 = 5;
|
||||
const AVATAR_PARAM_KEY: u8 = 76;
|
||||
|
||||
pub(super) fn friends_provider() -> SimpleFunc<4, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
pub(super) fn friends_provider() -> SimpleFunc<4, crate::UserTy, impl (Fn(ParameterTable<crate::data::custom::CustomType>, &crate::UserTy) -> Result<ParameterTable<crate::data::custom::CustomType>, i16>) + Sync + Sync, crate::data::custom::CustomType> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
let mut params = params.to_dict();
|
||||
params.insert(FRIENDS_PARAM_KEY, Typed::Arr(Arr {
|
||||
ty: 99, // custom
|
||||
items: vec![Typed::Custom(vec![ // FIXME don't manually serialize
|
||||
0u8, // byte custom type
|
||||
0u8, 5u8, // short custom object size
|
||||
3u8, 0u8, 0u8, 0u8, 0u8, // content
|
||||
].into())] }));
|
||||
ty: polariton::serdes::TypePrefix::Custom, // custom
|
||||
items: vec![Typed::Custom(crate::data::custom::CustomType::FriendInfo)] }));
|
||||
params.insert(AVATAR_PARAM_KEY, Typed::Arr(Arr {
|
||||
ty: 104, // hashmap
|
||||
ty: polariton::serdes::TypePrefix::HashMap, // hashmap
|
||||
items: vec![AvatarInfo {
|
||||
name: "".to_string(),
|
||||
use_custom_avatar: false,
|
||||
|
||||
Reference in new issue
Block a user