mirror of
https://github.com/mangosfour/server.git
synced 2026-01-02 01:37:05 +00:00
[7643] Allow set, store and output creture EventAI data version in addition to world DB and script library versions.
This commit is contained in:
parent
2be68b15cd
commit
34d69bbfdd
10 changed files with 37 additions and 9 deletions
|
|
@ -82,7 +82,8 @@ enum MangosStrings
|
|||
LANG_MOTD_CURRENT = 56,
|
||||
LANG_USING_WORLD_DB = 57,
|
||||
LANG_USING_SCRIPT_LIB = 58,
|
||||
// Room for more level 0 59-99 not used
|
||||
LANG_USING_EVENT_AI = 59,
|
||||
// Room for more level 0 60-99 not used
|
||||
|
||||
// level 1 chat
|
||||
LANG_GLOBAL_NOTIFY = 100,
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
|
|||
SendSysMessage(full);
|
||||
PSendSysMessage(LANG_USING_SCRIPT_LIB,sWorld.GetScriptsVersion());
|
||||
PSendSysMessage(LANG_USING_WORLD_DB,sWorld.GetDBVersion());
|
||||
PSendSysMessage(LANG_USING_EVENT_AI,sWorld.GetCreatureEventAIVersion());
|
||||
PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
|
||||
PSendSysMessage(LANG_UPTIME, str.c_str());
|
||||
|
||||
|
|
|
|||
|
|
@ -2829,14 +2829,19 @@ void World::UpdateMaxSessionCounters()
|
|||
|
||||
void World::LoadDBVersion()
|
||||
{
|
||||
QueryResult* result = WorldDatabase.Query("SELECT version FROM db_version LIMIT 1");
|
||||
QueryResult* result = WorldDatabase.Query("SELECT version, creature_ai_version FROM db_version LIMIT 1");
|
||||
if(result)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
m_DBVersion = fields[0].GetString();
|
||||
m_DBVersion = fields[0].GetCppString();
|
||||
m_CreatureEventAIVersion = fields[1].GetCppString();
|
||||
delete result;
|
||||
}
|
||||
else
|
||||
m_DBVersion = "unknown world database";
|
||||
|
||||
if(m_DBVersion.empty())
|
||||
m_DBVersion = "Unknown world database.";
|
||||
|
||||
if(m_CreatureEventAIVersion.empty())
|
||||
m_CreatureEventAIVersion = "Unknown creature EventAI.";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -503,6 +503,7 @@ class World
|
|||
//used World DB version
|
||||
void LoadDBVersion();
|
||||
char const* GetDBVersion() { return m_DBVersion.c_str(); }
|
||||
char const* GetCreatureEventAIVersion() { return m_CreatureEventAIVersion.c_str(); }
|
||||
|
||||
//used Script version
|
||||
void SetScriptsVersion(char const* version) { m_ScriptsVersion = version ? version : "unknown scripting library"; }
|
||||
|
|
@ -571,6 +572,7 @@ class World
|
|||
|
||||
//used versions
|
||||
std::string m_DBVersion;
|
||||
std::string m_CreatureEventAIVersion;
|
||||
std::string m_ScriptsVersion;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -447,7 +447,8 @@ bool Master::_StartDB()
|
|||
|
||||
sWorld.LoadDBVersion();
|
||||
|
||||
sLog.outString("Using %s", sWorld.GetDBVersion());
|
||||
sLog.outString("Using World DB: %s", sWorld.GetDBVersion());
|
||||
sLog.outString("Using creature EventAI: %s", sWorld.GetCreatureEventAIVersion());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7642"
|
||||
#define REVISION_NR "7643"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue