From 23f9b5f3c1897fb89d85f3e5db39a5de4079ce97 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 2 May 2025 00:52:26 -0400 Subject: [PATCH] Move oodle into the packet module Not sure why I didn't do this before, it's not important enough to be a top-level item. --- src/bin/kawari-lobby.rs | 2 +- src/bin/kawari-world.rs | 2 +- src/lib.rs | 3 --- src/lobby/connection.rs | 2 +- src/packet/compression.rs | 3 +-- src/packet/mod.rs | 3 +++ src/{ => packet}/oodle.rs | 0 src/packet/parsing.rs | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) rename src/{ => packet}/oodle.rs (100%) diff --git a/src/bin/kawari-lobby.rs b/src/bin/kawari-lobby.rs index 48f4c8b..135b89f 100644 --- a/src/bin/kawari-lobby.rs +++ b/src/bin/kawari-lobby.rs @@ -8,8 +8,8 @@ use kawari::ipc::lobby::ServiceAccount; use kawari::ipc::lobby::{ClientLobbyIpcData, ServerLobbyIpcSegment}; use kawari::lobby::LobbyConnection; use kawari::lobby::send_custom_world_packet; -use kawari::oodle::OodleNetwork; use kawari::packet::ConnectionType; +use kawari::packet::oodle::OodleNetwork; use kawari::packet::{PacketState, SegmentData, send_keep_alive}; use tokio::io::AsyncReadExt; use tokio::net::TcpListener; diff --git a/src/bin/kawari-world.rs b/src/bin/kawari-world.rs index d321026..4780345 100644 --- a/src/bin/kawari-world.rs +++ b/src/bin/kawari-world.rs @@ -17,8 +17,8 @@ use kawari::ipc::zone::{ ActorControlCategory, ActorControlSelf, CommonSpawn, PlayerEntry, PlayerSetup, PlayerSpawn, SocialList, }; -use kawari::oodle::OodleNetwork; use kawari::opcodes::{ServerChatIpcType, ServerZoneIpcType}; +use kawari::packet::oodle::OodleNetwork; use kawari::packet::{ CompressionType, ConnectionType, PacketSegment, PacketState, SegmentData, SegmentType, send_keep_alive, send_packet, diff --git a/src/lib.rs b/src/lib.rs index e937251..9e29f49 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,9 +15,6 @@ pub mod common; /// Config management. pub mod config; -/// Bindings for Oodle network compression. -pub mod oodle; - /// Lobby server-specific code. pub mod lobby; diff --git a/src/lobby/connection.rs b/src/lobby/connection.rs index cb72104..0bd494c 100644 --- a/src/lobby/connection.rs +++ b/src/lobby/connection.rs @@ -7,8 +7,8 @@ use crate::{ blowfish::Blowfish, common::{timestamp_secs, workdefinitions::CharaMake}, config::get_config, - oodle::OodleNetwork, opcodes::ServerLobbyIpcType, + packet::oodle::OodleNetwork, packet::{ CompressionType, ConnectionType, PacketSegment, PacketState, SegmentData, SegmentType, generate_encryption_key, parse_packet, send_packet, diff --git a/src/packet/compression.rs b/src/packet/compression.rs index f93fed0..9104008 100644 --- a/src/packet/compression.rs +++ b/src/packet/compression.rs @@ -5,11 +5,10 @@ use binrw::{BinRead, BinResult}; use crate::{ config::get_config, - oodle::OodleNetwork, packet::{PacketHeader, PacketSegment}, }; -use super::{PacketState, ReadWriteIpcSegment}; +use super::{PacketState, ReadWriteIpcSegment, oodle::OodleNetwork}; #[binrw] #[brw(repr = u8)] diff --git a/src/packet/mod.rs b/src/packet/mod.rs index d2f9a81..b2880a9 100644 --- a/src/packet/mod.rs +++ b/src/packet/mod.rs @@ -13,3 +13,6 @@ pub use encryption::generate_encryption_key; mod ipc; pub use ipc::{IpcSegment, ReadWriteIpcSegment}; + +/// Bindings for Oodle network compression. +pub mod oodle; diff --git a/src/oodle.rs b/src/packet/oodle.rs similarity index 100% rename from src/oodle.rs rename to src/packet/oodle.rs diff --git a/src/packet/parsing.rs b/src/packet/parsing.rs index cf7c322..f31abbf 100644 --- a/src/packet/parsing.rs +++ b/src/packet/parsing.rs @@ -7,12 +7,12 @@ use crate::{ common::{read_string, timestamp_msecs, write_string}, config::get_config, ipc::kawari::CustomIpcSegment, - oodle::OodleNetwork, packet::{compression::compress, encryption::decrypt}, }; use super::{ CompressionType, compression::decompress, encryption::encrypt, ipc::ReadWriteIpcSegment, + oodle::OodleNetwork, }; #[binrw]