aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Chat
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-08-18 18:59:58 +0200
committerOvahlord <dreadkiller@gmx.de>2024-08-18 20:39:21 +0200
commit25ffdbc5ef0859aeaadfa132329a498e86827e68 (patch)
treed7df51da8cdc3e3df7c50e5058803f9324715ee4 /src/server/game/Chat
parent0c98004896cb91ef2d22baa5569ff0e0d6cd15ee (diff)
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, mysteriously removed 15 years ago in f20b25d1c90f608deab28c9957b3b376ab2a0d50 (cherry picked from commit c4b710446d62c95eb8124175203fa5f394912594) # Conflicts: # sql/base/auth_database.sql
Diffstat (limited to 'src/server/game/Chat')
-rw-r--r--src/server/game/Chat/Channels/ChannelMgr.cpp9
-rw-r--r--src/server/game/Chat/Chat.cpp4
2 files changed, 7 insertions, 6 deletions
diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp
index 7b05b344f65..ea06221f36d 100644
--- a/src/server/game/Chat/Channels/ChannelMgr.cpp
+++ b/src/server/game/Chat/Channels/ChannelMgr.cpp
@@ -22,7 +22,7 @@
#include "DB2Stores.h"
#include "Log.h"
#include "Player.h"
-#include "Realm.h"
+#include "RealmList.h"
#include "World.h"
#include "WorldSession.h"
@@ -286,9 +286,10 @@ ObjectGuid ChannelMgr::CreateBuiltinChannelGuid(uint32 channelId, AreaTableEntry
zoneId = zoneEntry->ID;
if (channelEntry->GetFlags().HasFlag(ChatChannelFlags::GlobalForTournament))
- if (Cfg_CategoriesEntry const* category = sCfgCategoriesStore.LookupEntry(realm.Timezone))
- if (category->GetFlags().HasFlag(CfgCategoriesFlags::Tournament))
- zoneId = 0;
+ if (std::shared_ptr<Realm const> currentRealm = sRealmList->GetCurrentRealm())
+ if (Cfg_CategoriesEntry const* category = sCfgCategoriesStore.LookupEntry(currentRealm->Timezone))
+ if (category->GetFlags().HasFlag(CfgCategoriesFlags::Tournament))
+ zoneId = 0;
return ObjectGuid::Create<HighGuid::ChatChannel>(true, channelEntry->GetFlags().HasFlag(ChatChannelFlags::LinkedChannel), zoneId, _team == ALLIANCE ? 3 : 5, channelId);
}
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 832d14631bc..4255cc1daad 100644
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -29,7 +29,7 @@
#include "ObjectMgr.h"
#include "Optional.h"
#include "Player.h"
-#include "Realm.h"
+#include "RealmList.h"
#include "StringConvert.h"
#include "World.h"
#include "WorldSession.h"
@@ -95,7 +95,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
if (target)
target_sec = target->GetSecurity();
else if (target_account)
- target_sec = AccountMgr::GetSecurity(target_account, realm.Id.Realm);
+ target_sec = AccountMgr::GetSecurity(target_account, sRealmList->GetCurrentRealmId().Realm);
else
return true; // caller must report error for (target == nullptr && target_account == 0)