make download quest menu work even after joining a lobby

This commit is contained in:
Martin Michelsen
2022-05-18 01:05:04 -07:00
parent 095eb23dab
commit 7764ae7b03
3 changed files with 16 additions and 2 deletions
+10 -2
View File
@@ -942,7 +942,15 @@ void process_change_ship(shared_ptr<ServerState> s, shared_ptr<Client> c,
// things, which we already know). We intentionally don't call check_size
// here, but instead just ignore the data.
send_message_box(c, u""); // we do this to avoid the "log window in message box" bug
// Delete the player from the lobby they're in (but only visible to themself).
// This makes it safe to allow the player to choose download quests from the
// main menu again - if we didn't do this, they could move in the lobby after
// canceling the download quests menu, which looks really bad.
send_self_leave_notification(c);
// Sending a blank message box here works around the bug where the log window
// contents appear prepended to the next large message box.
send_message_box(c, u"");
static const vector<string> version_to_port_name({
"dc-login", "pc-login", "bb-patch", "gc-us3", "bb-login"});
@@ -954,7 +962,7 @@ void process_change_ship(shared_ptr<ServerState> s, shared_ptr<Client> c,
void process_change_block(shared_ptr<ServerState> s, shared_ptr<Client> c,
uint16_t command, uint32_t flag, const string& data) { // A1
// newserv doesn't have blocks; treat block change as ship change
// newserv doesn't have blocks; treat block change the same as ship change
process_change_ship(s, c, command, flag, data);
}
+5
View File
@@ -1059,6 +1059,11 @@ void send_player_leave_notification(shared_ptr<Lobby> l, uint8_t leaving_client_
send_command_t(l, l->is_game() ? 0x66 : 0x69, leaving_client_id, cmd);
}
void send_self_leave_notification(shared_ptr<Client> c) {
S_LeaveLobby_66_69 cmd = {c->lobby_client_id, 0, 0};
send_command_t(c, 0x69, c->lobby_client_id, cmd);
}
void send_get_player_info(shared_ptr<Client> c) {
send_command(c, 0x95, 0x00);
}
+1
View File
@@ -167,6 +167,7 @@ void send_player_join_notification(std::shared_ptr<Client> c,
std::shared_ptr<Lobby> l, std::shared_ptr<Client> joining_client);
void send_player_leave_notification(std::shared_ptr<Lobby> l,
uint8_t leaving_client_id);
void send_self_leave_notification(std::shared_ptr<Client> c);
void send_get_player_info(std::shared_ptr<Client> c);
void send_arrow_update(std::shared_ptr<Lobby> l);