From 2cb49030f0c73399d14d93ed64020cf0e096deed Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sat, 30 Jul 2022 00:26:41 -0700 Subject: [PATCH] implement bb meet user --- src/CommandFormats.hh | 12 ++++++++---- src/ReceiveCommands.cc | 8 ++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/CommandFormats.hh b/src/CommandFormats.hh index 3e3a7b8e..b4b684b4 100644 --- a/src/CommandFormats.hh +++ b/src/CommandFormats.hh @@ -1158,10 +1158,14 @@ struct C_Login_BB_93 { le_uint32_t guild_card_number; ptext unused; le_uint32_t team_id; - ptext username; - ptext unused2; - ptext password; - ptext unused3; + ptext username; + ptext password; + + // These fields map to the same fields in C_Login_MeetUserExtension. There is + // no equivalent of the name field from that structure on BB (though newserv + // doesn't use it anyway). + le_uint32_t menu_id; + le_uint32_t preferred_lobby_id; // Note: Unlike other versions, BB puts the version string in the client // config at connect time. So the first time the server gets this command, it diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 03105bef..4a429252 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -107,6 +107,14 @@ void process_login_complete(shared_ptr s, shared_ptr c) { send_ep3_rank_update(c); } + // On BB, send the pre-lobby event, if set. This normally happens on the + // login server immediately after the encryption init command, but on BB we + // don't know the client's state until after we receive the login command, + // so we do it here instead. + if ((c->version == GameVersion::BB) && s->pre_lobby_event) { + send_change_event(c, s->pre_lobby_event); + } + if (s->welcome_message.empty() || (c->flags & Client::Flag::NO_MESSAGE_BOX_CLOSE_CONFIRMATION) || !(c->flags & Client::Flag::AT_WELCOME_MESSAGE)) {