Add Reserved slot and "Auto Detect Dependencies" to config ui plus Torch reserve management oversees all (#269)

* Add server description to config uI and adjusted the mod blocks to fit

* Added checkbox for "Auto detect dependencies" and Reserved players slot.

* Torch reserved slot management is now main and will scan sededi also to match steamid making new config ui addition usable
This commit is contained in:
N1Ran
2019-01-10 09:28:35 -05:00
committed by Brant Martin
parent 90479dfea2
commit 3d8bf78213
3 changed files with 21 additions and 2 deletions

View File

@@ -219,7 +219,8 @@ namespace Torch.Server.Managers
_log.Warn($"Rejecting user {info.SteamID} because they are not whitelisted in Torch.cfg.");
internalAuth = JoinResult.NotInGroup;
}
else if (config.EnableReservedSlots && config.ReservedPlayers.Contains(info.SteamID))
else if (config.EnableReservedSlots && (config.ReservedPlayers.Contains(info.SteamID) ||
MySandboxGame.ConfigDedicated.Reserved.Contains(info.SteamID)))
internalAuth = JoinResult.OK;
//Admins can bypass member limit
else if (MySandboxGame.ConfigDedicated.Administrators.Contains(info.SteamID.ToString()) ||

View File

@@ -76,7 +76,9 @@ namespace Torch.Server.ViewModels
public List<string> Administrators { get => _config.Administrators; set => SetValue(x => _config.Administrators = x, value); }
public List<ulong> Banned { get => _config.Banned; set => SetValue(x => _config.Banned = x, value); }
public List<ulong> Reserved { get => _config.Reserved; set => SetValue(x => _config.Reserved = x, value); }
private List<ulong> _mods = new List<ulong>();
public List<ulong> Mods { get => _mods; set => SetValue(x => _mods = x, value); }
@@ -94,6 +96,8 @@ namespace Torch.Server.ViewModels
public bool PauseGameWhenEmpty { get => _config.PauseGameWhenEmpty; set => SetValue(x => _config.PauseGameWhenEmpty = x, value); }
public bool AutodetectDependencies { get => _config.AutodetectDependencies; set => SetValue(x => _config.AutodetectDependencies = x, value); }
public string PremadeCheckpointPath { get => _config.PremadeCheckpointPath; set => SetValue(x => _config.PremadeCheckpointPath = x, value); }
public string LoadWorld { get => _config.LoadWorld; set => SetValue(x => _config.LoadWorld = x, value); }

View File

@@ -90,6 +90,7 @@
<Label Content="Server Password"/>
<TextBox Text="{Binding Password}" Width="160"/>
<CheckBox IsChecked="{Binding PauseGameWhenEmpty}" Content="Pause When Empty" Margin="3" />
<CheckBox IsChecked="{Binding AutodetectDependencies}" Content="Auto Detect Dependencies" Margin="3" />
</StackPanel>
<StackPanel Grid.Column="1" Margin="3">
<Label Content="Mods" />
@@ -109,6 +110,19 @@
<TextBox Text="{Binding Administrators, Converter={StaticResource ListConverterString}}"
Margin="3"
Height="100" AcceptsReturn="true" VerticalScrollBarVisibility="Auto" />
<Label Content="Reserved Players" />
<TextBox Margin="3" Height="100" AcceptsReturn="true" VerticalScrollBarVisibility="Auto"
Style="{StaticResource ValidatedTextBox}">
<TextBox.Text>
<Binding Path="Reserved" UpdateSourceTrigger="PropertyChanged"
ValidatesOnDataErrors="True" NotifyOnValidationError="True"
Converter="{StaticResource ListConverterUInt64}">
<Binding.ValidationRules>
<validationRules:ListConverterValidationRule Type="system:UInt64" />
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
<Label Content="Banned Players" />
<TextBox Margin="3" Height="100" AcceptsReturn="true" VerticalScrollBarVisibility="Auto"
Style="{StaticResource ValidatedTextBox}">