mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
Server Banner and Status redone
This commit is contained in:
parent
63e73a18fa
commit
a7f938e7e6
6 changed files with 214 additions and 22 deletions
|
|
@ -3753,6 +3753,7 @@ enum TrackedAuraType
|
|||
// will only support WoW, WoW:TBC, WoW:WotLK and WoW:Cataclysm 4.3.4 client build 15595...
|
||||
|
||||
#define EXPECTED_MANGOSD_CLIENT_BUILD {15595, 0}
|
||||
#define EXPECTED_MANGOSD_CLIENT_VERSION {"4.3.4"}
|
||||
|
||||
// max supported expansion level in mangosd
|
||||
// NOTE: not set it more that supported by targeted client version with all expansions installed
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@
|
|||
#include "Calendar.h"
|
||||
#include "Weather.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "revision.h"
|
||||
|
||||
#ifdef ENABLE_ELUNA
|
||||
#include "LuaEngine.h"
|
||||
|
|
@ -1556,6 +1557,7 @@ void World::SetInitialWorldSettings()
|
|||
sLog.outString("Initialize AuctionHouseBot...");
|
||||
sAuctionBot.Initialize();
|
||||
sLog.outString();
|
||||
|
||||
#ifdef ENABLE_ELUNA
|
||||
///- Run eluna scripts.
|
||||
// in multithread foreach: run scripts
|
||||
|
|
@ -1563,16 +1565,103 @@ void World::SetInitialWorldSettings()
|
|||
sEluna->OnConfigLoad(false); // Must be done after Eluna is initialized and scripts have run.
|
||||
#endif
|
||||
|
||||
sLog.outString("------------------------");
|
||||
sLog.outString("WORLD: World initialized");
|
||||
sLog.outString("------------------------");
|
||||
sLog.outString();
|
||||
#ifdef ENABLE_PLAYERBOTS
|
||||
sPlayerbotAIConfig.Initialize();
|
||||
#endif
|
||||
|
||||
showFooter();
|
||||
|
||||
uint32 uStartInterval = WorldTimer::getMSTimeDiff(uStartTime, WorldTimer::getMSTime());
|
||||
sLog.outString("SERVER STARTUP TIME: %i minutes %i seconds", uStartInterval / 60000, (uStartInterval % 60000) / 1000);
|
||||
sLog.outString();
|
||||
}
|
||||
|
||||
void World::showFooter()
|
||||
{
|
||||
std::set<std::string> modules_;
|
||||
|
||||
// ELUNA is either included or disabled
|
||||
#ifdef ENABLE_ELUNA
|
||||
modules_.insert(" Eluna : Enabled");
|
||||
#endif
|
||||
|
||||
// SD3 is either included or disabled
|
||||
#ifdef ENABLE_SD3
|
||||
modules_.insert(" ScriptDev3 (SD3) : Enabled");
|
||||
#endif
|
||||
|
||||
// PLAYERBOTS can be included or excluded but also disabled via mangos.conf
|
||||
#ifdef ENABLE_PLAYERBOTS
|
||||
bool playerBotActive = sConfig.GetBoolDefault("PlayerbotAI.DisableBots", true);
|
||||
if (playerBotActive)
|
||||
{
|
||||
modules_.insert(" PlayerBots : Disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
modules_.insert(" PlayerBots : Enabled");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Remote Access can be activated / deactivated via mangos.conf
|
||||
bool raActive = sConfig.GetBoolDefault("Ra.Enable", false);
|
||||
if (raActive)
|
||||
{
|
||||
modules_.insert(" Remote Access (RA) : Enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
modules_.insert(" Remote Access (RA) : Disabled");
|
||||
}
|
||||
|
||||
// SOAP can be included or excluded but also disabled via mangos.conf
|
||||
#ifdef ENABLE_SOAP
|
||||
bool soapActive = sConfig.GetBoolDefault("SOAP.Enabled", false);
|
||||
if (soapActive)
|
||||
{
|
||||
modules_.insert(" SOAP : Enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
modules_.insert(" SOAP : Disabled");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Warden is always included, set active or disabled via mangos.conf
|
||||
bool wardenActive = (sWorld.getConfig(CONFIG_BOOL_WARDEN_WIN_ENABLED) || sWorld.getConfig(CONFIG_BOOL_WARDEN_OSX_ENABLED));
|
||||
if (wardenActive)
|
||||
{
|
||||
modules_.insert(" Warden : Enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
modules_.insert(" Warden : Disabled");
|
||||
}
|
||||
|
||||
std::string thisClientVersion = EXPECTED_MANGOSD_CLIENT_VERSION;
|
||||
std::string thisClientBuilds = AcceptableClientBuildsListStr();
|
||||
|
||||
std::string sModules;
|
||||
for (std::set<std::string>::const_iterator it = modules_.begin(); it != modules_.end(); ++it)
|
||||
sModules = sModules + " \n" + *it;
|
||||
|
||||
sLog.outString("\n"
|
||||
"_______________________________________________________\n"
|
||||
"\n"
|
||||
" MaNGOS Server: World Initialization Complete\n"
|
||||
"_______________________________________________________\n"
|
||||
"\n"
|
||||
" Server Version : %s\n"
|
||||
" Database Version : Rel%i.%i.%i\n"
|
||||
"\n"
|
||||
" Supporting Clients : %s\n"
|
||||
" Builds : %s\n"
|
||||
"\n"
|
||||
" Module Status -\n%s\n"
|
||||
"_______________________________________________________\n"
|
||||
, REVISION_NR, WORLD_DB_VERSION_NR, WORLD_DB_STRUCTURE_NR, WORLD_DB_CONTENT_NR, thisClientVersion.c_str(), thisClientBuilds.c_str(), sModules.c_str());
|
||||
}
|
||||
|
||||
void World::DetectDBCLang()
|
||||
{
|
||||
// get the DBC Locale
|
||||
|
|
|
|||
|
|
@ -539,6 +539,7 @@ class World
|
|||
void SetMotd(const std::string& motd) { m_motd = motd; }
|
||||
/// Get the current Message of the Day
|
||||
const char* GetMotd() const { return m_motd.c_str(); }
|
||||
void showFooter();
|
||||
|
||||
LocaleConstant GetDefaultDbcLocale() const { return m_defaultDbcLocale; }
|
||||
|
||||
|
|
|
|||
|
|
@ -272,24 +272,6 @@ static void usage(const char* prog)
|
|||
, prog);
|
||||
}
|
||||
|
||||
/// Print out the core banner
|
||||
static void print_banner()
|
||||
{
|
||||
sLog.outString("<Ctrl-C> to stop.\n"
|
||||
" __ __ _ _ ___ ___ ___ \n"
|
||||
" | \\/ |__ _| \\| |/ __|/ _ \\/ __| \n"
|
||||
" | |\\/| / _` | .` | (_ | (_) \\__ \\ \n"
|
||||
" |_| |_\\__,_|_|\\_|\\___|\\___/|___/ \n"
|
||||
" _____ _ \n"
|
||||
" For help and support please visit: |_ _| |_ _ _ ___ ___ \n"
|
||||
" Website: https://getmangos.eu | | | ' \\| '_/ -_) -_) \n"
|
||||
" Forum / Wiki: https://getmangos.eu |_| |_||_|_| \\___\\___| \n"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Launch the mangos server
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include <mersennetwister/MersenneTwister.h>
|
||||
#include <ace/TSS_T.h>
|
||||
#include <ace/INET_Addr.h>
|
||||
#include "Log/Log.h"
|
||||
|
||||
typedef ACE_TSS<MTRand> MTRandTSS;
|
||||
static MTRandTSS *mtRand;
|
||||
|
|
@ -689,3 +690,109 @@ void utf8printf(FILE* out, const char* str, ...)
|
|||
va_end(ap);
|
||||
}
|
||||
|
||||
int return_iCoreNumber()
|
||||
{
|
||||
#if defined(CLASSIC)
|
||||
return 0;
|
||||
#elif defined(TBC)
|
||||
return 1;
|
||||
#elif defined(WOTLK)
|
||||
return 2;
|
||||
#elif defined(CATA)
|
||||
return 3;
|
||||
#elif defined(MOP)
|
||||
return 4;
|
||||
#elif defined(WOD)
|
||||
return 5;
|
||||
#elif defined(LEGION)
|
||||
return 6;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// Print out the core banner
|
||||
void print_banner()
|
||||
{
|
||||
int iCoreNumber = return_iCoreNumber();
|
||||
switch (iCoreNumber)
|
||||
{
|
||||
case 0: // CLASSIC
|
||||
sLog.outString("<Ctrl-C> to stop.\n"
|
||||
" __ __ _ _ ___ ___ ___ ____ \n"
|
||||
" | \\/ |__ _| \\| |/ __|/ _ \\/ __| /_ /___ _ _ ___ \n"
|
||||
" | |\\/| / _` | .` | (_ | (_) \\__ \\ / // -_) '_/ _ \\ \n"
|
||||
" |_| |_\\__,_|_|\\_|\\___|\\___/|___/ /___\\___|_| \\___/\n"
|
||||
" Powered By MaNGOS Core\n"
|
||||
"__________________________________________________________\n"
|
||||
"\n"
|
||||
"Website/Forum/Wiki/Issue Tracker: https://www.getmangos.eu\n"
|
||||
"__________________________________________________________\n"
|
||||
"\n");
|
||||
break;
|
||||
case 1: // TBC
|
||||
sLog.outString("<Ctrl-C> to stop.\n"
|
||||
" __ __ _ _ ___ ___ ___ ___ \n"
|
||||
" | \\/ |__ _| \\| |/ __|/ _ \\/ __| / _ \\ ___ ___ \n"
|
||||
" | |\\/| / _` | .` | (_ | (_) \\__ \\ | (_) | \\/ -_) \n"
|
||||
" |_| |_\\__,_|_|\\_|\\___|\\___/|___/ \\___/|_||_\\___|\n"
|
||||
" Powered By MaNGOS Core\n"
|
||||
" __________________________________________________________\n"
|
||||
"\n"
|
||||
" Website/Forum/Wiki/Issue Tracker: https://www.getmangos.eu\n"
|
||||
" __________________________________________________________\n"
|
||||
"\n");
|
||||
break;
|
||||
case 2: // WOTLK
|
||||
sLog.outString("<Ctrl-C> to stop.\n"
|
||||
" __ __ _ _ ___ ___ ___ _____ \n"
|
||||
" | \\/ |__ _| \\| |/ __|/ _ \\/ __| |_ _|_ __ _____\n"
|
||||
" | |\\/| / _` | .` | (_ | (_) \\__ \\ | | \\ V V / _ \\\n"
|
||||
" |_| |_\\__,_|_|\\_|\\___|\\___/|___/ |_| \\_/\\_/\\___/ \n"
|
||||
" Powered By MaNGOS Core\n"
|
||||
" __________________________________________________________\n"
|
||||
"\n"
|
||||
" Website/Forum/Wiki/Issue Tracker: https://www.getmangos.eu\n"
|
||||
" __________________________________________________________\n"
|
||||
"\n");
|
||||
break;
|
||||
case 3: // CATA
|
||||
sLog.outString("<Ctrl-C> to stop.\n"
|
||||
" __ __ _ _ ___ ___ ___ _____ _ \n"
|
||||
" | \\/ |__ _| \\| |/ __|/ _ \\/ __| |_ _| |_ _ _ ___ ___ \n"
|
||||
" | |\\/| / _` | .` | (_ | (_) \\__ \\ | | | ' \\| '_/ -_) -_) \n"
|
||||
" |_| |_\\__,_|_|\\_|\\___|\\___/|___/ |_| |_||_|_| \\___\\___| \n"
|
||||
" Powered By MaNGOS Core\n"
|
||||
" __________________________________________________________\n"
|
||||
"\n"
|
||||
" Website/Forum/Wiki/Issue Tracker: https://www.getmangos.eu\n"
|
||||
" __________________________________________________________\n"
|
||||
"\n");
|
||||
break;
|
||||
case 4: // MOP
|
||||
sLog.outString("<Ctrl-C> to stop.\n"
|
||||
" __ __ _ _ ___ ___ ___ _____ \n"
|
||||
" | \\/ |__ _| \\| |/ __|/ _ \\/ __| | __|__ _ _ _ _ \n"
|
||||
" | |\\/| / _` | .` | (_ | (_) \\__ \\ | _/ _ \\ || | '_|\n"
|
||||
" |_| |_\\__,_|_|\\_|\\___|\\___/|___/ |_|\\___/\\_,_|_| \n"
|
||||
" Powered By MaNGOS Core\n"
|
||||
" __________________________________________________________\n"
|
||||
"\n"
|
||||
" Website/Forum/Wiki/Issue Tracker: https://www.getmangos.eu\n"
|
||||
" __________________________________________________________\n"
|
||||
"\n");
|
||||
break;
|
||||
default:
|
||||
sLog.outString("<Ctrl-C> to stop.\n"
|
||||
" __ __ _ _ ___ ___ ___ \n"
|
||||
" | \\/ |__ _| \\| |/ __|/ _ \\/ __| We have a problem ! \n"
|
||||
" | |\\/| / _` | .` | (_ | (_) \\__ \\ Your version of MaNGOS \n"
|
||||
" |_| |_\\__,_|_|\\_|\\___|\\___/|___/ could not be detected \n"
|
||||
" __________________________________________________________\n"
|
||||
"\n"
|
||||
" Website/Forum/Wiki/Issue Tracker: https://www.getmangos.eu\n"
|
||||
" __________________________________________________________\n"
|
||||
"\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -761,4 +761,16 @@ void hexEncodeByteArray(uint8* bytes, uint32 arrayLen, std::string& result);
|
|||
|
||||
std::string ByteArrayToHexStr(uint8 const* bytes, uint32 length, bool reverse = false);
|
||||
void HexStrToByteArray(std::string const& str, uint8* out, bool reverse = false);
|
||||
|
||||
/**
|
||||
* @brief Define iCoreNumber to be set for the currently defined core
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int return_iCoreNumber();
|
||||
|
||||
/**
|
||||
* @brief Display the startup banner
|
||||
*/
|
||||
void print_banner();
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue