update lobby datas on team master transfer
This commit is contained in:
@@ -4845,6 +4845,7 @@ static void on_EA_BB(shared_ptr<Client> c, uint16_t command, uint32_t flag, stri
|
||||
// The client only sends this command with flag = 0x00, 0x30, or 0x40
|
||||
bool send_updates_for_this_m = false;
|
||||
bool send_updates_for_other_m = false;
|
||||
bool send_master_transfer_updates = false;
|
||||
switch (flag) {
|
||||
case 0x00: // Demote member
|
||||
if (s->team_index->demote_leader(c->license->serial_number, cmd.guild_card_number)) {
|
||||
@@ -4867,11 +4868,21 @@ static void on_EA_BB(shared_ptr<Client> c, uint16_t command, uint32_t flag, stri
|
||||
send_command(c, 0x11EA, 0x00000000);
|
||||
send_updates_for_this_m = true;
|
||||
send_updates_for_other_m = true;
|
||||
send_master_transfer_updates = true;
|
||||
break;
|
||||
default:
|
||||
throw runtime_error("invalid privilege level");
|
||||
}
|
||||
|
||||
if (send_master_transfer_updates) {
|
||||
for (const auto& it : team->members) {
|
||||
try {
|
||||
auto other_c = s->find_client(nullptr, it.second.serial_number);
|
||||
send_update_lobby_data_bb(other_c);
|
||||
} catch (const out_of_range&) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (send_updates_for_this_m) {
|
||||
send_update_team_metadata_for_client(c);
|
||||
send_team_membership_info(c);
|
||||
|
||||
Reference in New Issue
Block a user