mirror of
https://github.com/RustySamovar/RustySamovar.git
synced 2024-11-22 02:45:34 +00:00
Subsystem for entity handling
This commit is contained in:
parent
6342ff883e
commit
26f446616a
@ -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();
|
||||
|
36
src/subsystems/entity_subsystem.rs
Normal file
36
src/subsystems/entity_subsystem.rs
Normal 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
3
src/subsystems/mod.rs
Normal file
@ -0,0 +1,3 @@
|
||||
mod entity_subsystem;
|
||||
|
||||
pub use self::entity_subsystem::EntitySubsystem;
|
Loading…
Reference in New Issue
Block a user