[Performance] Store Player Title Sets in Client Memory (#4836)

* [Performance] Store Player Title Sets in Zone Memory

* Move to client memory

* Update client_packet.cpp

* Update zonedb.cpp

* Save only when necessary

* Single Insert

* Add optional insert flag

* Update client.h

* Consolidation
This commit is contained in:
Alex King
2025-05-14 21:46:11 -04:00
committed by GitHub
parent 4a9779635d
commit c36c336bc7
7 changed files with 61 additions and 16 deletions
+25
View File
@@ -4272,3 +4272,28 @@ void ZoneDatabase::SaveCharacterEXPModifier(Client* c)
}
);
}
void ZoneDatabase::LoadCharacterTitleSets(Client* c)
{
if (!zone || !c) {
return;
}
const auto& l = PlayerTitlesetsRepository::GetWhere(
*this,
fmt::format(
"`char_id` = {}",
c->CharacterID()
)
);
if (l.empty()) {
return;
}
const uint32 character_id = c->CharacterID();
for (const auto& e : l) {
c->EnableTitle(e.title_set, false);
}
}