Add CVar for random grid offset, disable it by default.

This commit is contained in:
Vera Aguilera Puerto
2021-08-04 09:25:30 +02:00
parent 28a7d5041a
commit b7d049a52c
5 changed files with 28 additions and 12 deletions

View File

@@ -21,14 +21,22 @@ namespace Content.Server.GameTicking
[ViewVariables]
public bool DisallowLateJoin { get; private set; } = false;
[ViewVariables]
public bool StationOffset { get; private set; } = false;
[ViewVariables]
public float MaxStationOffset { get; private set; } = 0f;
private void InitializeCVars()
{
_configurationManager.OnValueChanged(CCVars.GameLobbyEnabled, value => LobbyEnabled = value, true);
_configurationManager.OnValueChanged(CCVars.GameDummyTicker, value => DummyTicker = value, true);
_configurationManager.OnValueChanged(CCVars.GameMap, value => ChosenMap = value, true);
_configurationManager.OnValueChanged(CCVars.GameLobbyDuration, value => LobbyDuration = TimeSpan.FromSeconds(value), true);
_configurationManager.OnValueChanged(CCVars.GameDisallowLateJoins, invokeImmediately:true,
onValueChanged:value => { DisallowLateJoin = value; UpdateLateJoinStatus(); UpdateJobsAvailable(); });
_configurationManager.OnValueChanged(CCVars.GameDisallowLateJoins,
value => { DisallowLateJoin = value; UpdateLateJoinStatus(); UpdateJobsAvailable(); }, true);
_configurationManager.OnValueChanged(CCVars.StationOffset, value => StationOffset = value, true);
_configurationManager.OnValueChanged(CCVars.MaxStationOffset, value => MaxStationOffset = value, true);
}
}
}