diff --git a/src/main.rs b/src/main.rs index bb1877b..29cb013 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,11 +11,14 @@ mod dbmanager; mod jsonmanager; mod luamanager; +mod subsystems; + use server::NetworkServer; use server::DispatchServer; use dbmanager::DatabaseManager; use jsonmanager::JsonManager; use luamanager::LuaManager; +use subsystems::EntitySubsystem; fn main() { pretty_env_logger::init(); diff --git a/src/subsystems/entity_subsystem.rs b/src/subsystems/entity_subsystem.rs new file mode 100644 index 0000000..11723b0 --- /dev/null +++ b/src/subsystems/entity_subsystem.rs @@ -0,0 +1,36 @@ +use std::sync::{mpsc, Arc}; +use std::io::Cursor; +use std::collections::HashMap; + +use crate::server::IpcMessage; + +use prost::Message; + +use packet_processor_macro::*; +#[macro_use] +use packet_processor::*; +use serde::__serialize_unimplemented; + +#[packet_processor( +CombatInvocationsNotify, +)] +pub struct EntitySubsystem { + packets_to_send_tx: mpsc::Sender, +} + +impl EntitySubsystem { + pub fn new(packets_to_send_tx: mpsc::Sender) -> EntitySubsystem { + let mut es = EntitySubsystem { + packets_to_send_tx: packets_to_send_tx, + packet_callbacks: HashMap::new(), + }; + + es.register(); + + return es; + } + + fn process_combat_invocations(&self, user_id: u32, metadata: &proto::PacketHead, notify: &proto::CombatInvocationsNotify) { + unimplemented!() + } +} \ No newline at end of file diff --git a/src/subsystems/mod.rs b/src/subsystems/mod.rs new file mode 100644 index 0000000..b3301f2 --- /dev/null +++ b/src/subsystems/mod.rs @@ -0,0 +1,3 @@ +mod entity_subsystem; + +pub use self::entity_subsystem::EntitySubsystem; \ No newline at end of file