Build fix for WheatyExceptionReport, c++ exceptions must not be thrown in SEH handlers

This commit is contained in:
Shauren committed 2015-08-16 18:08:03 +02:00
1 parent 94f69fb1bc
commit 222eaccc51
9 files changed
+38 -43

No files matched your search

+1 -1
View File
@@ -103,7 +103,7 @@ int main(int argc, char** argv)
sLog->RegisterAppender<AppenderDB>(); sLog->RegisterAppender<AppenderDB>();
sLog->Initialize(nullptr); sLog->Initialize(nullptr);
TC_LOG_INFO("server.authserver", "%s (authserver)", Revision::GetFullVersion().c_str()); TC_LOG_INFO("server.authserver", "%s (authserver)", Revision::GetFullVersion());
TC_LOG_INFO("server.authserver", "<Ctrl-C> to stop.\n"); TC_LOG_INFO("server.authserver", "<Ctrl-C> to stop.\n");
TC_LOG_INFO("server.authserver", "Using configuration file %s.", configFile.c_str()); TC_LOG_INFO("server.authserver", "Using configuration file %s.", configFile.c_str());
TC_LOG_INFO("server.authserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); TC_LOG_INFO("server.authserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
@@ -827,7 +827,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
// send server info // send server info
if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1)
chH.PSendSysMessage(Revision::GetFullVersion().c_str()); chH.PSendSysMessage(Revision::GetFullVersion());
TC_LOG_DEBUG("network", "WORLD: Sent server info"); TC_LOG_DEBUG("network", "WORLD: Sent server info");
} }
+2 -2
View File
@@ -1534,7 +1534,7 @@ void World::SetInitialWorldSettings()
TC_LOG_INFO("server.loading", "Loading Gameobject Data..."); TC_LOG_INFO("server.loading", "Loading Gameobject Data...");
sObjectMgr->LoadGameobjects(); sObjectMgr->LoadGameobjects();
TC_LOG_INFO("server.loading", "Loading GameObject Addon Data..."); TC_LOG_INFO("server.loading", "Loading GameObject Addon Data...");
sObjectMgr->LoadGameObjectAddons(); // must be after LoadGameObjectTemplate() and LoadGameobjects() sObjectMgr->LoadGameObjectAddons(); // must be after LoadGameObjectTemplate() and LoadGameobjects()
@@ -1789,7 +1789,7 @@ void World::SetInitialWorldSettings()
m_startTime = m_gameTime; m_startTime = m_gameTime;
LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES(%u, %u, 0, '%s')", LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES(%u, %u, 0, '%s')",
realmID, uint32(m_startTime), Revision::GetFullVersion().c_str()); // One-time query realmID, uint32(m_startTime), Revision::GetFullVersion()); // One-time query
m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS); m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS);
m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILLISECONDS); m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILLISECONDS);
+1 -1
View File
@@ -115,7 +115,7 @@ public:
std::string uptime = secsToTimeString(sWorld->GetUptime()); std::string uptime = secsToTimeString(sWorld->GetUptime());
uint32 updateTime = sWorld->GetUpdateTime(); uint32 updateTime = sWorld->GetUpdateTime();
handler->SendSysMessage(Revision::GetFullVersion().c_str()); handler->SendSysMessage(Revision::GetFullVersion());
handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum); handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum);
handler->PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum); handler->PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
handler->PSendSysMessage(LANG_UPTIME, uptime.c_str()); handler->PSendSysMessage(LANG_UPTIME, uptime.c_str());
@@ -130,10 +130,10 @@ PEXCEPTION_POINTERS pExceptionInfo)
SYSTEMTIME systime; SYSTEMTIME systime;
GetLocalTime(&systime); GetLocalTime(&systime);
sprintf(m_szDumpFileName, "%s\\%s_%s_[%u-%u_%u-%u-%u].dmp", sprintf(m_szDumpFileName, "%s\\%s_%s_[%u-%u_%u-%u-%u].dmp",
crash_folder_path, Revision::GetHash().c_str(), pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond); crash_folder_path, Revision::GetHash(), pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond);
sprintf(m_szLogFileName, "%s\\%s_%s_[%u-%u_%u-%u-%u].txt", sprintf(m_szLogFileName, "%s\\%s_%s_[%u-%u_%u-%u-%u].txt",
crash_folder_path, Revision::GetHash().c_str(), pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond); crash_folder_path, Revision::GetHash(), pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond);
m_hDumpFile = CreateFile(m_szDumpFileName, m_hDumpFile = CreateFile(m_szDumpFileName,
GENERIC_WRITE, GENERIC_WRITE,
@@ -439,7 +439,7 @@ PEXCEPTION_POINTERS pExceptionInfo)
GetLocalTime(&systime); GetLocalTime(&systime);
// Start out with a banner // Start out with a banner
_tprintf(_T("Revision: %s\r\n"), Revision::GetFullVersion().c_str()); _tprintf(_T("Revision: %s\r\n"), Revision::GetFullVersion());
_tprintf(_T("Date %u:%u:%u. Time %u:%u \r\n"), systime.wDay, systime.wMonth, systime.wYear, systime.wHour, systime.wMinute); _tprintf(_T("Date %u:%u:%u. Time %u:%u \r\n"), systime.wDay, systime.wMonth, systime.wYear, systime.wHour, systime.wMinute);
PEXCEPTION_RECORD pExceptionRecord = pExceptionInfo->ExceptionRecord; PEXCEPTION_RECORD pExceptionRecord = pExceptionInfo->ExceptionRecord;
-1
View File
@@ -107,7 +107,6 @@ class Appender
uint8 id; uint8 id;
std::string name; std::string name;
AppenderType type;
LogLevel level; LogLevel level;
AppenderFlags flags; AppenderFlags flags;
}; };
+16 -19
View File
@@ -2,70 +2,67 @@
#include "CompilerDefs.h" #include "CompilerDefs.h"
#include "revision_data.h" #include "revision_data.h"
std::string Revision::GetPackageName() char const* Revision::GetHash()
{
return "TrinityCore";
}
std::string Revision::GetHash()
{ {
return _HASH; return _HASH;
} }
std::string Revision::GetDate() char const* Revision::GetDate()
{ {
return _DATE; return _DATE;
} }
std::string Revision::GetBranch() char const* Revision::GetBranch()
{ {
return _BRANCH; return _BRANCH;
} }
std::string Revision::GetSourceDirectory() char const* Revision::GetSourceDirectory()
{ {
return _SOURCE_DIRECTORY; return _SOURCE_DIRECTORY;
} }
std::string Revision::GetMySQLExecutable() char const* Revision::GetMySQLExecutable()
{ {
return _MYSQL_EXECUTABLE; return _MYSQL_EXECUTABLE;
} }
std::string Revision::GetFullDatabase() char const* Revision::GetFullDatabase()
{ {
return _FULL_DATABASE; return _FULL_DATABASE;
} }
std::string Revision::GetFullVersion() #define _PACKAGENAME "TrinityCore"
char const* Revision::GetFullVersion()
{ {
#if PLATFORM == PLATFORM_WINDOWS #if PLATFORM == PLATFORM_WINDOWS
# ifdef _WIN64 # ifdef _WIN64
return GetPackageName() + " rev. " + VER_PRODUCTVERSION_STR + " (Win64, " + _BUILD_DIRECTIVE + ")"; return _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Win64, " _BUILD_DIRECTIVE ")";
# else # else
return GetPackageName() + " rev. " + VER_PRODUCTVERSION_STR + " (Win32, " + _BUILD_DIRECTIVE + ")"; return _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Win32, " _BUILD_DIRECTIVE ")";
# endif # endif
#else #else
return GetPackageName() + " rev. " + VER_PRODUCTVERSION_STR + " (Unix, " + _BUILD_DIRECTIVE + ")"; return _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Unix, " _BUILD_DIRECTIVE ")";
#endif #endif
} }
std::string GetCompanyNameStr() char const* GetCompanyNameStr()
{ {
return VER_COMPANYNAME_STR; return VER_COMPANYNAME_STR;
} }
std::string GetLegalCopyrightStr() char const* GetLegalCopyrightStr()
{ {
return VER_LEGALCOPYRIGHT_STR; return VER_LEGALCOPYRIGHT_STR;
} }
std::string GetFileVersionStr() char const* GetFileVersionStr()
{ {
return VER_FILEVERSION_STR; return VER_FILEVERSION_STR;
} }
std::string GetProductVersionStr() char const* GetProductVersionStr()
{ {
return VER_PRODUCTVERSION_STR; return VER_PRODUCTVERSION_STR;
} }
+11 -12
View File
@@ -22,18 +22,17 @@
namespace Revision namespace Revision
{ {
std::string GetPackageName(); char const* GetHash();
std::string GetHash(); char const* GetDate();
std::string GetDate(); char const* GetBranch();
std::string GetBranch(); char const* GetSourceDirectory();
std::string GetSourceDirectory(); char const* GetMySQLExecutable();
std::string GetMySQLExecutable(); char const* GetFullDatabase();
std::string GetFullDatabase(); char const* GetFullVersion();
std::string GetFullVersion(); char const* GetCompanyNameStr();
std::string GetCompanyNameStr(); char const* GetLegalCopyrightStr();
std::string GetLegalCopyrightStr(); char const* GetFileVersionStr();
std::string GetFileVersionStr(); char const* GetProductVersionStr();
std::string GetProductVersionStr();
} }
#endif #endif
+3 -3
View File
@@ -125,7 +125,7 @@ extern int main(int argc, char** argv)
// If logs are supposed to be handled async then we need to pass the io_service into the Log singleton // If logs are supposed to be handled async then we need to pass the io_service into the Log singleton
sLog->Initialize(sConfigMgr->GetBoolDefault("Log.Async.Enable", false) ? &_ioService : nullptr); sLog->Initialize(sConfigMgr->GetBoolDefault("Log.Async.Enable", false) ? &_ioService : nullptr);
TC_LOG_INFO("server.worldserver", "%s (worldserver-daemon)", Revision::GetFullVersion().c_str()); TC_LOG_INFO("server.worldserver", "%s (worldserver-daemon)", Revision::GetFullVersion());
TC_LOG_INFO("server.worldserver", "<Ctrl-C> to stop.\n"); TC_LOG_INFO("server.worldserver", "<Ctrl-C> to stop.\n");
TC_LOG_INFO("server.worldserver", " ______ __"); TC_LOG_INFO("server.worldserver", " ______ __");
TC_LOG_INFO("server.worldserver", "/\\__ _\\ __ __/\\ \\__"); TC_LOG_INFO("server.worldserver", "/\\__ _\\ __ __/\\ \\__");
@@ -234,7 +234,7 @@ extern int main(int argc, char** argv)
TC_LOG_INFO("server.worldserver", "Starting up anti-freeze thread (%u seconds max stuck time)...", coreStuckTime); TC_LOG_INFO("server.worldserver", "Starting up anti-freeze thread (%u seconds max stuck time)...", coreStuckTime);
} }
TC_LOG_INFO("server.worldserver", "%s (worldserver-daemon) ready...", Revision::GetFullVersion().c_str()); TC_LOG_INFO("server.worldserver", "%s (worldserver-daemon) ready...", Revision::GetFullVersion());
sScriptMgr->OnStartup(); sScriptMgr->OnStartup();
@@ -470,7 +470,7 @@ bool StartDB()
ClearOnlineAccounts(); ClearOnlineAccounts();
///- Insert version info into DB ///- Insert version info into DB
WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", Revision::GetFullVersion().c_str(), Revision::GetHash().c_str()); // One-time query WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", Revision::GetFullVersion(), Revision::GetHash()); // One-time query
sWorld->LoadDBVersion(); sWorld->LoadDBVersion();