Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Game.UI/GameUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public void OnDisconnectFromServer(SteamLoginFailure steamLoginFailure) {
public void OnGameUIActivated() {
ActivatedUI = true;
staticPanel.SetVisible(true);

if (engine.GetMaxClients() <= 1)
engine.ClientCmd_Unrestricted("setpause");

staticPanel.OnGameUIActivated();
}

Expand Down
1 change: 1 addition & 0 deletions Source.Engine/SV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public partial class SV(IServiceProvider services, Cbuf Cbuf, ED ED, Host Host,
public static readonly ConVar sv_pure_trace = new("sv_pure_trace", "0", 0, "If set to 1, the server will print a message whenever a client is verifying a CRC for a file.");
public static readonly ConVar sv_pure_consensus = new("sv_pure_consensus", "5", 0, "Minimum number of file hashes to agree to form a consensus.");
public static readonly ConVar sv_pure_retiretime = new("sv_pure_retiretime", "900", 0, "Seconds of server idle time to flush the sv_pure file hash cache.");
public static readonly ConVar sv_pausable = new("sv_pausable", "0", FCvar.Notify, "Is the server pausable.");
public static readonly ConVar sv_lan = new("sv_lan", "0", 0, "Server is a lan server ( no heartbeat, no authentication, no non-class C addresses )");
public static readonly ConVar sv_client_predict = new("sv_client_predict", "-1", FCvar.Replicated, "This can be used to force the value of cl_predict for connected clients (only while they are connected).\n-1 = let clients set cl_predict to anything\n0 = force cl_predict to 0\n1 = force cl_predict to 1");
public static readonly ConVar sv_client_min_interp_ratio = new("sv_client_min_interp_ratio", "1", FCvar.Replicated, "This can be used to limit the value of cl_interp_ratio for connected clients (only while they are connected).\n-1 = let clients set cl_interp_ratio to anything\nany other value = set minimum value for cl_interp_ratio");
Expand Down
4 changes: 3 additions & 1 deletion Source.Engine/Server/BaseServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ public virtual void SetPaused(bool paused) {
State = ServerState.Paused;
else
State = ServerState.Active;
// TODO: SEND THE NET MESSAGE!!!!!!!!!!!!!!!!!

SVC_SetPause setpause = new() { Paused = paused };
BroadcastMessage(setpause);
}
public virtual void SetPassword(ReadOnlySpan<char> password) {
if (!password.IsEmpty)
Expand Down
7 changes: 7 additions & 0 deletions Source.Engine/Server/GameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public override void Init(bool dedicated) {

public bool IsInPureServerMode() => PureServerWhitelist != null;

public override bool IsPausable() {
if (IsMultiplayer())
return SV.sv_pausable.GetBool();
else
return true;
}

public override void Shutdown() {
LevelMainMenuBackground = false;
base.Shutdown();
Expand Down
Loading