Scripts/Commands: Change "server shutdown" behavior

This commit is contained in:
Aokromes
2016-08-04 20:54:34 +02:00
parent 5b96815fcb
commit d642bd34a3

View File

@@ -195,7 +195,7 @@ public:
return true;
}
static inline bool IsOnlyUser(WorldSession* mySession)
static bool IsOnlyUser(WorldSession* mySession)
{
// check if there is any session connected from a different address
std::string myAddr = mySession ? mySession->GetRemoteAddress() : "";
@@ -381,8 +381,9 @@ private:
if (!ParseExitCode(exitCodeStr, exitCode))
return false;
// Override parameter "delay" with the configuration value if there are still players connected and "force" parameter was not specified
if (delay < (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD) && !(shutdownMask & SHUTDOWN_MASK_FORCE))
return false;
delay = (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD);
sWorld->ShutdownServ(delay, shutdownMask, static_cast<uint8>(exitCode), std::string(reason));