Core/Realms: Realmlist refactors

* Removed global realm variable from World and use RealmList everywhere
* Match auth build key with client version
* Restored allowedSecurityLevel checks for realmlist packet building
* Restored updating population field
Port From (https://github.com/TrinityCore/TrinityCore/commit/c4b710446d62c95eb8124175203fa5f394912594)
This commit is contained in:
Hondacrx
2024-09-26 12:53:15 -04:00
parent 8341244e4d
commit d70529bc19
36 changed files with 393 additions and 298 deletions
@@ -22,13 +22,15 @@ namespace Game
response.SuccessInfo = new AuthResponse.AuthSuccessInfo();
response.SuccessInfo.ActiveExpansionLevel = (byte)GetExpansion();
response.SuccessInfo.AccountExpansionLevel = (byte)GetAccountExpansion();
response.SuccessInfo.VirtualRealmAddress = Global.WorldMgr.GetVirtualRealmAddress();
response.SuccessInfo.Time = (uint)GameTime.GetGameTime();
var realm = Global.WorldMgr.GetRealm();
// Send current home realm. Also there is no need to send it later in realm queries.
response.SuccessInfo.VirtualRealms.Add(new VirtualRealmInfo(realm.Id.GetAddress(), true, false, realm.Name, realm.NormalizedName));
var currentRealm = Global.RealmMgr.GetCurrentRealm();
if(currentRealm != null)
{
response.SuccessInfo.VirtualRealmAddress = currentRealm.Id.GetAddress();
response.SuccessInfo.VirtualRealms.Add(new VirtualRealmInfo(currentRealm.Id.GetAddress(), true, false, currentRealm.Name, currentRealm.NormalizedName));
}
if (HasPermission(RBACPermissions.UseCharacterTemplates))
foreach (var templ in Global.CharacterTemplateDataStorage.GetCharacterTemplates().Values)