1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Complete bare minimum to seem logged in

This commit is contained in:
NGnius (Graham)
2025-03-01 16:22:57 -05:00
parent fe30e783ad
commit 7e31f6fe1d
55 changed files with 1147 additions and 81 deletions

View File

@@ -0,0 +1,58 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Arr};
use crate::data::channel::*;
const PARAM_KEY: u8 = 18;
pub(super) fn all_channels_provider() -> SimpleFunc<11, 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::Arr(Arr {
ty: 104, // hashtable
items: vec![
ChatChannelInfo {
channel_name: "RE_public_channel0".to_owned(),
members: vec![
ChatChannelMember {
name: "RE_chat0_username0".to_owned(),
use_custom_avatar: false,
state: ChatPlayerState::Idk1,
custom_avatar: Vec::default(),
avatar_id: 2,
},
ChatChannelMember {
name: "RE_chat0_username1".to_owned(),
use_custom_avatar: false,
state: ChatPlayerState::Idk2,
custom_avatar: Vec::default(),
avatar_id: 3,
},
],
channel_ty: ChatChannelType::Public,
}.as_transmissible(),
ChatChannelInfo {
channel_name: "RE_custom_channel1".to_owned(),
members: vec![
ChatChannelMember {
name: "RE_chat1_username0".to_owned(),
use_custom_avatar: false,
state: ChatPlayerState::Idk0,
custom_avatar: Vec::default(),
avatar_id: 2,
},
ChatChannelMember {
name: "RE_chat1_username1".to_owned(),
use_custom_avatar: false,
state: ChatPlayerState::Idk1,
custom_avatar: Vec::default(),
avatar_id: 3,
},
],
channel_ty: ChatChannelType::Custom,
}.as_transmissible(),
],
}));
Ok(params.into())
})
}

View File

@@ -1,6 +1,7 @@
mod more_auth;
mod chat_ignores;
mod pending_sanctions;
mod all_joined_channels;
use polariton_server::operations::OperationsHandler;
@@ -9,5 +10,6 @@ pub fn handler() -> OperationsHandler<crate::UserTy> {
.without_state(more_auth::MoreLobbyAuth)
.without_state(chat_ignores::ignores_provider())
.without_state(pending_sanctions::pending_sanctions_checker())
.without_state(all_joined_channels::all_channels_provider())
//.without_state(polariton_server::operations::Ack::<00000, _>::default())
}