Add sv_shutdown_when_empty

This commit is contained in:
def 2014-08-15 14:32:21 +02:00
parent b797978f5f
commit 7654438033
2 changed files with 7 additions and 1 deletions

View file

@ -1691,7 +1691,12 @@ int CServer::Run()
// wait for incoming data
if (NonActive)
{
if(g_Config.m_SvShutdownWhenEmpty)
m_RunServer = false;
else
net_socket_read_wait(m_NetServer.Socket(), 1000);
}
else
net_socket_read_wait(m_NetServer.Socket(), 5);
}

View file

@ -297,6 +297,7 @@ MACRO_CONFIG_INT(SvSpamMuteDuration, sv_spam_mute_duration, 60, 0, 3600 , CFGFLA
MACRO_CONFIG_INT(SvEvents, sv_events, 1, 0, 1, CFGFLAG_SERVER, "Enable triggering of server events, like the happy eyeemotes on some holidays.")
MACRO_CONFIG_INT(SvRankCheats, sv_rank_cheats, 0, 0, 1, CFGFLAG_SERVER, "Enable ranks after cheats have been used (file based server only)")
MACRO_CONFIG_INT(SvSpoofProtection, sv_spoof_protection, 0, 1, 1, CFGFLAG_SERVER, "Enable spoof protection")
MACRO_CONFIG_INT(SvShutdownWhenEmpty, sv_shutdown_when_empty, 0, 0, 1, CFGFLAG_SERVER, "Shutdown server as soon as noone is on it anymore")
// netlimit
MACRO_CONFIG_INT(SvNetlimit, sv_netlimit, 0, 0, 10000, CFGFLAG_SERVER, "Netlimit: Maximum amount of traffic a client is allowed to use (in kb/s)")