mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 13:37:02 +00:00
[9904] Add new config option for wait mode at startup error.
Note: it not applied to crashes and shutdowns after mangosd/relamd startup completed. You can continue without delay (as now) and fast exist, or wait <Enter>, or some secs for continue. Last can be helpful for see for example not applied sql update revision data and etc.
This commit is contained in:
parent
f492ee6794
commit
aaa33d5385
10 changed files with 67 additions and 11 deletions
|
|
@ -22,8 +22,13 @@
|
|||
#include "Config/ConfigEnv.h"
|
||||
#include "Util.h"
|
||||
#include "ByteBuffer.h"
|
||||
#include "ProgressBar.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include "ace/OS_NS_unistd.h"
|
||||
|
||||
INSTANTIATE_SINGLETON_1( Log );
|
||||
|
||||
|
|
@ -815,6 +820,29 @@ void Log::outRALog( const char * str, ... )
|
|||
fflush(stdout);
|
||||
}
|
||||
|
||||
void Log::WaitBeforeContinueIfNeed()
|
||||
{
|
||||
int mode = sConfig.GetIntDefault("WaitAtStartupError",0);
|
||||
|
||||
if (mode < 0)
|
||||
{
|
||||
printf("\nPress <Enter> for continue\n");
|
||||
|
||||
std::string line;
|
||||
std::getline (std::cin, line);
|
||||
}
|
||||
else if (mode > 0)
|
||||
{
|
||||
printf("\nWait %u secs for continue.\n",mode);
|
||||
barGoLink bar(mode);
|
||||
for(int i = 0; i < mode; ++i)
|
||||
{
|
||||
bar.step();
|
||||
ACE_OS::sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void outstring_log(const char * str, ...)
|
||||
{
|
||||
if (!str)
|
||||
|
|
|
|||
|
|
@ -140,6 +140,8 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ACE_Th
|
|||
bool HasLogLevelOrHigher(LogLevel loglvl) const { return m_logLevel >= loglvl || (m_logFileLevel >= loglvl && logfile); }
|
||||
bool IsOutCharDump() const { return m_charLog_Dump; }
|
||||
bool IsIncludeTime() const { return m_includeTime; }
|
||||
|
||||
static void WaitBeforeContinueIfNeed();
|
||||
private:
|
||||
FILE* openLogFile(char const* configFileName,char const* configTimeStampFlag, char const* mode);
|
||||
FILE* openGmlogPerAccount(uint32 account);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9903"
|
||||
#define REVISION_NR "9904"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue