mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-04 03:23:48 +00:00
refactor(Core/Motd): Move motd to MotdMgr (#16933)
This commit is contained in:
@@ -598,7 +598,6 @@ public:
|
||||
[[nodiscard]] virtual LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const = 0;
|
||||
virtual void LoadDBVersion() = 0;
|
||||
[[nodiscard]] virtual char const* GetDBVersion() const = 0;
|
||||
virtual void LoadMotd() = 0;
|
||||
virtual void UpdateAreaDependentAuras() = 0;
|
||||
[[nodiscard]] virtual uint32 GetCleaningFlags() const = 0;
|
||||
virtual void SetCleaningFlags(uint32 flags) = 0;
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
#include "PoolMgr.h"
|
||||
#include "Realm.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ServerMotd.h"
|
||||
#include "MotdMgr.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "SkillExtraItems.h"
|
||||
#include "SmartAI.h"
|
||||
@@ -2005,8 +2005,8 @@ void World::SetInitialWorldSettings()
|
||||
sAutobroadcastMgr->LoadAutobroadcasts();
|
||||
|
||||
///- Load Motd
|
||||
LOG_INFO("server.loading", "Loading MotD...");
|
||||
LoadMotd();
|
||||
LOG_INFO("server.loading", "Loading Motd...");
|
||||
sMotdMgr->LoadMotd();
|
||||
|
||||
///- Load and initialize scripts
|
||||
sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||
@@ -2236,39 +2236,6 @@ void World::DetectDBCLang()
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
void World::LoadMotd()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
uint32 realmId = sConfigMgr->GetOption<int32>("RealmID", 0);
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_MOTD);
|
||||
stmt->SetData(0, realmId);
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
std::string motd;
|
||||
|
||||
if (result)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
motd = fields[0].Get<std::string>();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_WARN("server.loading", ">> Loaded 0 motd definitions. DB table `motd` is empty for this realm!");
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
motd = /* fctlsup << //0x338// "63"+"cx""d2"+"1e""dd"+"cx""ds"+"ce""dd"+"ce""7D"+ << */ motd
|
||||
/*"d3"+"ce"*/ + "@|" + "cf" +/*"as"+"k4"*/"fF" + "F4" +/*"d5"+"f3"*/"A2" + "DT"/*"F4"+"Az"*/ + "hi" + "s "
|
||||
/*"fd"+"hy"*/ + "se" + "rv" +/*"nh"+"k3"*/"er" + " r" +/*"x1"+"A2"*/"un" + "s "/*"F2"+"Ay"*/ + "on" + " Az"
|
||||
/*"xs"+"5n"*/ + "er" + "ot" +/*"xs"+"A2"*/"hC" + "or" +/*"a4"+"f3"*/"e|" + "r "/*"f2"+"A2"*/ + "|c" + "ff"
|
||||
/*"5g"+"A2"*/ + "3C" + "E7" +/*"k5"+"AX"*/"FF" + "ww" +/*"sx"+"Gj"*/"w." + "az"/*"a1"+"vf"*/ + "er" + "ot"
|
||||
/*"ds"+"sx"*/ + "hc" + "or" +/*"F4"+"k5"*/"e." + "or" +/*"po"+"xs"*/"g|r"/*"F4"+"p2"+"o4"+"A2"+"i2"*/;;
|
||||
Motd::SetMotd(motd);
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded Motd Definitions in {} ms", GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
/// Update the World !
|
||||
void World::Update(uint32 diff)
|
||||
{
|
||||
|
||||
@@ -338,8 +338,6 @@ public:
|
||||
void LoadDBVersion() override;
|
||||
[[nodiscard]] char const* GetDBVersion() const override { return _dbVersion.c_str(); }
|
||||
|
||||
void LoadMotd() override;
|
||||
|
||||
void UpdateAreaDependentAuras() override;
|
||||
|
||||
[[nodiscard]] uint32 GetCleaningFlags() const override { return _cleaningFlags; }
|
||||
|
||||
Reference in New Issue
Block a user