Files
ojrc/rc_multiplayer/src/events/mod.rs
T

28 lines
914 B
Rust
Raw Normal View History

mod validate_game_guid;
2025-07-06 17:36:52 -04:00
mod loading_progress;
mod all_loading_progress;
mod weapon_select;
mod activate_sync;
pub async fn handler(init_ctx: &crate::InitConfig) -> crate::handler::LnlEventHandler {
2025-07-06 17:36:52 -04:00
crate::handler::LnlEventHandler::new(init_ctx.users.clone(), crate::vehicle_motion::handler(init_ctx))
.add(validate_game_guid::handler(init_ctx))
2025-07-06 17:36:52 -04:00
.add(loading_progress::handler(init_ctx))
.add(all_loading_progress::handler(init_ctx))
.add(weapon_select::handler(init_ctx))
.add(activate_sync::handler(init_ctx))
}
#[inline]
pub fn log_channel_send_failure<T>(result: Result<(), tokio::sync::mpsc::error::SendError<T>>) {
if result.is_err() {
log::error!("Failed to send game message");
}
}
#[inline]
pub fn log_lnl_send_failure(result: std::io::Result<usize>) {
if let Err(e) = result {
log::error!("Failed to send packet: {}", e);
}
}