Server Banner and Status redone

This commit is contained in:
Antz 2017-02-13 22:12:00 +00:00 committed by Antz
parent 63e73a18fa
commit a7f938e7e6
6 changed files with 214 additions and 22 deletions

View file

@ -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;
}
}

View file

@ -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