mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 07:06:23 +00:00
refactor(DB): Handle SQL files in a new way (#11494)
* refactor(DB): Handle SQL files in a new way * remove proof that it works files * Update rev_1650721405699287200.sql * Update rev_1650721339143444200.sql * Update rev_1650721386624384400.sql * fix build * fix
This commit is contained in:
@@ -583,11 +583,7 @@ public:
|
||||
virtual void UpdateRealmCharCount(uint32 accid) = 0;
|
||||
[[nodiscard]] virtual LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const = 0;
|
||||
virtual void LoadDBVersion() = 0;
|
||||
virtual void LoadDBRevision() = 0;
|
||||
[[nodiscard]] virtual char const* GetDBVersion() const = 0;
|
||||
[[nodiscard]] virtual char const* GetWorldDBRevision() const = 0;
|
||||
[[nodiscard]] virtual char const* GetCharacterDBRevision() const = 0;
|
||||
[[nodiscard]] virtual char const* GetAuthDBRevision() const = 0;
|
||||
virtual void LoadAutobroadcasts() = 0;
|
||||
virtual void UpdateAreaDependentAuras() = 0;
|
||||
[[nodiscard]] virtual uint32 GetCleaningFlags() const = 0;
|
||||
|
||||
@@ -3268,45 +3268,6 @@ void World::LoadDBVersion()
|
||||
m_DBVersion = "Unknown world database.";
|
||||
}
|
||||
|
||||
void World::LoadDBRevision()
|
||||
{
|
||||
QueryResult resultWorld = WorldDatabase.Query("SELECT date FROM version_db_world ORDER BY date DESC LIMIT 1");
|
||||
QueryResult resultCharacter = CharacterDatabase.Query("SELECT date FROM version_db_characters ORDER BY date DESC LIMIT 1");
|
||||
QueryResult resultAuth = LoginDatabase.Query("SELECT date FROM version_db_auth ORDER BY date DESC LIMIT 1");
|
||||
|
||||
if (resultWorld)
|
||||
{
|
||||
Field* fields = resultWorld->Fetch();
|
||||
|
||||
m_WorldDBRevision = fields[0].Get<std::string>();
|
||||
}
|
||||
if (resultCharacter)
|
||||
{
|
||||
Field* fields = resultCharacter->Fetch();
|
||||
|
||||
m_CharacterDBRevision = fields[0].Get<std::string>();
|
||||
}
|
||||
if (resultAuth)
|
||||
{
|
||||
Field* fields = resultAuth->Fetch();
|
||||
|
||||
m_AuthDBRevision = fields[0].Get<std::string>();
|
||||
}
|
||||
|
||||
if (m_WorldDBRevision.empty())
|
||||
{
|
||||
m_WorldDBRevision = "Unkown World Database Revision";
|
||||
}
|
||||
if (m_CharacterDBRevision.empty())
|
||||
{
|
||||
m_CharacterDBRevision = "Unkown Character Database Revision";
|
||||
}
|
||||
if (m_AuthDBRevision.empty())
|
||||
{
|
||||
m_AuthDBRevision = "Unkown Auth Database Revision";
|
||||
}
|
||||
}
|
||||
|
||||
void World::UpdateAreaDependentAuras()
|
||||
{
|
||||
SessionMap::const_iterator itr;
|
||||
|
||||
@@ -339,11 +339,7 @@ public:
|
||||
|
||||
// used World DB version
|
||||
void LoadDBVersion() override;
|
||||
void LoadDBRevision() override;
|
||||
[[nodiscard]] char const* GetDBVersion() const override { return m_DBVersion.c_str(); }
|
||||
[[nodiscard]] char const* GetWorldDBRevision() const override { return m_WorldDBRevision.c_str(); }
|
||||
[[nodiscard]] char const* GetCharacterDBRevision() const override { return m_CharacterDBRevision.c_str(); }
|
||||
[[nodiscard]] char const* GetAuthDBRevision() const override { return m_AuthDBRevision.c_str(); }
|
||||
|
||||
void LoadAutobroadcasts() override;
|
||||
|
||||
@@ -440,9 +436,6 @@ private:
|
||||
|
||||
// used versions
|
||||
std::string m_DBVersion;
|
||||
std::string m_WorldDBRevision;
|
||||
std::string m_CharacterDBRevision;
|
||||
std::string m_AuthDBRevision;
|
||||
|
||||
typedef std::map<uint8, std::string> AutobroadcastsMap;
|
||||
AutobroadcastsMap m_Autobroadcasts;
|
||||
|
||||
@@ -213,9 +213,6 @@ public:
|
||||
handler->PSendSysMessage("Using %s DBC Locale as default. All available DBC locales: %s", localeNames[defaultLocale], availableLocales.c_str());
|
||||
|
||||
handler->PSendSysMessage("Using World DB: %s", sWorld->GetDBVersion());
|
||||
handler->PSendSysMessage("Using World DB Revision: %s", sWorld->GetWorldDBRevision());
|
||||
handler->PSendSysMessage("Using Character DB Revision: %s", sWorld->GetCharacterDBRevision());
|
||||
handler->PSendSysMessage("Using Auth DB Revision: %s", sWorld->GetAuthDBRevision());
|
||||
|
||||
handler->PSendSysMessage("LoginDatabase queue size: %zu", LoginDatabase.QueueSize());
|
||||
handler->PSendSysMessage("CharacterDatabase queue size: %zu", CharacterDatabase.QueueSize());
|
||||
|
||||
@@ -478,7 +478,6 @@ bool StartDB()
|
||||
WorldDatabase.Execute("UPDATE version SET core_version = '{}', core_revision = '{}'", GitRevision::GetFullVersion(), GitRevision::GetHash()); // One-time query
|
||||
|
||||
sWorld->LoadDBVersion();
|
||||
sWorld->LoadDBRevision();
|
||||
|
||||
LOG_INFO("server.loading", "> Version DB world: {}", sWorld->GetDBVersion());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user