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
@@ -146,7 +146,7 @@ namespace BNetServer.Networking
var lastPlayerChar = gameAccountInfo.LastPlayedCharacters.LookupByKey(subRegion.StringValue);
if (lastPlayerChar != null)
{
var compressed = Global.RealmMgr.GetRealmEntryJSON(lastPlayerChar.RealmId, build);
var compressed = Global.RealmMgr.GetRealmEntryJSON(lastPlayerChar.RealmId, build, gameAccountInfo.SecurityLevel);
if (compressed.Length == 0)
return BattlenetRpcErrorCode.UtilServerFailedToSerializeResponse;
@@ -191,7 +191,7 @@ namespace BNetServer.Networking
if (subRegion != null)
subRegionId = subRegion.StringValue;
var compressed = Global.RealmMgr.GetRealmList(build, subRegionId);
var compressed = Global.RealmMgr.GetRealmList(build, gameAccountInfo.SecurityLevel, subRegionId);
if (compressed.Length == 0)
return BattlenetRpcErrorCode.UtilServerFailedToSerializeResponse;
@@ -227,7 +227,7 @@ namespace BNetServer.Networking
{
Variant realmAddress = Params.LookupByKey("Param_RealmAddress");
if (realmAddress != null)
return Global.RealmMgr.JoinRealm((uint)realmAddress.UintValue, build, GetRemoteIpAddress(), clientSecret, (Locale)Enum.Parse(typeof(Locale), locale), os, _timezoneOffset, gameAccountInfo.Name, response);
return Global.RealmMgr.JoinRealm((uint)realmAddress.UintValue, build, GetRemoteIpAddress(), clientSecret, (Locale)Enum.Parse(typeof(Locale), locale), os, _timezoneOffset, gameAccountInfo.Name, gameAccountInfo.SecurityLevel, response);
return BattlenetRpcErrorCode.WowServicesInvalidJoinTicket;
}