Skip to content
Merged
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
2 changes: 1 addition & 1 deletion FASTER/Models/Arma3Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Arma3Profile : INotifyPropertyChanged
private ushort mapContentMines = 1;
private ushort autoReport = 0;
private ushort multipleSaves = 0;
private int tacticalPing = 1;
private int tacticalPing = 1;

private ushort aiLevelPreset = 3;
private double skillAi = 0.5;
Expand Down
16 changes: 8 additions & 8 deletions FASTER/Models/BasicCfg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public static class BasicCfgArrays
[Serializable]
public class BasicCfg : INotifyPropertyChanged
{
private uint viewDistance = 2000;
private double terrainGrid = 25;
private uint viewDistance = 2000;
private double terrainGrid = 25;

private ushort maxMsgSend = 128;
private ushort maxSizeGuaranteed = 256;
Expand Down Expand Up @@ -158,10 +158,10 @@ public string PerfPreset
MaxMsgSend = 256;
MaxSizeGuaranteed = 512;
MaxSizeNonGuaranteed = 256;
MinErrorToSend = 0.001;
MinErrorToSendNear = 0.01;
MaxPacketSize = 1400;
MaxCustomFileSize = 160;
MinErrorToSend = 0.001;
MinErrorToSendNear = 0.01;
MaxPacketSize = 1400;
MaxCustomFileSize = 160;


switch ((short)Array.IndexOf(BasicCfgArrays.PerfPresets, value))
Expand All @@ -177,8 +177,8 @@ public string PerfPreset
MinBandwidth = 250000000;
break;
case 4:
MaxMsgSend = 512;
MinBandwidth = 1000000000;
MaxMsgSend = 512;
MinBandwidth = 1000000000;
break;
}
RaisePropertyChanged("PerfPreset");
Expand Down
158 changes: 90 additions & 68 deletions FASTER/Models/ServerCfg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public class ServerCfg : INotifyPropertyChanged
private string passwordAdmin;
private string password;
private string hostname;
private int maxPlayers = 32;
private List<string> motd = new();
private int maxPlayers = 32;
private List<string> motd = new();
private int motdInterval;
private List<string> admins = new();
private List<string> headlessClients = new();
private List<string> localClient = new();
private List<string> admins = new();
private List<string> headlessClients = new();
private List<string> localClient = new();
private bool headlessClientEnabled;
private bool votingEnabled;
private bool netlogEnabled;
Expand All @@ -47,18 +47,13 @@ public class ServerCfg : INotifyPropertyChanged
private bool autoSelectMission = true;
private bool randomMissionOrder = true;
private int briefingTimeOut = 60; // <-
private int roleTimeOut = 90; // <- These are BI base figues
private int votingTimeOut = 60; // <-
private int roleTimeOut = 90; // <- These are BI base figues
private int votingTimeOut = 60; // <-
private int debriefingTimeOut = 45; // <-
private bool LogObjectNotFound = true; // logging enabled
private bool SkipDescriptionParsing = false; // parse description.ext
private bool ignoreMissionLoadErrors = false; // do not ingore errors
private int armaUnitsTimeout = 30; // Defines how long the player will be stuck connecting and wait for armaUnits data. Player will be notified if timeout elapsed and no units data was received
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 forcedDifficulty = "Custom"; // By default forcedDifficulty is only applying Custom


//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 @@ -78,17 +73,19 @@ public class ServerCfg : INotifyPropertyChanged
private string doubleIdDetected;
private string onUserConnected;
private string onUserDisconnected;
private string onHackedData = "kick (_this select 0)";
private string onHackedData = "kick (_this select 0)";
private string onDifferentData;
private string onUnsignedData = "kick (_this select 0)";
private string onUnsignedData = "kick (_this select 0)";
private string onUserKicked;

//Mision Settings
private bool missionSelectorChecked;
private string missionContentOverride;
private List<ProfileMission> _missions = new();
private List<ProfileMission> _missions = new();
private bool autoInit;
private string difficulty = "Custom";

//Performance
private bool maxMemOverride;
private uint maxMem = 1024;
private bool cpuCountOverride;
Expand All @@ -97,8 +94,6 @@ public class ServerCfg : INotifyPropertyChanged

private string serverCfgContent;



#region Server Options
public string PasswordAdmin
{
Expand Down Expand Up @@ -290,7 +285,7 @@ public string AllowedFilePatching
set
{
allowedFilePatching = (short)Array.IndexOf(ServerCfgArrays.AllowFilePatchingStrings, value);
RaisePropertyChanged("Password");
RaisePropertyChanged("AllowedFilePatching");
}
}

Expand Down Expand Up @@ -394,36 +389,6 @@ public int DebriefingTimeOut
}
}

public bool logObjectNotFound
{
get => LogObjectNotFound;
set
{
LogObjectNotFound = value;
RaisePropertyChanged("logObjectNotFound");
}
}

public bool skipDescriptionParsing
{
get => SkipDescriptionParsing;
set
{
SkipDescriptionParsing = value;
RaisePropertyChanged("skipDescriptionParsing");
}
}

public bool IgnoreMissionLoadErrors
{
get => ignoreMissionLoadErrors;
set
{
ignoreMissionLoadErrors = value;
RaisePropertyChanged("IgnoreMissionLoadErrors");
}
}

public int ArmaUnitsTimeout
{
get => armaUnitsTimeout;
Expand All @@ -434,16 +399,6 @@ public int ArmaUnitsTimeout
}
}

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

public string ForcedDifficulty
{
get => forcedDifficulty;
Expand Down Expand Up @@ -818,6 +773,72 @@ public ServerCfg()
{ ServerCfgContent = ProcessFile(); }
}

[Serializable]
public class AdvancedOptions : INotifyPropertyChanged
{
private bool logObjectNotFound = true; // logging enabled
private bool skipDescriptionParsing = false; // Parse description.ext
private bool ignoreMissionLoadErrors = false; // Do not ignore errors
private int queueSizeLogG = 0; // If a specific players message queue is larger than <Value> and '#monitor' is running, dump his messages to a logfile for analysis

public bool LogObjectNotFound
{
get => logObjectNotFound;
set
{
logObjectNotFound = value;
RaisePropertyChanged("LogObjectNotFound");
}
}

public bool SkipDescriptionParsing
{
get => skipDescriptionParsing;
set
{
skipDescriptionParsing = value;
RaisePropertyChanged("SkipDescriptionParsing");
}
}

public bool IgnoreMissionLoadErrors
{
get => ignoreMissionLoadErrors;
set
{
ignoreMissionLoadErrors = value;
RaisePropertyChanged("IgnoreMissionLoadErrors");
}
}

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

private string advancedOptionsContent;

public string AdvancedOptionsContent
{
get => AdvancedOptionsContent;
set
{
AdvancedOptionsContent = value;
RaisePropertyChanged("AdvancedOptionsContent");
}
}

public AdvancedOptions()
{
if(string.IsNullOrWhiteSpace(AdvancedOptionsContent))
{ AdvancedOptionsContent = ProcessFile(); }
}

private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
RaisePropertyChanged("MissionChecked");
Expand Down Expand Up @@ -888,14 +909,14 @@ public string ProcessFile()
+ $"disableVoN = {disableVoN};\t\t\t\t// If set to 1, Voice over Net will not be available\r\n"
+ $"vonCodec = {vonCodec};\t\t\t\t// If set to 1 then it uses IETF standard OPUS codec, if to 0 then it uses SPEEX codec (since Arma 3 update 1.58+) \r\n"
+ $"skipLobby = {(skipLobby ? "1" : "0")};\t\t\t\t// Overridden by mission parameters\r\n"
+ $"vonCodecQuality = {vonCodecQuality};\t\t\t// since 1.62.95417 supports range 1-20 //since 1.63.x will supports range 1-30 //8kHz is 0-10, 16kHz is 11-20, 32kHz(48kHz) is 21-30 \r\n"
+ $"vonCodecQuality = {vonCodecQuality};\t\t\t// Since 1.62.95417 supports range 1-20 //since 1.63.x will supports range 1-30 //8kHz is 0-10, 16kHz is 11-20, 32kHz(48kHz) is 21-30 \r\n"
+ $"persistent = {persistent};\t\t\t\t// If 1, missions still run on even after the last player disconnected.\r\n"
+ $"timeStampFormat = \"{timeStampFormat}\";\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// Server to use BattlEye system\r\n"
+ $"queueSizeLogG = {queueSizeLogG};\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"
+ $"LogObjectNotFound = {logObjectNotFound};\t\t// When false to skip logging 'Server: Object not found messages'.\r\n"
+ $"SkipDescriptionParsing = {skipDescriptionParsing};\t\t// When true to skip parsing of description.ext/mission.sqm. Will show pbo filename instead of configured missionName. OverviewText and such won't work, but loading the mission list is a lot faster when there are many missions \r\n"
+ $"ignoreMissionLoadErrors = {ignoreMissionLoadErrors};\t\t// When set to true, the mission will load no matter the amount of loading errors. If set to false, the server will abort mission's loading and return to mission selection.\r\n"
+ $"queueSizeLogG = {QueueSizeLogG};\t\t\t// If a specific players message queue is larger than Value number and #monitor is running, dump his messages to a logfile for analysis \r\n"
+ $"LogObjectNotFound = {LogObjectNotFound};\t\t// When false to skip logging 'Server: Object not found messages'.\r\n"
+ $"SkipDescriptionParsing = {SkipDescriptionParsing};\t\t// When true to skip parsing of description.ext/mission.sqm. Will show pbo filename instead of configured missionName. OverviewText and such won't work, but loading the mission list is a lot faster when there are many missions \r\n"
+ $"ignoreMissionLoadErrors = {IgnoreMissionLoadErrors};\t\t// When set to true, the mission will load no matter the amount of loading errors. If set to false, the server will abort mission's loading and return to mission selection.\r\n"
+ $"forcedDifficulty = {forcedDifficulty};\t\t\t// Forced difficulty (Recruit, Regular, Veteran, Custom)\r\n"
+ "\r\n"
+ "// TIMEOUTS\r\n"
Expand All @@ -917,9 +938,9 @@ public string ProcessFile()
+ $"doubleIdDetected = \"{doubleIdDetected}\";\t\t\t//\r\n"
+ "\r\n"
+ "// SIGNATURE VERIFICATION\r\n"
+ $"onUnsignedData = \"{onUnsignedData}\";\t// unsigned data detected\r\n"
+ $"onHackedData = \"{onHackedData}\";\t// tampering of the signature detected\r\n"
+ $"onDifferentData = \"{onDifferentData}\";\t\t\t// data with a valid signature, but different version than the one present on server detected\r\n"
+ $"onUnsignedData = \"{onUnsignedData}\";\t// Unsigned data detected\r\n"
+ $"onHackedData = \"{onHackedData}\";\t// Tampering of the signature detected\r\n"
+ $"onDifferentData = \"{onDifferentData}\";\t\t\t// Data with a valid signature, but different version than the one present on server detected\r\n"
+ "\r\n"
+ "\r\n"
+ "// MISSIONS CYCLE (see below)\r\n"
Expand Down Expand Up @@ -991,4 +1012,5 @@ private void RaisePropertyChanged(string property)
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
}
}
}
}
}
34 changes: 26 additions & 8 deletions FASTER/Models/ServerProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ public ServerProfileCollection()

internal static void AddServerProfile(string profileName)
{
var currentProfiles = Properties.Settings.Default.Profiles;
var currentProfiles = Properties.Settings.Default.Profiles;
var p = new ServerProfile(profileName);
p.ServerCfg.ServerCfgContent = p.ServerCfg.ProcessFile();
p.BasicCfg.BasicContent = p.BasicCfg.ProcessFile();
p.ArmaProfile.ArmaProfileContent = p.ArmaProfile.ProcessFile();
p.ServerCfg.ServerCfgContent = p.ServerCfg.ProcessFile();
p.ServerCfg.AdvancedOptionsContent = p.AdvancedOptions.ProcessFile();
p.BasicCfg.BasicContent = p.BasicCfg.ProcessFile();
p.ArmaProfile.ArmaProfileContent = p.ArmaProfile.ProcessFile();
currentProfiles.Add(p);
Properties.Settings.Default.Profiles = currentProfiles;
Properties.Settings.Default.Profiles = currentProfiles;
Properties.Settings.Default.Save();
MainWindow.Instance.LoadServerProfiles();
}
Expand Down Expand Up @@ -71,6 +72,7 @@ public class ServerProfile : INotifyPropertyChanged
private bool _profileModsFilterIsRegex = false;
private bool _profileModsFilterIsInvalid = false;
private ServerCfg _serverCfg;
private ServerCfg _advancedOptions;
private Arma3Profile _armaProfile;
private BasicCfg _basicCfg;

Expand Down Expand Up @@ -367,8 +369,8 @@ public bool ProfileModsFilterIsInvalid
}
}

public ServerCfg ServerCfg
{
public ServerCfg ServerCfg
{
get => _serverCfg;
set
{
Expand All @@ -379,6 +381,19 @@ public ServerCfg ServerCfg
RaisePropertyChanged("ServerCfg");
}
}

public ServerCfg AdvancedOptions
{
get => _advancedOptions;
set
{
if(_advancedOptions != null)
_advancedOptions.PropertyChanged -= Class_PropertyChanged;
_advancedOptions = value;
_advancedOptions.PropertyChanged += Class_PropertyChanged;
RaisePropertyChanged("AdvancedOptions");
}
}

public Arma3Profile ArmaProfile
{
Expand Down Expand Up @@ -413,12 +428,14 @@ public ServerProfile(string name, bool createFolder = true)
Name = name;
Executable = Path.Combine(Properties.Settings.Default.serverPath, "arma3server_x64.exe");
ServerCfg = new ServerCfg(){ Hostname = name};
AdvancedOptions = new AdvancedOptions();
ArmaProfile = new Arma3Profile();
BasicCfg = new BasicCfg();
ServerCfg.ServerCfgContent = ServerCfg.ProcessFile();
ServerCfg.AdvancedOptionsContent = AdvancedOptions.ProcessFile();
ArmaProfile.ArmaProfileContent = ArmaProfile.ProcessFile();
BasicCfg.BasicContent = BasicCfg.ProcessFile();

ServerCfg.AdvancedOptionsContent = AdvancedOptions.ProcessFile();
if (createFolder)
{ Directory.CreateDirectory(Path.Combine(Properties.Settings.Default.serverPath, "Servers", Id)); }
}
Expand All @@ -431,6 +448,7 @@ public ServerProfile()
ArmaProfile = new Arma3Profile();
BasicCfg = new BasicCfg();
ServerCfg.ServerCfgContent = ServerCfg.ProcessFile();
ServerCfg.AdvancedOptionsContent = AdvancedOptions.ProcessFile();
ArmaProfile.ArmaProfileContent = ArmaProfile.ProcessFile();
BasicCfg.BasicContent = BasicCfg.ProcessFile();
}
Expand Down
4 changes: 2 additions & 2 deletions FASTER/Views/Profile.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,8 @@
<ComboBox SelectedItem="{Binding Path=Profile.ServerCfg.VerifySignatures}" ItemsSource="{Binding Path=VerifySignatures}" mah:TextBoxHelper.UseFloatingWatermark="True" mah:TextBoxHelper.Watermark="Verify Signatures" Margin="5"/>
<CheckBox IsChecked="{Binding Path=Profile.ServerCfg.KickDuplicates}" Content="Kick Duplicates" Margin="5,2"/>
<CheckBox IsChecked="{Binding Path=Profile.ServerCfg.KickClientOnSlowNetwork}" Content="Kick on Slow Network" Margin="5,2"/>
<CheckBox IsChecked="{Binding Path=Profile.ServerCfg.logObjectNotFound}" Content="Log Object Not Found" Margin="5,2"/>
<CheckBox IsChecked="{Binding Path=Profile.ServerCfg.skipDescriptionParsing}" Content="Skip Description Parsing" Margin="5,2"/>
<CheckBox IsChecked="{Binding Path=Profile.ServerCfg.LogObjectNotFound}" Content="Log Object Not Found" Margin="5,2"/>
<CheckBox IsChecked="{Binding Path=Profile.ServerCfg.SkipDescriptionParsing}" Content="Skip Description Parsing" Margin="5,2"/>
<CheckBox IsChecked="{Binding Path=Profile.ServerCfg.IgnoreMissionLoadErrors}" Content="Ignore Mission Load Errors" Margin="5,2"/>

<StackPanel>
Expand Down
Loading