fix tournament metadata linking through server restarts
This commit is contained in:
@@ -231,6 +231,12 @@ static void send_main_menu(shared_ptr<ServerState> s, shared_ptr<Client> c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void on_login_complete(shared_ptr<ServerState> s, shared_ptr<Client> c) {
|
void on_login_complete(shared_ptr<ServerState> s, shared_ptr<Client> c) {
|
||||||
|
if (c->flags & Client::Flag::IS_EPISODE_3) {
|
||||||
|
auto team = s->ep3_tournament_index->team_for_serial_number(c->license->serial_number);
|
||||||
|
auto tourn = team ? team->tournament.lock() : nullptr;
|
||||||
|
c->ep3_tournament_team = team;
|
||||||
|
}
|
||||||
|
|
||||||
// On the BB data server, this function is called only on the last connection
|
// On the BB data server, this function is called only on the last connection
|
||||||
// (when we should send the ship select menu).
|
// (when we should send the ship select menu).
|
||||||
if ((c->server_behavior == ServerBehavior::LOGIN_SERVER) ||
|
if ((c->server_behavior == ServerBehavior::LOGIN_SERVER) ||
|
||||||
@@ -2498,10 +2504,9 @@ static void on_61_98(shared_ptr<ServerState> s, shared_ptr<Client> c,
|
|||||||
// login sequence.
|
// login sequence.
|
||||||
if ((c->flags & Client::Flag::IS_EPISODE_3) && !(c->flags & Client::Flag::HAS_EP3_CARD_DEFS)) {
|
if ((c->flags & Client::Flag::IS_EPISODE_3) && !(c->flags & Client::Flag::HAS_EP3_CARD_DEFS)) {
|
||||||
send_ep3_card_list_update(s, c);
|
send_ep3_card_list_update(s, c);
|
||||||
auto team = s->ep3_tournament_index->team_for_serial_number(c->license->serial_number);
|
auto team = c->ep3_tournament_team.lock();
|
||||||
auto tourn = team ? team->tournament.lock() : nullptr;
|
auto tourn = team ? team->tournament.lock() : nullptr;
|
||||||
c->ep3_tournament_team = team;
|
if (tourn && !(c->flags & Client::Flag::IS_EP3_TRIAL_EDITION)) {
|
||||||
if (!(c->flags & Client::Flag::IS_EP3_TRIAL_EDITION)) {
|
|
||||||
send_ep3_confirm_tournament_entry(s, c, tourn);
|
send_ep3_confirm_tournament_entry(s, c, tourn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user