diff --git a/game-server/src/logic/handler/mod.rs b/game-server/src/logic/handler/mod.rs index e2008ea..72ae68a 100644 --- a/game-server/src/logic/handler/mod.rs +++ b/game-server/src/logic/handler/mod.rs @@ -33,20 +33,22 @@ macro_rules! handle_request { } macro_rules! handle_push { - ($($name:ident;)*) => { + ($($name:ident $(, $inner_package:ident)?;)*) => { fn handle_push(player: &mut super::player::Player, mut msg: Message) { use ::shorekeeper_protocol::{MessageID, Protobuf}; ::paste::paste! { match msg.get_message_id() { $( - ::shorekeeper_protocol::[<$name Push>]::MESSAGE_ID => { - let Ok(push) = ::shorekeeper_protocol::[<$name Push>]::decode(&*msg.remove_payload()) else { - tracing::debug!("failed to decode {}, player_id: {}", stringify!([<$name Push>]), player.basic_info.id); + ::shorekeeper_protocol::$($inner_package::)?[<$name Push>]::MESSAGE_ID => { + let Ok(push) = ::shorekeeper_protocol::$($inner_package::)?[<$name Push>]::decode(&*msg.remove_payload()) else { + tracing::debug!("failed to decode {}, player_id: {}", stringify!($($inner_package::)?[<$name Push>]), player.basic_info.id); return; }; - [](player, push); + tracing::debug!("logic: processing push {}", stringify!($($inner_package::)?[<$name Push>])); + + [](player, push); }, )* unhandled => ::tracing::warn!("can't find handler for push with message_id={unhandled}")