Subsystem for entity handling

This commit is contained in:
Nobody 2022-02-03 18:17:57 +05:00
parent 6342ff883e
commit 26f446616a
3 changed files with 42 additions and 0 deletions

View File

@ -11,11 +11,14 @@ mod dbmanager;
mod jsonmanager; mod jsonmanager;
mod luamanager; mod luamanager;
mod subsystems;
use server::NetworkServer; use server::NetworkServer;
use server::DispatchServer; use server::DispatchServer;
use dbmanager::DatabaseManager; use dbmanager::DatabaseManager;
use jsonmanager::JsonManager; use jsonmanager::JsonManager;
use luamanager::LuaManager; use luamanager::LuaManager;
use subsystems::EntitySubsystem;
fn main() { fn main() {
pretty_env_logger::init(); pretty_env_logger::init();

View File

@ -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<IpcMessage>,
}
impl EntitySubsystem {
pub fn new(packets_to_send_tx: mpsc::Sender<IpcMessage>) -> 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!()
}
}

3
src/subsystems/mod.rs Normal file
View File

@ -0,0 +1,3 @@
mod entity_subsystem;
pub use self::entity_subsystem::EntitySubsystem;