mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Create first event handler and framework for it
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user