Core/Misc: Send saved client settings instantly after login, not only after entering world

Port From (https://github.com/TrinityCore/TrinityCore/commit/3917c2ad01882d43265e38c66e35b0a7fe3f087f)
This commit is contained in:
hondacrx
2021-11-07 20:53:30 -05:00
parent f766a06c8d
commit f60ff57739
4 changed files with 18 additions and 8 deletions
+13
View File
@@ -427,6 +427,18 @@ namespace Game
return _registeredAddonPrefixes.Contains(prefix);
}
public void SendAccountDataTimes(ObjectGuid playerGuid, AccountDataTypes mask)
{
AccountDataTimes accountDataTimes = new();
accountDataTimes.PlayerGuid = playerGuid;
accountDataTimes.ServerTime = GameTime.GetGameTime();
for (int i = 0; i < (int)AccountDataTypes.Max; ++i)
if (((int)mask & (1 << i)) != 0)
accountDataTimes.AccountTimes[i] = GetAccountData((AccountDataTypes)i).Time;
SendPacket(accountDataTimes);
}
public void LoadTutorialsData(SQLResult result)
{
if (!result.IsEmpty())
@@ -755,6 +767,7 @@ namespace Game
SendFeatureSystemStatusGlueScreen();
SendClientCacheVersion(WorldConfig.GetUIntValue(WorldCfg.ClientCacheVersion));
SendAvailableHotfixes();
SendAccountDataTimes(ObjectGuid.Empty, AccountDataTypes.GlobalCacheMask);
SendTutorialsData();
SQLResult result = holder.GetResult(AccountInfoQueryLoad.GlobalRealmCharacterCounts);