You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d31372e
Browse filesBrowse the repository at this point in the historyBrowse files
publicstaticreadonlyConVarsv_shutdown_timeout_minutes=new("sv_shutdown_timeout_minutes","360",FCvar.Replicated,"If sv_shutdown is pending, wait at most N minutes for server to drain before forcing shutdown.");
522
+
publicstaticreadonlyConVarsv_memlimit=new("sv_memlimit","0",FCvar.Cheat,"If set, whenever the server is empty, if the total memory used by the server is greater than this # of megabytes, the server will exit.");
523
+
524
+
publicboolExitWhenEmpty;
506
525
publicdoubleTimeForceShutdown;
507
526
527
+
[ConCommand(helpText:"Sets the server to shutdown next time it's empty")]
528
+
voidsv_shutdown(){
529
+
ExitWhenEmpty=true;
530
+
Warning("sv_shutdown command received.\n");
531
+
532
+
doubletimeCurrent=Platform.Time;
533
+
if(sv.IsHibernating()){
534
+
Warning("Server is hibernating. Shutting down right now\n");
Copy file name to clipboardExpand all lines: Source.Engine/Server/GameServer.cs
+65-3Lines changed: 65 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@
5
5
usingSource.Common.Filesystem;
6
6
usingSource.Common.Formats.BSP;
7
7
usingSource.Common.Networking;
8
+
usingSource.Common.Server;
8
9
usingSource.Common.Utilities;
9
10
10
11
usingSystem.Runtime.InteropServices;
@@ -21,7 +22,7 @@ public class GameServer : BaseServer
21
22
{
22
23
#if GMOD_DLL
23
24
readonlyConVarsv_startup_time=new("sv_startup_time","0",0,"Sets the starting CurTime of the server (in seconds). This is used for finding issues on a server that has been running for a long time. You don't need to change this.");
24
-
readonlyConVarsv_hibernate_think=new("sv_hibernate_think","0",0,"Forces the server to think even when hibernating");
25
+
internalreadonlyConVarsv_hibernate_think=new("sv_hibernate_think","0",0,"Forces the server to think even when hibernating");
25
26
readonlyConVarsv_hibernate_drop_bots=new("sv_hibernate_drop_bots","1",0,"Kicks bots when the server enters hibernation");
26
27
#endif
27
28
protectedreadonlyEDED=Singleton<ED>();
@@ -385,7 +386,23 @@ public void DumpPrecacheStats(INetworkStringTable? table) {
0 commit comments