Core/Mail: Load mails at login instead of on demand when queried by packets (logging in always sends one of the packets that cause mail loading anyway)

Port From (https://github.com/TrinityCore/TrinityCore/commit/a9b4f9aca0d0b90e59e0ed26e9bb4cce7d0ceeab)
This commit is contained in:
hondacrx
2022-03-02 09:52:35 -05:00
parent 6e6ee2d694
commit 150b09205b
9 changed files with 95 additions and 126 deletions
+31 -7
View File
@@ -2693,14 +2693,33 @@ namespace Game
stmt.AddValue(0, lowGuid);
SetQuery(PlayerLoginQueryLoad.Actions, stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_MAILCOUNT);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAIL);
stmt.AddValue(0, lowGuid);
stmt.AddValue(1, GameTime.GetGameTime());
SetQuery(PlayerLoginQueryLoad.MailCount, stmt);
SetQuery(PlayerLoginQueryLoad.Mails, stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_MAILDATE);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS);
stmt.AddValue(0, lowGuid);
SetQuery(PlayerLoginQueryLoad.MailDate, stmt);
SetQuery(PlayerLoginQueryLoad.MailItems, stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_ARTIFACT);
stmt.AddValue(0, lowGuid);
SetQuery(PlayerLoginQueryLoad.MailItemsArtifact, stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE);
stmt.AddValue(0, lowGuid);
SetQuery(PlayerLoginQueryLoad.MailItemsAzerite, stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_MILESTONE_POWER);
stmt.AddValue(0, lowGuid);
SetQuery(PlayerLoginQueryLoad.MailItemsAzeriteMilestonePower, stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_UNLOCKED_ESSENCE);
stmt.AddValue(0, lowGuid);
SetQuery(PlayerLoginQueryLoad.MailItemsAzeriteUnlockedEssence, stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAILITEMS_AZERITE_EMPOWERED);
stmt.AddValue(0, lowGuid);
SetQuery(PlayerLoginQueryLoad.MailItemsAzeriteEmpowered, stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_SOCIALLIST);
stmt.AddValue(0, lowGuid);
@@ -2884,8 +2903,13 @@ namespace Game
AzeriteUnlockedEssences,
AzeriteEmpowered,
Actions,
MailCount,
MailDate,
Mails,
MailItems,
MailItemsArtifact,
MailItemsAzerite,
MailItemsAzeriteMilestonePower,
MailItemsAzeriteUnlockedEssence,
MailItemsAzeriteEmpowered,
SocialList,
HomeBind,
SpellCooldowns,