From 7f68d41baccb6f0a71b1dd8f34b7fea08e45c26b Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sat, 25 Apr 2026 22:21:46 -0700 Subject: [PATCH] fix port name in game server lookup --- src/ReceiveCommands.cc | 11 +++++++++-- src/ServerState.cc | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 3441313f..87cc5c17 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -4202,9 +4202,15 @@ static asio::awaitable on_40(shared_ptr c, Channel::Message& msg) "Client sent incorrect source Guild Card number ({:08X}) in card search", cmd.searcher_guild_card_number.load())); } + + shared_ptr result; try { auto s = c->require_server_state(); - auto result = s->find_client(nullptr, cmd.target_guild_card_number); + result = s->find_client(nullptr, cmd.target_guild_card_number); + } catch (const out_of_range&) { + } + + if (result) { if (!result->blocked_senders.count(c->login->account->account_id)) { auto result_lobby = result->lobby.lock(); if (result_lobby) { @@ -4219,10 +4225,11 @@ static asio::awaitable on_40(shared_ptr c, Channel::Message& msg) c->log.info_f("Guild Card search ({} for {}) found {} but searcher is blocked", cmd.searcher_guild_card_number.load(), cmd.target_guild_card_number.load(), result->channel->name); } - } catch (const out_of_range&) { + } else { c->log.info_f("Guild Card search ({} for {}) did not find any player", cmd.searcher_guild_card_number.load(), cmd.target_guild_card_number.load()); } + co_return; } diff --git a/src/ServerState.cc b/src/ServerState.cc index a6897cfe..3d36273a 100644 --- a/src/ServerState.cc +++ b/src/ServerState.cc @@ -320,7 +320,7 @@ uint16_t ServerState::game_server_port_for_version(Version v) const { case Version::XB_V3: return this->name_to_port_config.at("xb")->port; case Version::BB_V4: - return this->name_to_port_config.at("xb")->port; + return this->name_to_port_config.at("bb-data1")->port; default: throw runtime_error("unknown version"); }