diff --git a/src/utils/components.rs b/src/utils/components.rs index c17139b..6dce259 100644 --- a/src/utils/components.rs +++ b/src/utils/components.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use super::hashing::IntHashMap; /// Key created from a component and command pub type ComponentKey = u32; @@ -15,8 +15,8 @@ static COMPONENT_NAMES: &[(u16, &str)] = &[ (game_reporting::COMPONENT, "GameReporting"), (user_sessions::COMPONENT, "UserSessions"), ]; -static mut COMMANDS: Option> = None; -static mut NOTIFICATIONS: Option> = None; +static mut COMMANDS: Option> = None; +static mut NOTIFICATIONS: Option> = None; // Packets that will have their content omitted for debug logging #[rustfmt::skip] @@ -74,7 +74,6 @@ pub mod authentication { pub const COMPONENT: u16 = 0x1; // Commands - pub const CREATE_ACCOUNT: u16 = 0xA; pub const UPDATE_ACCOUNT: u16 = 0x14; pub const UPDATE_PARENTAL_EMAIL: u16 = 0x1C; @@ -400,7 +399,7 @@ pub mod user_sessions { } #[rustfmt::skip] -fn commands() -> HashMap { +fn commands() -> IntHashMap { use authentication as a; use game_manager as g; use redirector as r; @@ -617,7 +616,7 @@ fn commands() -> HashMap { } #[rustfmt::skip] -fn notifications() -> HashMap { +fn notifications() -> IntHashMap { use game_manager as g; use messaging as m; use game_reporting as gr; diff --git a/src/utils/hashing.rs b/src/utils/hashing.rs index 35a5307..447ff29 100644 --- a/src/utils/hashing.rs +++ b/src/utils/hashing.rs @@ -36,6 +36,7 @@ pub fn verify_password(password: &str, hash: &str) -> bool { argon2.verify_password(password.as_bytes(), &hash).is_ok() } +/// Alias for a [`HashMap`] that used [`IntHasher`] as its [`Hasher`] pub type IntHashMap = HashMap>; /// Hasher implementation that directly uses an integer value