fix BB joinable quest loading bug

This commit is contained in:
Martin Michelsen
2023-10-31 11:02:52 -07:00
parent 8c85868e08
commit d97db987cd
2 changed files with 10 additions and 9 deletions
+5 -3
View File
@@ -1364,11 +1364,13 @@ struct S_LeaveLobby_66_69_Ep3_E9 {
// 6E: Invalid command
// 6F (C->S): Set game status
// 6F (C->S): Done loading
// Internal name: SndBurstEnd
// This command is sent when a player is done loading and other players can then
// join the game. On BB, this command is sent as 016F if a quest is in progress
// and the game should not be joined by anyone else.
// join the game. On BB, this command is sent a 006F after loading into a game,
// or as 016F after loading a joinable quest. (This means when a BB client joins
// a game with a quest in progress, they will send 006F when they're ready to
// receive the quest files, and 016F when they're actually ready to play.)
// 70: Invalid command
// 71: Invalid command
+5 -6
View File
@@ -3654,7 +3654,7 @@ static void on_8A(shared_ptr<Client> c, uint16_t, uint32_t, string& data) {
}
}
static void on_6F(shared_ptr<Client> c, uint16_t, uint32_t, string& data) {
static void on_6F(shared_ptr<Client> c, uint16_t command, uint32_t, string& data) {
check_size_v(data.size(), 0);
auto l = c->require_lobby();
@@ -3668,11 +3668,10 @@ static void on_6F(shared_ptr<Client> c, uint16_t, uint32_t, string& data) {
send_set_exp_multiplier(l);
}
send_server_time(c);
// Only get player info again on BB, since on other versions the returned info
// only includes items that would be saved if the client disconnects
// unexpectedly (that is, only equipped items are included).
if (c->version() == GameVersion::BB) {
send_get_player_info(c);
// BB sends 016F when the client is done loading a quest. In that case, we
// shouldn't send the quest to them again!
if (command == 0x006F && c->version() == GameVersion::BB) {
if (l->check_flag(Lobby::Flag::JOINABLE_QUEST_IN_PROGRESS)) {
if (!l->quest) {
throw runtime_error("JOINABLE_QUEST_IN_PROGRESS is set, but lobby has no quest");