mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add full destruction (no respawn) #30
This commit is contained in:
1 parent
fffb4e2576
commit
b38a1ae03f
7 files changed
+148
-9
No files matched your search
@@ -9,3 +9,6 @@ pub use ingame_broadcast::Broadcaster;
|
||||
|
||||
mod ingame_broadcast_dataless;
|
||||
pub use ingame_broadcast_dataless::DatalessBroadcaster;
|
||||
|
||||
mod stub;
|
||||
pub use stub::Stub;
|
||||
@@ -0,0 +1,26 @@
|
||||
pub struct Stub<const CODE_IN: i16, In: byteserde::des_slice::ByteDeserializeSlice<In> + Send + Sync + 'static> {
|
||||
_in: std::marker::PhantomData<In>,
|
||||
}
|
||||
|
||||
impl <const CODE_IN: i16, In: byteserde::des_slice::ByteDeserializeSlice<In> + Send + Sync + 'static> Stub<CODE_IN, In> {
|
||||
pub fn handler(init_ctx: &crate::InitConfig) -> crate::handlers::simple_typed::SimpleRlnl<In, Self> {
|
||||
crate::handlers::simple_typed::SimpleRlnl::new(Stub::new(init_ctx))
|
||||
}
|
||||
|
||||
fn new(_init_ctx: &crate::InitConfig) -> Self {
|
||||
Self {
|
||||
_in: std::marker::PhantomData::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl <const CODE_IN: i16, In: byteserde::des_slice::ByteDeserializeSlice<In> + Send + Sync + 'static> crate::handlers::simple_typed::RlnlEventCodeHandler for Stub<CODE_IN, In> {
|
||||
type In = In;
|
||||
const CODE: rlnl::event_code::NetworkEvent = crate::handler::i16_to_event_or_panic(CODE_IN);
|
||||
|
||||
async fn handle(&self, _data: Self::In, _peer: &std::sync::Arc<literustlib_server::Connection<crate::PacketData>>, _user: &crate::UserData, _sender: &std::sync::Arc<literustlib_server::DataSender<crate::PacketData>>) {
|
||||
log::debug!("Got {:?} event", Self::CODE);
|
||||
//log::debug!("Got {:?} event: {:?}", Self::CODE, data);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user