Create first event handler and framework for it

This commit is contained in:
NG (Graham) committed 2025-07-03 21:53:34 -04:00
1 parent e69c7dabd6
commit 38ab4ba799
10 files changed
+120 -11

No files matched your search

+5 -1
View File
@@ -1,7 +1,11 @@
pub type UserData = ();
pub type UserData = crate::user::User;
pub type PacketData = crate::handler::EventData;
#[async_trait::async_trait]
pub trait EventCodeHandler: Send + Sync {
async fn handle(&self, data: &bytes::Bytes, peer: &std::sync::Arc<literustlib_server::Connection<PacketData>>, user: &UserData, sender: &literustlib_server::DataSender<PacketData>);
}
pub trait EventCode: EventCodeHandler {
const CODE: i16;
}