don't send Ep3 lobby banners again after ending a proxy session

This commit is contained in:
Martin Michelsen
2023-09-08 10:47:13 -07:00
parent c1ed1afa5b
commit 245ebd92c6
5 changed files with 29 additions and 16 deletions
+4 -1
View File
@@ -106,8 +106,11 @@ struct Client {
// Client has received newserv's Episode 3 card definitions, so don't send
// them again
HAS_EP3_CARD_DEFS = 0x00004000,
// Client has received newserv's Episode 3 media updates, so don't send them
// again
HAS_EP3_MEDIA_UPDATES = 0x00800000,
UNUSED_FLAG_BITS = 0xFF800000,
UNUSED_FLAG_BITS = 0xFF010000,
};
uint64_t id;
+20 -8
View File
@@ -2479,15 +2479,27 @@ static void on_61_98(shared_ptr<ServerState> s, shared_ptr<Client> c,
// update and the current tournament entry depend on this flag, we have
// to delay sending them until now, instead of sending them during the
// login sequence.
if ((c->flags & Client::Flag::IS_EPISODE_3) && !(c->flags & Client::Flag::HAS_EP3_CARD_DEFS)) {
send_ep3_card_list_update(s, c);
for (const auto& banner : s->ep3_lobby_banners) {
send_ep3_media_update(c, banner.type, banner.which, banner.data);
if (c->flags & Client::Flag::IS_EPISODE_3) {
bool flags_changed = false;
if (!(c->flags & Client::Flag::HAS_EP3_CARD_DEFS)) {
send_ep3_card_list_update(s, c);
auto team = c->ep3_tournament_team.lock();
auto tourn = team ? team->tournament.lock() : nullptr;
if (!(c->flags & Client::Flag::IS_EP3_TRIAL_EDITION)) {
send_ep3_confirm_tournament_entry(s, c, tourn);
}
c->flags |= Client::Flag::HAS_EP3_CARD_DEFS;
flags_changed = true;
}
auto team = c->ep3_tournament_team.lock();
auto tourn = team ? team->tournament.lock() : nullptr;
if (!(c->flags & Client::Flag::IS_EP3_TRIAL_EDITION)) {
send_ep3_confirm_tournament_entry(s, c, tourn);
if (!(c->flags & Client::Flag::HAS_EP3_MEDIA_UPDATES)) {
for (const auto& banner : s->ep3_lobby_banners) {
send_ep3_media_update(c, banner.type, banner.which, banner.data);
c->flags |= Client::Flag::HAS_EP3_MEDIA_UPDATES;
flags_changed = true;
}
}
if (flags_changed) {
send_update_client_config(c);
}
}
-3
View File
@@ -2190,9 +2190,6 @@ void send_ep3_card_list_update(shared_ptr<ServerState> s, shared_ptr<Client> c)
w.write(data);
send_command(c, 0xB8, 0x00, w.str());
c->flags |= Client::Flag::HAS_EP3_CARD_DEFS;
send_update_client_config(c);
}
}