Core/Console: start CliRunnable thread after all log messages have been printed. (#23321)

(cherry picked from commit d8ce37e0c9)
This commit is contained in:
Wyrserth
2019-05-26 23:01:50 +02:00
committed by Shauren
parent 09fe78dd59
commit 2344671af5

View File

@@ -317,17 +317,6 @@ extern int main(int argc, char** argv)
ClearOnlineAccounts();
});
// Launch CliRunnable thread
std::shared_ptr<std::thread> cliThread;
#ifdef _WIN32
if (sConfigMgr->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
#else
if (sConfigMgr->GetBoolDefault("Console.Enable", true))
#endif
{
cliThread.reset(new std::thread(CliThread), &ShutdownCLIThread);
}
// Set server online (allow connecting now)
LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_OFFLINE, realm.Id.Realm);
realm.PopulationLevel = 0.0f;
@@ -346,6 +335,17 @@ extern int main(int argc, char** argv)
TC_LOG_INFO("server.worldserver", "%s (worldserver-daemon) ready...", GitRevision::GetFullVersion());
// Launch CliRunnable thread
std::shared_ptr<std::thread> cliThread;
#ifdef _WIN32
if (sConfigMgr->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
#else
if (sConfigMgr->GetBoolDefault("Console.Enable", true))
#endif
{
cliThread.reset(new std::thread(CliThread), &ShutdownCLIThread);
}
WorldUpdateLoop();
// Shutdown starts here