Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add advanced setting #139

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 6 additions & 2 deletions FASTER Maintenance/Models/17Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ namespace FASTER_Maintenance.Models._17Models
[XmlRoot(ElementName = "ArrayOfString")]
public class ArrayOfString
{
[XmlElement(ElementName = "string")] public string String { get; set; }
[XmlElement(ElementName = "string")]
public string String { get; set; }

[XmlAttribute(AttributeName = "xsi", Namespace = "http://www.w3.org/2000/xmlns/")]
public string Xsi { get; set; }
Expand Down Expand Up @@ -139,6 +140,9 @@ public class ServerCfg
[XmlElement(ElementName = "AutoSelectMission")]
public string AutoSelectMission { get; set; }

[XmlElement(ElementName = "queueSizeLogG")]
public string RandomMissionOrder { get; set; }

[XmlElement(ElementName = "RandomMissionOrder")]
public string RandomMissionOrder { get; set; }

Expand Down Expand Up @@ -392,4 +396,4 @@ public class Configuration
[XmlElement(ElementName = "userSettings")]
public UserSettings UserSettings { get; set; }
}
}
}
26 changes: 20 additions & 6 deletions FASTER Maintenance/Models/ServerCfg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ public class ServerCfg : INotifyPropertyChanged
private int lobbyIdleTimeout = 300;
private bool autoSelectMission = true;
private bool randomMissionOrder = true;
private bool queueSizeLogG = 1000000; // if a specific players message queue
// is larger than 1MB and #monitor is running,
// dump his messages to a logfile for analysis

//Arma server only
//Arma server only
private short verifySignatures = 2; // 0 = Disabled ; 1 = Deprecated Activated ; 2 = Activated (Default)
private bool drawingInMap = true;
private short disableVoN; // 0 = VoN activated ; 1 = VoN Disabled
Expand Down Expand Up @@ -87,7 +90,7 @@ public class ServerCfg : INotifyPropertyChanged

private string serverCfgContent;



#region Server Options
public string PasswordAdmin
Expand Down Expand Up @@ -139,7 +142,7 @@ public int MaxPlayers
RaisePropertyChanged("MaxPlayers");
}
}

public string Motd
{
get => string.Join("\n", motd);
Expand Down Expand Up @@ -344,6 +347,16 @@ public int LobbyIdleTimeout
}
}

public int QueueSizeLogG
{
get => queueSizeLogG;
set
{
queueSizeLogG = value;
RaisePropertyChanged("QueueSizeLogG");
}
}

public bool AutoSelectMission
{
get => autoSelectMission;
Expand Down Expand Up @@ -612,7 +625,7 @@ public string Difficulty
RaisePropertyChanged("Difficulty");
}
}

public List<ProfileMission> Missions
{
get => _missions;
Expand All @@ -630,7 +643,7 @@ public List<ProfileMission> Missions
}
}
#endregion

#region Performances
public bool MaxMemOverride
{
Expand Down Expand Up @@ -769,6 +782,7 @@ public string ProcessFile()
+ $"persistent = {persistent};\t\t\t\t\t// If 1, missions still run on even after the last player disconnected.\r\n"
+ $"timeStampFormat = \"{timeStampFormat}\";\t\t\t// Set the timestamp format used on each report line in server-side RPT file. Possible values are \"none\" (default),\"short\",\"full\".\r\n"
+ $"BattlEye = {battlEye};\t\t\t\t\t// Server to use BattlEye system\r\n"
+ $"queueSizeLogG = {queueSizeLogG}; \t\t\t\t\t// // if a specific players message queue is larger than 1MB and \#monitor\ is running, dump his messages to a logfile for analysis \r\n"
+ "\r\n"
+ "// TIMEOUTS\r\n"
+ $"disconnectTimeout = {disconnectTimeout}; // Time to wait before disconnecting a user which temporarly lost connection. Range is 5 to 90 seconds.\r\n"
Expand Down Expand Up @@ -796,7 +810,7 @@ public string ProcessFile()
+ "\r\n"
+ $"{MissionContentOverride}\t\t\t\t// An empty Missions class means there will be no mission rotation\r\n"
+ "\r\n"
+ "missionWhitelist[] = {};\r\n"
+ "missionWhitelist[] = {};\r\n"
+ "// An empty whitelist means there is no restriction on what missions' available"
+ "\r\n"
+ "\r\n"
Expand Down
36 changes: 24 additions & 12 deletions FASTER/Models/ServerCfg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class ServerCfg : INotifyPropertyChanged
private bool autoSelectMission = true;
private bool randomMissionOrder = true;

//Arma server only
//Arma server only
private short verifySignatures = 0; // 0 = Disabled (FASTER Default); 1 = Deprecated Activated ; 2 = Activated (Arma Default)
private bool drawingInMap = true;
private short disableVoN; // 0 = VoN activated ; 1 = VoN Disabled
Expand All @@ -56,6 +56,7 @@ public class ServerCfg : INotifyPropertyChanged
private bool skipLobby; //Overritten by mission parameters
private string logFile = "server_console.log";
private short battlEye = 1; // 0 = Disabled ; 1 = Enabled
private int queueSizeLogG = 1000000; // If a specific players message queue is larger than 1MB and #monitor is running, dump his messages to a logfile for analysis
private string timeStampFormat = "short"; // Possible values = "none", "short", "full"
private short persistent;
private bool requiredBuildChecked;
Expand Down Expand Up @@ -86,7 +87,7 @@ public class ServerCfg : INotifyPropertyChanged

private string serverCfgContent;



#region Server Options
public string PasswordAdmin
Expand Down Expand Up @@ -138,7 +139,7 @@ public int MaxPlayers
RaisePropertyChanged("MaxPlayers");
}
}

public string Motd
{
get => string.Join("\n", motd);
Expand Down Expand Up @@ -343,6 +344,16 @@ public int LobbyIdleTimeout
}
}

public int QueueSizeLogG
{
get => queueSizeLogG;
set
{
queueSizeLogG = value;
RaisePropertyChanged("QueueSizeLogG");
}
}

public bool AutoSelectMission
{
get => autoSelectMission;
Expand Down Expand Up @@ -611,7 +622,7 @@ public string Difficulty
RaisePropertyChanged("Difficulty");
}
}

public List<ProfileMission> Missions
{
get => _missions;
Expand All @@ -620,24 +631,24 @@ public List<ProfileMission> Missions
//Removing previous triggers
_missions.ForEach(m => m.PropertyChanged -= Item_PropertyChanged);

bool isEqual = _missions.Count == value.Count
&& !( from mission in value
let local = _missions.FirstOrDefault(m => m.Path == mission.Path)
where local == null || local.MissionChecked != mission.MissionChecked
bool isEqual = _missions.Count == value.Count
&& !( from mission in value
let local = _missions.FirstOrDefault(m => m.Path == mission.Path)
where local == null || local.MissionChecked != mission.MissionChecked
select mission ).Any();

if (!isEqual)
{
_missions = value;
RaisePropertyChanged("Missions");
}

//Adding the trigger to count checked mods
_missions.ForEach(m => m.PropertyChanged += Item_PropertyChanged);
}
}
#endregion

#region Performances
public bool MaxMemOverride
{
Expand Down Expand Up @@ -780,6 +791,7 @@ public string ProcessFile()
+ $"persistent = {persistent};\t\t\t\t\t// If 1, missions still run on even after the last player disconnected.\r\n"
+ $"timeStampFormat = \"{timeStampFormat}\";\t\t\t// Set the timestamp format used on each report line in server-side RPT file. Possible values are \"none\" (default),\"short\",\"full\".\r\n"
+ $"BattlEye = {battlEye};\t\t\t\t\t// Server to use BattlEye system\r\n"
+ $"queueSizeLogG = {queueSizeLogG}; \t\t\t\t\t// // if a specific players message queue is larger than 1MB and \#monitor\ is running, dump his messages to a logfile for analysis \r\n"
+ "\r\n"
+ "// TIMEOUTS\r\n"
+ $"disconnectTimeout = {disconnectTimeout}; // Time to wait before disconnecting a user which temporarly lost connection. Range is 5 to 90 seconds.\r\n"
Expand Down Expand Up @@ -807,7 +819,7 @@ public string ProcessFile()
+ "\r\n"
+ $"{MissionContentOverride}\t\t\t\t// An empty Missions class means there will be no mission rotation\r\n"
+ "\r\n"
+ "missionWhitelist[] = {};\r\n"
+ "missionWhitelist[] = {};\r\n"
+ "// An empty whitelist means there is no restriction on what missions available"
+ "\r\n"
+ "\r\n"
Expand Down
23 changes: 12 additions & 11 deletions FASTER/Views/Profile.xaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<UserControl x:Class="FASTER.Views.Profile"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:viewModel="clr-namespace:FASTER.ViewModel"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:models="clr-namespace:FASTER.Models"
mc:Ignorable="d"
Loaded="UserControl_Loaded"
Expand Down Expand Up @@ -311,22 +311,22 @@
Background="{Binding Path=Profile.ProfileModsFilterIsInvalid, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource ProfileModsFilterIsInvalidBackgroundColorConverter}}" />
</Border>
</Canvas>
<ToggleButton Grid.Column="1" Content="{iconPacks:Material Kind=FormatLetterCase}" IsChecked="{Binding Path=Profile.ProfileModsFilterIsCaseSensitive}"
<ToggleButton Grid.Column="1" Content="{iconPacks:Material Kind=FormatLetterCase}" IsChecked="{Binding Path=Profile.ProfileModsFilterIsCaseSensitive}"
BorderThickness="0" Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Margin="2" Padding="0"
Margin="2" Padding="0"
ToolTip="Match Case" Style="{StaticResource MahApps.Styles.ToggleButton.Flat}"/>
<ToggleButton Grid.Column="2" Content="{iconPacks:Material Kind=FormatLetterMatches}" IsChecked="{Binding Path=Profile.ProfileModsFilterIsWholeWord}"
<ToggleButton Grid.Column="2" Content="{iconPacks:Material Kind=FormatLetterMatches}" IsChecked="{Binding Path=Profile.ProfileModsFilterIsWholeWord}"
BorderThickness="0"
Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Margin="2" Padding="0"
Margin="2" Padding="0"
ToolTip="Match Whole Word" Style="{StaticResource MahApps.Styles.ToggleButton.Flat}"/>
<ToggleButton Grid.Column="3" Content="{iconPacks:Material Kind=Regex}" IsChecked="{Binding Path=Profile.ProfileModsFilterIsRegex}"
<ToggleButton Grid.Column="3" Content="{iconPacks:Material Kind=Regex}" IsChecked="{Binding Path=Profile.ProfileModsFilterIsRegex}"
BorderThickness="0" Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Margin="2" Padding="0"
Margin="2" Padding="0"
ToolTip="Use Regular Expressions" Style="{StaticResource MahApps.Styles.ToggleButton.Flat}"/>

</Grid>

<!--<Border Grid.Row="4" Margin="5,-5,105,0" Height="20" BorderThickness="1" Visibility="{Binding Path=Profile.ProfileModsFilterIsInvalid, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BooleanToVisibilityConverter}}" BorderBrush="{Binding Path=Profile.ProfileModsFilterIsInvalid, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource ProfileModsFilterIsInvalidBorderColorConverter}}">
<TextBlock Foreground="White" Padding="5,1,0,0"
Text="{Binding Path=Profile.ProfileModsFilterIsInvalid, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource ProfileModsFilterIsInvalidTextConverter}}"
Expand Down Expand Up @@ -570,6 +570,7 @@
<CheckBox IsChecked="{Binding Path=Profile.ServerCfg.KickClientOnSlowNetwork}" Content="Kick on Slow Network" Margin="5,2"/>

<mah:NumericUpDown Value="{Binding Path=Profile.ServerCfg.LobbyIdleTimeout}" mah:TextBoxHelper.UseFloatingWatermark="True" mah:TextBoxHelper.Watermark="Lobby Idle Timeout" Margin="5"/>
<mah:NumericUpDown Value="{Binding Path=Profile.ServerCfg.queueSizeLogG}" mah:TextBoxHelper.UseFloatingWatermark="True" mah:TextBoxHelper.Watermark="Queue Size LogG" Margin="5"/>
<mah:NumericUpDown Value="{Binding Path=Profile.ServerCfg.SteamProtocolMaxDataSize}" mah:TextBoxHelper.UseFloatingWatermark="True" mah:TextBoxHelper.Watermark="Steam Protocol Max Data Size" Margin="5,0,5,5"/>

<StackPanel Orientation="Horizontal">
Expand Down Expand Up @@ -840,4 +841,4 @@
<Button Style="{StaticResource MahApps.Styles.Button.MetroSquare.Accent}" BorderThickness="0" Padding="7,5" ToolTip="Launch Server" Click="LaunchServer" Content="{iconPacks:Modern Kind=ControlPlay}"/>
</StackPanel>
</Grid>
</UserControl>
</UserControl>