mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Remove external state for op handlers
This commit is contained in:
@@ -7,10 +7,10 @@ use polariton_server::operations::OperationsHandler;
|
||||
|
||||
pub fn handler() -> OperationsHandler<crate::UserTy> {
|
||||
OperationsHandler::new()
|
||||
.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::<12, _>::default())
|
||||
//.without_state(polariton_server::operations::Ack::<00000, _>::default())
|
||||
.add(more_auth::MoreLobbyAuth)
|
||||
.add(chat_ignores::ignores_provider())
|
||||
.add(pending_sanctions::pending_sanctions_checker())
|
||||
.add(all_joined_channels::all_channels_provider())
|
||||
.add(polariton_server::operations::Ack::<12, _>::default())
|
||||
//.add(polariton_server::operations::Ack::<00000, _>::default())
|
||||
}
|
||||
|
||||
@@ -7,11 +7,10 @@ impl MoreLobbyAuth {
|
||||
const AUTH_PAYLOAD_KEY: u8 = 245;
|
||||
}
|
||||
|
||||
impl <C> Operation<C> for MoreLobbyAuth {
|
||||
type State = ();
|
||||
impl <C: Send + 'static> Operation<C> for MoreLobbyAuth {
|
||||
type User = crate::UserTy;
|
||||
|
||||
fn handle(&self, params: polariton::operation::ParameterTable<C>, _: &mut Self::State, user: &Self::User) -> polariton::operation::OperationResponse<C> {
|
||||
fn handle(&self, params: polariton::operation::ParameterTable<C>, user: &Self::User) -> polariton::operation::OperationResponse<C> {
|
||||
let params_dict = params.to_dict();
|
||||
if let Some(Typed::Str(auth_payload)) = params_dict.get(&Self::AUTH_PAYLOAD_KEY) {
|
||||
if user.update_with_auth(&auth_payload.string) {
|
||||
|
||||
Reference in New Issue
Block a user