fix session hang on empty download quest menu
This commit is contained in:
+5
-14
@@ -1730,16 +1730,11 @@ static void on_10(shared_ptr<ServerState> s, shared_ptr<Client> c,
|
|||||||
shared_ptr<Lobby> l = c->lobby_id ? s->find_lobby(c->lobby_id) : nullptr;
|
shared_ptr<Lobby> l = c->lobby_id ? s->find_lobby(c->lobby_id) : nullptr;
|
||||||
auto quests = s->quest_index->filter(
|
auto quests = s->quest_index->filter(
|
||||||
c->version(), c->flags & Client::Flag::IS_DC_V1, QuestCategory::EPISODE_3);
|
c->version(), c->flags & Client::Flag::IS_DC_V1, QuestCategory::EPISODE_3);
|
||||||
if (quests.empty()) {
|
// Episode 3 has only download quests, not online quests, so this is
|
||||||
send_lobby_message_box(c, u"$C6There are no quests\navailable.");
|
// always the download quest menu. (Episode 3 does actually have
|
||||||
} else {
|
// online quests, but they're served via a server data request
|
||||||
// Episode 3 has only download quests, not online quests, so this
|
// instead of the file download paradigm that other versions use.)
|
||||||
// is always the download quest menu. (Episode 3 does actually
|
send_quest_menu(c, MenuID::QUEST, quests, true);
|
||||||
// have online quests, but they're served via a server data
|
|
||||||
// request instead of the file download paradigm that all other
|
|
||||||
// versions use.)
|
|
||||||
send_quest_menu(c, MenuID::QUEST, quests, true);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
send_quest_menu(c, MenuID::QUEST_FILTER, quest_download_menu, true);
|
send_quest_menu(c, MenuID::QUEST_FILTER, quest_download_menu, true);
|
||||||
}
|
}
|
||||||
@@ -1948,10 +1943,6 @@ static void on_10(shared_ptr<ServerState> s, shared_ptr<Client> c,
|
|||||||
auto quests = s->quest_index->filter(c->version(),
|
auto quests = s->quest_index->filter(c->version(),
|
||||||
c->flags & Client::Flag::IS_DC_V1,
|
c->flags & Client::Flag::IS_DC_V1,
|
||||||
static_cast<QuestCategory>(item_id & 0xFF));
|
static_cast<QuestCategory>(item_id & 0xFF));
|
||||||
if (quests.empty()) {
|
|
||||||
send_lobby_message_box(c, u"$C6There are no quests\navailable in that\ncategory.");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hack: Assume the menu to be sent is the download quest menu if the
|
// Hack: Assume the menu to be sent is the download quest menu if the
|
||||||
// client is not in any lobby
|
// client is not in any lobby
|
||||||
|
|||||||
@@ -630,14 +630,15 @@ static void on_subcommand_box_or_enemy_item_drop(shared_ptr<ServerState>,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerInventoryItem item;
|
if (l->flags & Lobby::Flag::ITEM_TRACKING_ENABLED) {
|
||||||
item.present = 1;
|
PlayerInventoryItem item;
|
||||||
item.flags = 0;
|
item.present = 1;
|
||||||
item.data = cmd.data;
|
item.flags = 0;
|
||||||
l->add_item(item, cmd.area, cmd.x, cmd.z);
|
item.data = cmd.data;
|
||||||
|
l->add_item(item, cmd.area, cmd.x, cmd.z);
|
||||||
l->log.info("Leader created ground item %08" PRIX32 " at %hhu:(%g, %g)",
|
l->log.info("Leader created ground item %08" PRIX32 " at %hhu:(%g, %g)",
|
||||||
item.data.id.load(), cmd.area, cmd.x.load(), cmd.z.load());
|
item.data.id.load(), cmd.area, cmd.x.load(), cmd.z.load());
|
||||||
|
}
|
||||||
|
|
||||||
forward_subcommand(l, c, command, flag, data);
|
forward_subcommand(l, c, command, flag, data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user