mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Prefix all crates with oj_ and use release version of dependencies
This commit is contained in:
@@ -24,8 +24,8 @@ impl <C: Send + 'static> SimpleOperation<C> for AddSanctionProvider {
|
||||
if let Some(Typed::Str(reason)) = params.remove(&REASON_PARAM_KEY) {
|
||||
if let Some(Typed::Str(username)) = params.remove(&USERNAME_PARAM_KEY) {
|
||||
let user_info = user.user()?;
|
||||
let sanction = rc_core::persist::user::SetSanction {
|
||||
type_: rc_core::persist::user::SanctionType::from_i32(sanction_ty)?,
|
||||
let sanction = oj_rc_core::persist::user::SetSanction {
|
||||
type_: oj_rc_core::persist::user::SanctionType::from_i32(sanction_ty)?,
|
||||
is_adding,
|
||||
duration,
|
||||
reason: reason.string,
|
||||
@@ -38,7 +38,7 @@ impl <C: Send + 'static> SimpleOperation<C> for AddSanctionProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
Err((rc_core::data::error_codes::ChatErrorCodes::UnexpectedError as i16).into())
|
||||
Err((oj_rc_core::data::error_codes::ChatErrorCodes::UnexpectedError as i16).into())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//use rc_core::persist::user::ChatUser;
|
||||
//use oj_rc_core::persist::user::ChatUser;
|
||||
use polariton::operation::{ParameterTable, OperationResponse};
|
||||
|
||||
const CODE: u8 = 11;
|
||||
|
||||
@@ -21,7 +21,7 @@ impl SimpleOperation<()> for GetSanctionsProvider {
|
||||
params.insert(SANCTIONS_PARAM_KEY, sanctions);
|
||||
return Ok(params.into());
|
||||
}
|
||||
Err((rc_core::data::error_codes::ChatErrorCodes::UnexpectedError as i16).into())
|
||||
Err((oj_rc_core::data::error_codes::ChatErrorCodes::UnexpectedError as i16).into())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ mod list_sanctions;
|
||||
|
||||
use polariton_server::operations::OperationsHandler;
|
||||
|
||||
pub fn handler(chat_system: crate::state::chat::ChatImpl, conf: &rc_core::persist::config::ConfigImpl) -> OperationsHandler<crate::UserTy> {
|
||||
pub fn handler(chat_system: crate::state::chat::ChatImpl, conf: &oj_rc_core::persist::config::ConfigImpl) -> OperationsHandler<crate::UserTy> {
|
||||
OperationsHandler::new()
|
||||
.modify(rc_core::polariton::OpIdCopy)
|
||||
.modify(oj_rc_core::polariton::OpIdCopy)
|
||||
.add(more_auth::MoreLobbyAuth::new(chat_system.clone()))
|
||||
.add(chat_ignores::ignores_provider())
|
||||
.add(pending_sanctions::pending_sanctions_checker())
|
||||
|
||||
@@ -2,7 +2,7 @@ use polariton::operation::Typed;
|
||||
use polariton_server::operations::{Operation, OperationCode};
|
||||
|
||||
//use crate::persist::chat_user::{ChatUser, ChatUserImpl};
|
||||
//use rc_core::persist::user::ChatUser;
|
||||
//use oj_rc_core::persist::user::ChatUser;
|
||||
|
||||
pub struct MoreLobbyAuth {
|
||||
chat_system: crate::state::chat::ChatImpl,
|
||||
@@ -17,8 +17,8 @@ impl MoreLobbyAuth {
|
||||
}
|
||||
}
|
||||
|
||||
/*fn build_ext_map(&self, token: &rc_core::persist::user::UserToken) -> Option<std::collections::HashMap<std::any::TypeId, Box<dyn std::any::Any + Send + Sync + 'static>>> {
|
||||
let user_dir = self.root.join(rc_core::persist::user::USERS_DIR).join(&token.uuid);
|
||||
/*fn build_ext_map(&self, token: &oj_rc_core::persist::user::UserToken) -> Option<std::collections::HashMap<std::any::TypeId, Box<dyn std::any::Any + Send + Sync + 'static>>> {
|
||||
let user_dir = self.root.join(oj_rc_core::persist::user::USERS_DIR).join(&token.uuid);
|
||||
let data = if let Ok(data) = ChatUserImpl::load(&user_dir) {
|
||||
data
|
||||
} else {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use polariton_server::operations::Immediate;
|
||||
//use polariton::operation::{ParameterTable, Typed};
|
||||
use rc_core::ConfigProvider;
|
||||
use oj_rc_core::ConfigProvider;
|
||||
|
||||
const PARAM_KEY: u8 = 20;
|
||||
|
||||
pub(super) fn public_channels_provider(conf: &rc_core::persist::config::ConfigImpl) -> Immediate<13, crate::UserTy> {
|
||||
pub(super) fn public_channels_provider(conf: &oj_rc_core::persist::config::ConfigImpl) -> Immediate<13, crate::UserTy> {
|
||||
let pub_channs = conf.public_channels();
|
||||
Immediate::new(move || {
|
||||
let mut params = std::collections::HashMap::with_capacity(1);
|
||||
|
||||
@@ -17,7 +17,7 @@ pub fn send_public_message_handler(chat_system: crate::state::chat::ChatImpl) ->
|
||||
let user = user.user()?;
|
||||
if message_text.string.bytes().len() > MAX_MESSAGE_LEN {
|
||||
log::warn!("Rejecting too long chat message from {}", user.token().uuid);
|
||||
return Err(rc_core::data::error_codes::ChatErrorCodes::Flood as i16)
|
||||
return Err(oj_rc_core::data::error_codes::ChatErrorCodes::Flood as i16)
|
||||
}
|
||||
let chat_loc = if let Some(Typed::Str(chat_loc)) = params.remove(&CHAT_LOCATION_PARAM_KEY) {
|
||||
chat_loc.string.clone()
|
||||
@@ -44,7 +44,7 @@ pub fn send_private_message_handler(chat_system: crate::state::chat::ChatImpl) -
|
||||
let user = user.user()?;
|
||||
if message_text.string.bytes().len() > MAX_MESSAGE_LEN {
|
||||
log::warn!("Rejecting too long chat message from {}", user.token().uuid);
|
||||
return Err(rc_core::data::error_codes::ChatErrorCodes::Flood as i16)
|
||||
return Err(oj_rc_core::data::error_codes::ChatErrorCodes::Flood as i16)
|
||||
}
|
||||
let chat_loc = if let Some(Typed::Str(chat_loc)) = params.remove(&CHAT_LOCATION_PARAM_KEY) {
|
||||
chat_loc.string.clone()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//use rc_core::persist::user::ChatUser;
|
||||
//use oj_rc_core::persist::user::ChatUser;
|
||||
use polariton::operation::{ParameterTable, OperationResponse};
|
||||
|
||||
const CODE: u8 = 12;
|
||||
|
||||
@@ -30,7 +30,7 @@ pub(super) fn is_online_provider(chat_system: crate::state::ChatImpl) -> SimpleC
|
||||
Ok(params.into())
|
||||
}
|
||||
} else {
|
||||
Err(rc_core::data::error_codes::ChatErrorCodes::UnexpectedError as _)
|
||||
Err(oj_rc_core::data::error_codes::ChatErrorCodes::UnexpectedError as _)
|
||||
}
|
||||
}, chat_system)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user