Refactor expedition member online status requests

This optimizes character status requests by only sending a single
bulk request to world for characters in all expeditions instead of
sending a separate request for each expedition on zone startup
This commit is contained in:
hg committed 2020-12-30 18:47:09 -05:00
1 parent 2c4f505309
commit 402491b36b
4 files changed
+28 -23

No files matched your search

+8 -8
View File
@@ -510,15 +510,15 @@ void ExpeditionMessage::GetOnlineMembers(ServerPacket* pack)
for (uint32_t i = 0; i < buf->count; ++i)
{
for (const auto& cle : all_clients)
auto it = std::find_if(all_clients.begin(), all_clients.end(), [&](const ClientListEntry* cle) {
return (cle && cle->CharID() == buf->entries[i].character_id);
});
if (it != all_clients.end())
{
if (cle && cle->CharID() == buf->entries[i].character_id)
{
buf->entries[i].character_zone_id = cle->zone();
buf->entries[i].character_instance_id = cle->instance();
buf->entries[i].character_online = true;
break;
}
buf->entries[i].character_zone_id = (*it)->zone();
buf->entries[i].character_instance_id = (*it)->instance();
buf->entries[i].character_online = true;
}
}