Files
tbd-station-14/Content.Server/GameTicking/GameTicker.CVars.cs
Pieter-Jan Briers 2c721226d6 Revert "Revert "Load Maps on Round Start, not Round Restart v3 (#6989)" (#6990)"
This reverts commit 4aa65b6708.

Fixed the deadlock bug on postgres.
2022-03-04 23:53:44 +01:00

51 lines
2.0 KiB
C#

using System;
using Content.Shared.CCVar;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameTicking
{
public sealed partial class GameTicker
{
[ViewVariables]
public bool LobbyEnabled { get; private set; } = false;
[ViewVariables]
public bool DummyTicker { get; private set; } = false;
[ViewVariables]
public TimeSpan LobbyDuration { get; private set; } = TimeSpan.Zero;
[ViewVariables]
public bool DisallowLateJoin { get; private set; } = false;
[ViewVariables]
public bool StationOffset { get; private set; } = false;
[ViewVariables]
public bool StationRotation { get; private set; } = false;
[ViewVariables]
public float MaxStationOffset { get; private set; } = 0f;
#if EXCEPTION_TOLERANCE
[ViewVariables]
public int RoundStartFailShutdownCount { get; private set; } = 0;
#endif
private void InitializeCVars()
{
_configurationManager.OnValueChanged(CCVars.GameLobbyEnabled, value => LobbyEnabled = value, true);
_configurationManager.OnValueChanged(CCVars.GameDummyTicker, value => DummyTicker = value, true);
_configurationManager.OnValueChanged(CCVars.GameLobbyDuration, value => LobbyDuration = TimeSpan.FromSeconds(value), true);
_configurationManager.OnValueChanged(CCVars.GameDisallowLateJoins,
value => { DisallowLateJoin = value; UpdateLateJoinStatus(); UpdateJobsAvailable(); }, true);
_configurationManager.OnValueChanged(CCVars.StationOffset, value => StationOffset = value, true);
_configurationManager.OnValueChanged(CCVars.StationRotation, value => StationRotation = value, true);
_configurationManager.OnValueChanged(CCVars.MaxStationOffset, value => MaxStationOffset = value, true);
#if EXCEPTION_TOLERANCE
_configurationManager.OnValueChanged(CCVars.RoundStartFailShutdownCount, value => RoundStartFailShutdownCount = value, true);
#endif
}
}
}