mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Scripts/Commands: Change "server shutdown" behavior
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user