Deprecate ReservedPlayers in Torch cfg
Add a scrollpanel to fix clipped controls
This commit is contained in:
@@ -167,6 +167,16 @@ namespace Torch.Server.Managers
|
||||
|
||||
public void SaveConfig()
|
||||
{
|
||||
var cf = Torch.Config as TorchConfig;
|
||||
if (cf?.ReservedPlayers?.Count > 0)
|
||||
{
|
||||
foreach (var res in cf.ReservedPlayers)
|
||||
{
|
||||
if (!DedicatedConfig.Reserved.Contains(res))
|
||||
DedicatedConfig.Reserved.Add(res);
|
||||
}
|
||||
}
|
||||
|
||||
DedicatedConfig.Save(Path.Combine(Torch.Config.InstancePath, CONFIG_NAME));
|
||||
Log.Info("Saved dedicated config.");
|
||||
|
||||
|
@@ -219,8 +219,7 @@ 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) ||
|
||||
MySandboxGame.ConfigDedicated.Reserved.Contains(info.SteamID)))
|
||||
else if (MySandboxGame.ConfigDedicated.Reserved.Contains(info.SteamID))
|
||||
internalAuth = JoinResult.OK;
|
||||
//Admins can bypass member limit
|
||||
else if (MySandboxGame.ConfigDedicated.Administrators.Contains(info.SteamID.ToString()) ||
|
||||
|
@@ -68,9 +68,14 @@ namespace Torch.Server
|
||||
|
||||
public string LastUsedTheme { get; set; } = "Torch Theme";
|
||||
|
||||
public bool EnableReservedSlots { get; set; } = false;
|
||||
//TODO: REMOVE ME BY JULY 2019
|
||||
[Obsolete("Use vanilla reserved slot config")]
|
||||
public HashSet<ulong> ReservedPlayers { get; set; } = new HashSet<ulong>();
|
||||
|
||||
//Prevent reserved players being written to disk, but allow it to bre read
|
||||
//remove this when ReservedPlayers is removed
|
||||
private bool ShouldSerializeReservedPlayers() => false;
|
||||
|
||||
[XmlIgnore]
|
||||
private string _path;
|
||||
|
||||
|
@@ -58,6 +58,7 @@
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@@ -139,6 +140,7 @@
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
<Button Grid.Row="1" Content="Save Config" Margin="3" Click="Save_OnClick" />
|
||||
</Grid>
|
||||
<views:PropertyGrid Grid.Column="1" Margin="3" DataContext="{Binding SessionSettings}" IgnoreDisplay ="True" />
|
||||
|
Reference in New Issue
Block a user