mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Performance] Move Discipline Loading to Client::CompleteConnect() (#4466)
* [Performance] Move Character Discipline Loading * Push * Final
This commit is contained in:
parent
b1646381b0
commit
40fecbfaf5
@ -934,6 +934,7 @@ void Client::CompleteConnect()
|
||||
}
|
||||
|
||||
database.LoadAuras(this); // this ends up spawning them so probably safer to load this later (here)
|
||||
database.LoadCharacterDisciplines(this);
|
||||
|
||||
entity_list.RefreshClientXTargets(this);
|
||||
|
||||
@ -1318,7 +1319,6 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
database.LoadCharacterInspectMessage(cid, &m_inspect_message); /* Load Character Inspect Message */
|
||||
database.LoadCharacterSpellBook(cid, &m_pp); /* Load Character Spell Book */
|
||||
database.LoadCharacterMemmedSpells(cid, &m_pp); /* Load Character Memorized Spells */
|
||||
database.LoadCharacterDisciplines(cid, &m_pp); /* Load Character Disciplines */
|
||||
database.LoadCharacterLanguages(cid, &m_pp); /* Load Character Languages */
|
||||
database.LoadCharacterLeadershipAbilities(cid, &m_pp); /* Load Character Leadership AA's */
|
||||
database.LoadCharacterTribute(this); /* Load CharacterTribute */
|
||||
|
||||
@ -671,12 +671,16 @@ bool ZoneDatabase::LoadCharacterLeadershipAbilities(uint32 character_id, PlayerP
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ZoneDatabase::LoadCharacterDisciplines(uint32 character_id, PlayerProfile_Struct* pp){
|
||||
bool ZoneDatabase::LoadCharacterDisciplines(Client* c)
|
||||
{
|
||||
if (!c) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto& l = CharacterDisciplinesRepository::GetWhere(
|
||||
database, fmt::format(
|
||||
"`id` = {} ORDER BY `slot_id`",
|
||||
character_id
|
||||
c->CharacterID()
|
||||
)
|
||||
);
|
||||
|
||||
@ -684,16 +688,18 @@ bool ZoneDatabase::LoadCharacterDisciplines(uint32 character_id, PlayerProfile_S
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int slot_id = 0; slot_id < MAX_PP_DISCIPLINES; slot_id++) { // Initialize Disciplines
|
||||
pp->disciplines.values[slot_id] = 0;
|
||||
for (int slot_id = 0; slot_id < MAX_PP_DISCIPLINES; slot_id++) {
|
||||
c->GetPP().disciplines.values[slot_id] = 0;
|
||||
}
|
||||
|
||||
for (const auto& e : l) {
|
||||
if (IsValidSpell(e.disc_id) && e.slot_id < MAX_PP_DISCIPLINES) {
|
||||
pp->disciplines.values[e.slot_id] = e.disc_id;
|
||||
c->GetPP().disciplines.values[e.slot_id] = e.disc_id;
|
||||
}
|
||||
}
|
||||
|
||||
c->SendDisciplineUpdate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -436,7 +436,7 @@ public:
|
||||
bool LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Struct* pp);
|
||||
bool LoadCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp);
|
||||
bool LoadCharacterData(uint32 character_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp);
|
||||
bool LoadCharacterDisciplines(uint32 character_id, PlayerProfile_Struct* pp);
|
||||
bool LoadCharacterDisciplines(Client* c);
|
||||
bool LoadCharacterFactionValues(uint32 character_id, faction_map & val_list);
|
||||
bool LoadCharacterLanguages(uint32 character_id, PlayerProfile_Struct* pp);
|
||||
bool LoadCharacterLeadershipAbilities(uint32 character_id, PlayerProfile_Struct* pp);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user