[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:
VladimirMangos 2010-05-16 02:01:01 +04:00
parent f492ee6794
commit aaa33d5385
10 changed files with 67 additions and 11 deletions

View file

@ -87,6 +87,7 @@ extern int main(int argc, char **argv)
{
sLog.outError("Runtime-Error: -c option requires an input argument");
usage(argv[0]);
Log::WaitBeforeContinueIfNeed();
return 1;
}
else
@ -109,6 +110,7 @@ extern int main(int argc, char **argv)
{
sLog.outError("Runtime-Error: -s option requires an input argument");
usage(argv[0]);
Log::WaitBeforeContinueIfNeed();
return 1;
}
if( strcmp(argv[c],"install") == 0)
@ -127,6 +129,7 @@ extern int main(int argc, char **argv)
{
sLog.outError("Runtime-Error: unsupported option %s",argv[c]);
usage(argv[0]);
Log::WaitBeforeContinueIfNeed();
return 1;
}
}
@ -142,6 +145,7 @@ extern int main(int argc, char **argv)
if (!sConfig.SetSource(cfg_file))
{
sLog.outError("Could not find configuration file %s.", cfg_file);
Log::WaitBeforeContinueIfNeed();
return 1;
}
sLog.Initialize();
@ -159,9 +163,7 @@ extern int main(int argc, char **argv)
sLog.outError(" Please check for updates, as your current default values may cause");
sLog.outError(" strange behavior.");
sLog.outError("*****************************************************************************");
clock_t pause = 3000 + clock();
while (pause > clock()) {}
Log::WaitBeforeContinueIfNeed();
}
DETAIL_LOG("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
@ -179,6 +181,7 @@ extern int main(int argc, char **argv)
if( !pid )
{
sLog.outError( "Cannot create PID file %s.\n", pidfile.c_str() );
Log::WaitBeforeContinueIfNeed();
return 1;
}
@ -187,13 +190,17 @@ extern int main(int argc, char **argv)
///- Initialize the database connection
if(!StartDB())
{
Log::WaitBeforeContinueIfNeed();
return 1;
}
///- Get the list of realms for the server
sRealmList.Initialize(sConfig.GetIntDefault("RealmsStateUpdateDelay", 20));
if (sRealmList.size() == 0)
{
sLog.outError("No valid realms specified.");
Log::WaitBeforeContinueIfNeed();
return 1;
}
@ -206,6 +213,7 @@ extern int main(int argc, char **argv)
if ( authListenSocket.Bind(bind_ip.c_str(),rmport))
{
sLog.outError( "MaNGOS realmd can not bind to %s:%d",bind_ip.c_str(), rmport );
Log::WaitBeforeContinueIfNeed();
return 1;
}