From 68e2b87a0a32e85259edc1dbd8362e56f9b067c8 Mon Sep 17 00:00:00 2001 From: WiseDev <83840010+wisedevik@users.noreply.github.com> Date: Sun, 23 Aug 2026 09:48:49 +0300 Subject: [PATCH] decode the four types the client kept sending 14303 AskForJoinableAlliancesList and 14107 CancelMatchmake are both genuinely empty payloads. 516 UpdateLastShownLevelUp is header only, 537 StartMatchmake carries a vint and a bool. none of them move the home checksum. that clears the unknown type warnings out of the log. --- crates/logic/src/commands/matchmake.rs | 48 ++++++++++++++++++++ crates/logic/src/commands/mod.rs | 3 ++ crates/logic/src/lib.rs | 4 +- crates/logic/src/messages/client_requests.rs | 10 ++++ 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 crates/logic/src/commands/matchmake.rs diff --git a/crates/logic/src/commands/matchmake.rs b/crates/logic/src/commands/matchmake.rs new file mode 100644 index 0000000..d18ecf2 --- /dev/null +++ b/crates/logic/src/commands/matchmake.rs @@ -0,0 +1,48 @@ +use logic_derive::Command; +use titan::Payload; +use crate::commands::command::{CommandOutcome, Execute}; +use crate::commands::command_type; +use crate::commands::header::LogicCommandHeader; +use crate::home::LogicHomeMode; +#[derive(Debug, Default, Payload, Command)] +#[command(id = command_type::UPDATE_LAST_SHOWN_LEVEL_UP)] +pub struct LogicUpdateLastShownLevelUpCommand { + pub header: LogicCommandHeader, +} +impl Execute for LogicUpdateLastShownLevelUpCommand { + fn execute(&self, mode: &mut LogicHomeMode) -> CommandOutcome { + let level = mode.avatar().exp_level; + let shown = mode.home().last_shown_level_up; + if level <= shown { + return CommandOutcome::Rejected("that level up was already shown"); + } + mode.home_mut().last_shown_level_up = if shown > 1 { shown + 1 } else { 2 }; + CommandOutcome::Applied + } +} +#[derive(Debug, Default, Payload, Command)] +#[command(id = command_type::START_MATCHMAKE)] +pub struct LogicStartMatchmakeCommand { + pub header: LogicCommandHeader, + #[codec(vint)] + pub matchmake_slot: i32, + #[codec(bool)] + pub notify: bool, +} +impl Execute for LogicStartMatchmakeCommand { + fn execute(&self, mode: &mut LogicHomeMode) -> CommandOutcome { + if mode + .avatar() + .arena + .as_arena() + .map(|arena| arena.is_training_camp()) + .unwrap_or(true) + { + return CommandOutcome::Rejected("the training camp cannot matchmake"); + } + if mode.is_claiming_reward() { + return CommandOutcome::Rejected("a reward claim is in progress"); + } + CommandOutcome::Ignored + } +} diff --git a/crates/logic/src/commands/mod.rs b/crates/logic/src/commands/mod.rs index 4217303..0343d5a 100644 --- a/crates/logic/src/commands/mod.rs +++ b/crates/logic/src/commands/mod.rs @@ -4,6 +4,7 @@ mod command; mod deck; mod header; mod manager; +mod matchmake; mod reward; mod shop; mod spells; @@ -20,6 +21,7 @@ pub use command::{CommandMeta, CommandOutcome, CommandRegistryEntry, Execute, Lo pub use deck::{LogicMoveSpellCommand, LogicSwapSpellsCommand}; pub use header::LogicCommandHeader; pub use manager::LogicCommandManager; +pub use matchmake::{LogicStartMatchmakeCommand, LogicUpdateLastShownLevelUpCommand}; pub use reward::LogicReward; pub use shop::{ LogicBuyCardCommand, LogicBuyChestCommand, LogicBuyResourcePackCommand, @@ -44,6 +46,7 @@ pub mod command_type { pub const SELL_CHEST: i32 = 507; pub const UPDATE_LAST_SHOWN_LEVEL_UP: i32 = 516; pub const CANCEL_CHEST_OPEN: i32 = 517; + pub const START_MATCHMAKE: i32 = 537; pub const COLLECT_FREE_CHEST: i32 = 518; pub const SORT_COLLECTION: i32 = 520; pub const MOVE_SPELL: i32 = 521; diff --git a/crates/logic/src/lib.rs b/crates/logic/src/lib.rs index dc66123..ed707a7 100644 --- a/crates/logic/src/lib.rs +++ b/crates/logic/src/lib.rs @@ -12,8 +12,8 @@ pub use commands::{ LogicCommand, LogicCommandHeader, LogicCommandManager, LogicFuseSpellsCommand, LogicHelpOpenedCommand, LogicMoveSpellCommand, LogicPageOpenedCommand, LogicRefreshAchievementsCommand, LogicReward, LogicShopOpenedCommand, - LogicShopSeedChangedCommand, LogicSortCollectionCommand, LogicStartRewardClaimCommand, - LogicSwapSpellsCommand, + LogicShopSeedChangedCommand, LogicSortCollectionCommand, LogicStartMatchmakeCommand, + LogicStartRewardClaimCommand, LogicSwapSpellsCommand, LogicUpdateLastShownLevelUpCommand, }; pub use data::{ table, DataError, LogicArenaData, LogicData, LogicDataRef, LogicDataTable, diff --git a/crates/logic/src/messages/client_requests.rs b/crates/logic/src/messages/client_requests.rs index 51f56a5..ca60268 100644 --- a/crates/logic/src/messages/client_requests.rs +++ b/crates/logic/src/messages/client_requests.rs @@ -16,6 +16,16 @@ pub struct AskForPlayingFacebookFriendsMessage { pub facebook_ids: Option>>, } #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Message)] +#[message(id = 14107, direction = "client", name = "CancelMatchmakeMessage")] +pub struct CancelMatchmakeMessage {} +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Message)] +#[message( + id = 14303, + direction = "client", + name = "AskForJoinableAlliancesListMessage" +)] +pub struct AskForJoinableAlliancesListMessage {} +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Message)] #[message(id = 14402, direction = "client", name = "AskForTVContentMessage")] pub struct AskForTVContentMessage {} #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Message)]