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:
@@ -7,11 +7,11 @@ pub struct ChatSystemConfig {
|
||||
#[derive(Clone, Copy)]
|
||||
struct CommandContext<'a, 'b> {
|
||||
chat_system: &'a super::ChatSystem,
|
||||
user: &'b dyn rc_core::persist::user::User<()>,
|
||||
user: &'b dyn oj_rc_core::persist::user::User<()>,
|
||||
}
|
||||
|
||||
impl ChatSystemConfig {
|
||||
pub fn from_persist(config: rc_core::persist::config::ChatSystemConfig) -> std::io::Result<Self> {
|
||||
pub fn from_persist(config: oj_rc_core::persist::config::ChatSystemConfig) -> std::io::Result<Self> {
|
||||
let mut compiled_commands = Vec::with_capacity(config.commands.len());
|
||||
for (i, cmd) in config.commands.into_iter().enumerate() {
|
||||
let compiled_command = ChatCommand::compile_command(cmd).map_err(|e| {
|
||||
@@ -26,7 +26,7 @@ impl ChatSystemConfig {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn perform_command(&self, text: &str, chat_system: &super::ChatSystem, user: &dyn rc_core::persist::user::User<()>,) -> String {
|
||||
pub fn perform_command(&self, text: &str, chat_system: &super::ChatSystem, user: &dyn oj_rc_core::persist::user::User<()>,) -> String {
|
||||
let ctx = CommandContext {
|
||||
chat_system,
|
||||
user,
|
||||
@@ -58,7 +58,7 @@ pub struct ChatCommand {
|
||||
}
|
||||
|
||||
impl ChatCommand {
|
||||
fn compile_command(command: rc_core::persist::ChatCommand) -> Result<Self, regex::Error> {
|
||||
fn compile_command(command: oj_rc_core::persist::ChatCommand) -> Result<Self, regex::Error> {
|
||||
Ok(Self {
|
||||
regex: regex::RegexBuilder::new(&command.regex).build()?,
|
||||
op: ChatOperation::from_persist(command.op)
|
||||
@@ -81,11 +81,11 @@ enum ChatOperation {
|
||||
}
|
||||
|
||||
impl ChatOperation {
|
||||
fn from_persist(op: rc_core::persist::ChatOperation) -> Self {
|
||||
fn from_persist(op: oj_rc_core::persist::ChatOperation) -> Self {
|
||||
match op {
|
||||
rc_core::persist::ChatOperation::BuiltIn(b_in) => Self::BuiltIn(BuiltIn::from_persist(b_in)),
|
||||
rc_core::persist::ChatOperation::Custom => Self::Custom,
|
||||
rc_core::persist::ChatOperation::Nop => Self::Nop,
|
||||
oj_rc_core::persist::ChatOperation::BuiltIn(b_in) => Self::BuiltIn(BuiltIn::from_persist(b_in)),
|
||||
oj_rc_core::persist::ChatOperation::Custom => Self::Custom,
|
||||
oj_rc_core::persist::ChatOperation::Nop => Self::Nop,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,10 +104,10 @@ enum BuiltIn {
|
||||
}
|
||||
|
||||
impl BuiltIn {
|
||||
fn from_persist(b_in: rc_core::persist::BuiltInChatOperation) -> Self {
|
||||
fn from_persist(b_in: oj_rc_core::persist::BuiltInChatOperation) -> Self {
|
||||
match b_in {
|
||||
rc_core::persist::BuiltInChatOperation::OnlineUsers => Self::OnlineUsers,
|
||||
rc_core::persist::BuiltInChatOperation::TotalUsers => Self::TotalUsers,
|
||||
oj_rc_core::persist::BuiltInChatOperation::OnlineUsers => Self::OnlineUsers,
|
||||
oj_rc_core::persist::BuiltInChatOperation::TotalUsers => Self::TotalUsers,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user