Merge pull request #211 from tyabus/hibernation
engine: restore sv_hibernate_when_empty cvar
This commit is contained in:
commit
e998499068
@ -80,8 +80,8 @@
|
|||||||
|
|
||||||
extern CNetworkStringTableContainer *networkStringTableContainerServer;
|
extern CNetworkStringTableContainer *networkStringTableContainerServer;
|
||||||
extern CNetworkStringTableContainer *networkStringTableContainerClient;
|
extern CNetworkStringTableContainer *networkStringTableContainerClient;
|
||||||
//void OnHibernateWhenEmptyChanged( IConVar *var, const char *pOldValue, float flOldValue );
|
static void OnHibernateWhenEmptyChanged( IConVar *var, const char *pOldValue, float flOldValue );
|
||||||
//ConVar sv_hibernate_when_empty( "sv_hibernate_when_empty", "1", 0, "Puts the server into extremely low CPU usage mode when no clients connected", OnHibernateWhenEmptyChanged );
|
ConVar sv_hibernate_when_empty( "sv_hibernate_when_empty", "1", 0, "Puts the server into extremely low CPU usage mode when no clients connected", OnHibernateWhenEmptyChanged );
|
||||||
//ConVar sv_hibernate_ms( "sv_hibernate_ms", "20", 0, "# of milliseconds to sleep per frame while hibernating" );
|
//ConVar sv_hibernate_ms( "sv_hibernate_ms", "20", 0, "# of milliseconds to sleep per frame while hibernating" );
|
||||||
//ConVar sv_hibernate_ms_vgui( "sv_hibernate_ms_vgui", "20", 0, "# of milliseconds to sleep per frame while hibernating but running the vgui dedicated server frontend" );
|
//ConVar sv_hibernate_ms_vgui( "sv_hibernate_ms_vgui", "20", 0, "# of milliseconds to sleep per frame while hibernating but running the vgui dedicated server frontend" );
|
||||||
//static ConVar sv_hibernate_postgame_delay( "sv_hibernate_postgame_delay", "5", 0, "# of seconds to wait after final client leaves before hibernating.");
|
//static ConVar sv_hibernate_postgame_delay( "sv_hibernate_postgame_delay", "5", 0, "# of seconds to wait after final client leaves before hibernating.");
|
||||||
@ -1541,13 +1541,13 @@ CPureServerWhitelist * CGameServer::GetPureServerWhitelist() const
|
|||||||
return m_pPureServerWhitelist;
|
return m_pPureServerWhitelist;
|
||||||
}
|
}
|
||||||
|
|
||||||
//void OnHibernateWhenEmptyChanged( IConVar *var, const char *pOldValue, float flOldValue )
|
static void OnHibernateWhenEmptyChanged( IConVar *var, const char *pOldValue, float flOldValue )
|
||||||
//{
|
{
|
||||||
// // We only need to do something special if we were preventing hibernation
|
// We only need to do something special if we were preventing hibernation
|
||||||
// // with sv_hibernate_when_empty but we would otherwise have been hibernating.
|
// with sv_hibernate_when_empty but we would otherwise have been hibernating.
|
||||||
// // In that case, punt all connected clients.
|
// In that case, punt all connected clients.
|
||||||
// sv.UpdateHibernationState( );
|
sv.UpdateHibernationState( );
|
||||||
//}
|
}
|
||||||
|
|
||||||
static bool s_bExitWhenEmpty = false;
|
static bool s_bExitWhenEmpty = false;
|
||||||
static ConVar sv_memlimit( "sv_memlimit", "0", 0,
|
static ConVar sv_memlimit( "sv_memlimit", "0", 0,
|
||||||
@ -1753,8 +1753,7 @@ void CGameServer::UpdateHibernationState()
|
|||||||
s_bExitWhenEmpty = true;
|
s_bExitWhenEmpty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//SetHibernating( sv_hibernate_when_empty.GetBool() && hibernateFromGCServer && !bHaveAnyClients );
|
SetHibernating( sv_hibernate_when_empty.GetBool() && hibernateFromGCServer && !bHaveAnyClients );
|
||||||
SetHibernating( hibernateFromGCServer && !bHaveAnyClients );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameServer::FinishRestore()
|
void CGameServer::FinishRestore()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user