|
80 | 80 |
|
81 | 81 | extern CNetworkStringTableContainer *networkStringTableContainerServer; |
82 | 82 | extern CNetworkStringTableContainer *networkStringTableContainerClient; |
83 | | -//void OnHibernateWhenEmptyChanged( IConVar *var, const char *pOldValue, float flOldValue ); |
84 | | -//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 ); |
| 83 | +static void OnHibernateWhenEmptyChanged( IConVar *var, const char *pOldValue, float flOldValue ); |
| 84 | +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 ); |
85 | 85 | //ConVar sv_hibernate_ms( "sv_hibernate_ms", "20", 0, "# of milliseconds to sleep per frame while hibernating" ); |
86 | 86 | //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" ); |
87 | 87 | //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 |
1541 | 1541 | return m_pPureServerWhitelist; |
1542 | 1542 | } |
1543 | 1543 |
|
1544 | | -//void OnHibernateWhenEmptyChanged( IConVar *var, const char *pOldValue, float flOldValue ) |
1545 | | -//{ |
1546 | | -// // We only need to do something special if we were preventing hibernation |
1547 | | -// // with sv_hibernate_when_empty but we would otherwise have been hibernating. |
1548 | | -// // In that case, punt all connected clients. |
1549 | | -// sv.UpdateHibernationState( ); |
1550 | | -//} |
| 1544 | +static void OnHibernateWhenEmptyChanged( IConVar *var, const char *pOldValue, float flOldValue ) |
| 1545 | +{ |
| 1546 | + // We only need to do something special if we were preventing hibernation |
| 1547 | + // with sv_hibernate_when_empty but we would otherwise have been hibernating. |
| 1548 | + // In that case, punt all connected clients. |
| 1549 | + sv.UpdateHibernationState( ); |
| 1550 | +} |
1551 | 1551 |
|
1552 | 1552 | static bool s_bExitWhenEmpty = false; |
1553 | 1553 | static ConVar sv_memlimit( "sv_memlimit", "0", 0, |
@@ -1753,8 +1753,7 @@ void CGameServer::UpdateHibernationState() |
1753 | 1753 | s_bExitWhenEmpty = true; |
1754 | 1754 | } |
1755 | 1755 |
|
1756 | | - //SetHibernating( sv_hibernate_when_empty.GetBool() && hibernateFromGCServer && !bHaveAnyClients ); |
1757 | | - SetHibernating( hibernateFromGCServer && !bHaveAnyClients ); |
| 1756 | + SetHibernating( sv_hibernate_when_empty.GetBool() && hibernateFromGCServer && !bHaveAnyClients ); |
1758 | 1757 | } |
1759 | 1758 |
|
1760 | 1759 | void CGameServer::FinishRestore() |
|
0 commit comments