diff --git a/src/game/Server/SharedDefines.h b/src/game/Server/SharedDefines.h index 2f64d3a6f..db633cc81 100644 --- a/src/game/Server/SharedDefines.h +++ b/src/game/Server/SharedDefines.h @@ -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 diff --git a/src/game/WorldHandlers/World.cpp b/src/game/WorldHandlers/World.cpp index 7ec5b48b0..24408183c 100644 --- a/src/game/WorldHandlers/World.cpp +++ b/src/game/WorldHandlers/World.cpp @@ -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 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::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 diff --git a/src/game/WorldHandlers/World.h b/src/game/WorldHandlers/World.h index a0ac7de9b..7a6984378 100644 --- a/src/game/WorldHandlers/World.h +++ b/src/game/WorldHandlers/World.h @@ -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; } diff --git a/src/mangosd/mangosd.cpp b/src/mangosd/mangosd.cpp index c7857f178..da0646f14 100644 --- a/src/mangosd/mangosd.cpp +++ b/src/mangosd/mangosd.cpp @@ -272,24 +272,6 @@ static void usage(const char* prog) , prog); } -/// Print out the core banner -static void print_banner() -{ - sLog.outString(" 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) { diff --git a/src/shared/Utilities/Util.cpp b/src/shared/Utilities/Util.cpp index 6b8099115..1a47a924b 100644 --- a/src/shared/Utilities/Util.cpp +++ b/src/shared/Utilities/Util.cpp @@ -29,6 +29,7 @@ #include #include #include +#include "Log/Log.h" typedef ACE_TSS 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(" 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(" 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(" 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(" 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(" 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(" 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; + } +} \ No newline at end of file diff --git a/src/shared/Utilities/Util.h b/src/shared/Utilities/Util.h index 91d0a2d55..c33d59cab 100644 --- a/src/shared/Utilities/Util.h +++ b/src/shared/Utilities/Util.h @@ -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