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:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
CypherCore is an open source server project for World of Warcraft written in C#.
|
CypherCore is an open source server project for World of Warcraft written in C#.
|
||||||
|
|
||||||
The current support game version is: 9.1.0.40725
|
The current support game version is: 9.1.5.40944
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
* Visual Studio 2019 with .NET 5.0 [Download](https://www.visualstudio.com/downloads/)
|
* Visual Studio 2019 with .NET 5.0 [Download](https://www.visualstudio.com/downloads/)
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ namespace Framework.Constants
|
|||||||
|
|
||||||
Max = 12,
|
Max = 12,
|
||||||
|
|
||||||
|
AllAccountDataCacheMask = 0xFFF,
|
||||||
GlobalCacheMask = 0x515,
|
GlobalCacheMask = 0x515,
|
||||||
PerCharacterCacheMask = 0xAEA
|
PerCharacterCacheMask = 0xAEA
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -733,6 +733,7 @@ namespace Game
|
|||||||
|
|
||||||
pCurrChar.SetVirtualPlayerRealm(Global.WorldMgr.GetVirtualRealmAddress());
|
pCurrChar.SetVirtualPlayerRealm(Global.WorldMgr.GetVirtualRealmAddress());
|
||||||
|
|
||||||
|
SendAccountDataTimes(ObjectGuid.Empty, AccountDataTypes.GlobalCacheMask);
|
||||||
SendTutorialsData();
|
SendTutorialsData();
|
||||||
|
|
||||||
pCurrChar.GetMotionMaster().Initialize();
|
pCurrChar.GetMotionMaster().Initialize();
|
||||||
@@ -743,15 +744,10 @@ namespace Game
|
|||||||
loginVerifyWorld.Pos = pCurrChar.GetPosition();
|
loginVerifyWorld.Pos = pCurrChar.GetPosition();
|
||||||
SendPacket(loginVerifyWorld);
|
SendPacket(loginVerifyWorld);
|
||||||
|
|
||||||
|
// load player specific part before send times
|
||||||
LoadAccountData(holder.GetResult(PlayerLoginQueryLoad.AccountData), AccountDataTypes.PerCharacterCacheMask);
|
LoadAccountData(holder.GetResult(PlayerLoginQueryLoad.AccountData), AccountDataTypes.PerCharacterCacheMask);
|
||||||
|
|
||||||
AccountDataTimes accountDataTimes = new();
|
SendAccountDataTimes(playerGuid, AccountDataTypes.AllAccountDataCacheMask);
|
||||||
accountDataTimes.PlayerGuid = playerGuid;
|
|
||||||
accountDataTimes.ServerTime = (uint)GameTime.GetGameTime();
|
|
||||||
for (AccountDataTypes i = 0; i < AccountDataTypes.Max; ++i)
|
|
||||||
accountDataTimes.AccountTimes[(int)i] = (uint)GetAccountData(i).Time;
|
|
||||||
|
|
||||||
SendPacket(accountDataTimes);
|
|
||||||
|
|
||||||
SendFeatureSystemStatus();
|
SendFeatureSystemStatus();
|
||||||
|
|
||||||
|
|||||||
@@ -427,6 +427,18 @@ namespace Game
|
|||||||
return _registeredAddonPrefixes.Contains(prefix);
|
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)
|
public void LoadTutorialsData(SQLResult result)
|
||||||
{
|
{
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
@@ -755,6 +767,7 @@ namespace Game
|
|||||||
SendFeatureSystemStatusGlueScreen();
|
SendFeatureSystemStatusGlueScreen();
|
||||||
SendClientCacheVersion(WorldConfig.GetUIntValue(WorldCfg.ClientCacheVersion));
|
SendClientCacheVersion(WorldConfig.GetUIntValue(WorldCfg.ClientCacheVersion));
|
||||||
SendAvailableHotfixes();
|
SendAvailableHotfixes();
|
||||||
|
SendAccountDataTimes(ObjectGuid.Empty, AccountDataTypes.GlobalCacheMask);
|
||||||
SendTutorialsData();
|
SendTutorialsData();
|
||||||
|
|
||||||
SQLResult result = holder.GetResult(AccountInfoQueryLoad.GlobalRealmCharacterCounts);
|
SQLResult result = holder.GetResult(AccountInfoQueryLoad.GlobalRealmCharacterCounts);
|
||||||
|
|||||||
Reference in New Issue
Block a user