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

Merge Master updates in Feature Branch #199

Merged
merged 13 commits into from
Sep 30, 2024
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
19 changes: 19 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish

on:
release:
types: [released]

jobs:

winget:
runs-on: windows-latest
steps:
# Requires forked winget-pkgs: https://github.com/microsoft/winget-pkgs to the same account as this project
- name: Submit to WinGet
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Foxlider.FASTER
installers-regex: 'Release_x64.zip'
max-versions-to-keep: 5
token: ${{ secrets.WINGET_TOKEN }} # Classic Personal Access Token with [public_repo, workflow] scopes
2 changes: 1 addition & 1 deletion FASTER Maintenance/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private static void MigrateTo17()
}
Console.WriteLine($"\tRead config from '{selected}\\user.config'");

var servers = conf16.UserSettings.Settings.Setting.FirstOrDefault(s => s.Name == "Servers");
var servers = conf16.UserSettings.Settings.Setting.Find(s => s.Name == "Servers");
conf16.UserSettings.Settings.Setting.Remove(servers);
conf17.UserSettings = new Models._17Models.UserSettings { Settings = new Models._17Models.Settings { Setting = conf16.UserSettings.Settings.Setting } };
Console.WriteLine("\tConverted standard values to 1.7");
Expand Down
2 changes: 1 addition & 1 deletion FASTER/FASTER.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<PublishReadyToRunComposite>false</PublishReadyToRunComposite>
<UseWPF>true</UseWPF>
<Version>1.9.5.2</Version>
<Version>1.9.5.3</Version>
<Authors>Keelah Fox</Authors>
<Company>FoxliCorp.</Company>
<Description>Fox's Arma Server Tool Extended Rewrite</Description>
Expand Down
2 changes: 1 addition & 1 deletion FASTER/Models/ArmaMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ internal async Task UpdateModAsync()
break;
case UpdateState.Success:
Status = ArmaModStatus.UpToDate;
var nx = new DateTime(1970, 1, 1);
var nx = DateTime.UnixEpoch;
var ts = DateTime.UtcNow - nx;

LocalLastUpdated = (ulong) ts.TotalSeconds;
Expand Down
8 changes: 4 additions & 4 deletions FASTER/Models/ServerCfg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public bool HeadlessClientEnabled
{
headlessClientEnabled = value;
RaisePropertyChanged("HeadlessClientEnabled");
if (value && !headlessClients.Any(e => e.Length > 0))
if (value && !headlessClients.Exists(e => e.Length > 0))
{ HeadlessClients = "127.0.0.1"; }
}
}
Expand Down Expand Up @@ -733,7 +733,7 @@ public List<ProfileMission> Missions

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

Expand Down Expand Up @@ -932,8 +932,8 @@ public string ProcessFile()
+ "\r\n"
+ "\r\n"
+ "// HEADLESS CLIENT\r\n"
+ $"{(headlessClientEnabled && !headlessClients.Any(string.IsNullOrWhiteSpace) ? $"headlessClients[] = { "{\n\t\"" + string.Join("\",\n\t \"", headlessClients) + "\"\n}" };\r\n" : "")}"
+ $"{(headlessClientEnabled && !localClient.Any(string.IsNullOrWhiteSpace)? $"localClient[] = { "{\n\t\"" + string.Join("\",\n\t \"", localClient) + "\"\n}" };" : "")}";
+ $"{(headlessClientEnabled && !headlessClients.Exists(string.IsNullOrWhiteSpace) ? $"headlessClients[] = { "{\n\t\"" + string.Join("\",\n\t \"", headlessClients) + "\"\n}" };\r\n" : "")}"
+ $"{(headlessClientEnabled && !localClient.Exists(string.IsNullOrWhiteSpace)? $"localClient[] = { "{\n\t\"" + string.Join("\",\n\t \"", localClient) + "\"\n}" };" : "")}";
return output;
}

Expand Down
2 changes: 1 addition & 1 deletion FASTER/Models/ServerProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public ServerProfile Clone()
{
p.GenerateNewId();

if (p.Name.EndsWith(")") && p.Name.Contains('(') && int.TryParse(p.Name.Substring(p.Name.Length - 2, 1), out _))
if (p.Name.EndsWith(')') && p.Name.Contains('(') && int.TryParse(p.Name.Substring(p.Name.Length - 2, 1), out _))
{
var i = p.Name.IndexOf('(');
var j = p.Name.Length;
Expand Down
4 changes: 2 additions & 2 deletions FASTER/ViewModel/ModsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public async Task AddLocalModAsync()
return;

var oldPaths = new List<string>();
if (!Path.GetFileName(localPath).StartsWith("@") && Directory.GetDirectories(localPath).Where((file) => Path.GetFileName(file).StartsWith("@")).ToList().Count > 0)
if (!Path.GetFileName(localPath).StartsWith('@') && Directory.GetDirectories(localPath).Where((file) => Path.GetFileName(file).StartsWith('@')).ToList().Count > 0)
{
oldPaths = Directory.GetDirectories(localPath).Where((file) => Path.GetFileName(file).StartsWith("@")).ToList();
oldPaths = Directory.GetDirectories(localPath).Where((file) => Path.GetFileName(file).StartsWith('@')).ToList();
}
else
{
Expand Down
10 changes: 5 additions & 5 deletions FASTER/ViewModel/ProfileViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ internal void DeleteProfile()
{ Directory.Delete(Path.Combine(Profile.ArmaPath, "Servers", Profile.Id), true); }
Properties.Settings.Default.Profiles.Remove(Profile);
Properties.Settings.Default.Save();
MainWindow.Instance.ContentProfileViews.Remove(MainWindow.Instance.ContentProfileViews.FirstOrDefault(p => p.Profile.Id == Profile.Id));
MainWindow.Instance.ContentProfileViews.Remove(MainWindow.Instance.ContentProfileViews.Find(p => p.Profile.Id == Profile.Id));
var menuItem = MainWindow.Instance.IServerProfilesMenu.Items.Cast<ToggleButton>().FirstOrDefault(p => p.Name == Profile.Id);
if(menuItem != null)
MainWindow.Instance.IServerProfilesMenu.Items.Remove(menuItem);
Expand Down Expand Up @@ -302,7 +302,7 @@ internal void LoadModsFromFile()
List<string> notFound = new();
foreach (var extractedMod in extractedModList)
{
var mod = Profile.ProfileMods.FirstOrDefault(m => m.Id == extractedMod.Id || ModUtilities.GetCompareString(extractedMod.Name) == ModUtilities.GetCompareString(m.Name));
var mod = Profile.ProfileMods.Find(m => m.Id == extractedMod.Id || ModUtilities.GetCompareString(extractedMod.Name) == ModUtilities.GetCompareString(m.Name));
if (mod != null)
{
mod.ClientSideChecked = true;
Expand Down Expand Up @@ -396,7 +396,7 @@ internal async Task ClearModKeys()
{
foreach (var keyFile in Directory.GetFiles(Path.Combine(Profile.ArmaPath, "keys")))
{
if (ignoredKeys.Any(keyFile.Contains))
if (Array.Exists(ignoredKeys, x => keyFile.Contains(x)))
continue;
try
{
Expand All @@ -423,7 +423,7 @@ public void LoadData()
var modlist = new List<ProfileMod>();
foreach(var mod in Properties.Settings.Default.armaMods.ArmaMods)
{
ProfileMod existingMod = Profile.ProfileMods.FirstOrDefault(m => m.Id == mod.WorkshopId);
ProfileMod existingMod = Profile.ProfileMods.Find(m => m.Id == mod.WorkshopId);
if (existingMod == null)
{
var newProfile = new ProfileMod { Name = mod.Name, Id = mod.WorkshopId, IsLocal = mod.IsLocal};
Expand Down Expand Up @@ -465,7 +465,7 @@ internal void LoadMissions()

foreach (var mission in newMissions)
{
ProfileMission existingMission = Profile.ServerCfg.Missions.FirstOrDefault(m => m.Path == mission);
ProfileMission existingMission = Profile.ServerCfg.Missions.Find(m => m.Path == mission);
if (existingMission == null)
{
var newMission = new ProfileMission { Name = mission.Replace(".pbo", ""), Path = mission };
Expand Down
2 changes: 1 addition & 1 deletion FASTER/ViewModel/SteamUpdaterViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public async Task<int> RunModsUpdater(ObservableCollection<ArmaMod> mods)

sw.Stop();
mod.Status = ArmaModStatus.UpToDate;
var nx = new DateTime(1970, 1, 1);
var nx = DateTime.UnixEpoch;
var ts = DateTime.UtcNow - nx;
mod.LocalLastUpdated = (ulong) ts.TotalSeconds;

Expand Down
18 changes: 16 additions & 2 deletions FASTER/Views/Profile.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@
<mah:NumericUpDown Value="{Binding Profile.Port, UpdateSourceTrigger=PropertyChanged}" mah:TextBoxHelper.UseFloatingWatermark="True" mah:TextBoxHelper.Watermark="Port" ToolTip="Port for ArmaServer"/>
</StackPanel>
</GroupBox>
<StackPanel Height="10"/>
<GroupBox Header="DLCs">
<StackPanel Background="{Binding Mode=OneWay, Source={StaticResource MahApps.Brushes.Menu.Background}}">
<StackPanel Height="10"/>
<CheckBox IsChecked="{Binding Profile.ContactDLCChecked}" Content="Contact DLC" Margin="10,3" Width="105" HorizontalAlignment="Left"/>
<CheckBox IsChecked="{Binding Profile.GMDLCChecked}" Content="GM DLC" Margin="10,3" HorizontalAlignment="Left"/>
<CheckBox IsChecked="{Binding Profile.PFDLCChecked}" Content="Prairie Fire DLC" Margin="10,3" Width="105" HorizontalAlignment="Left"/>
<CheckBox IsChecked="{Binding Profile.CSLADLCChecked}" Content="CSLA DLC" Margin="10,3" HorizontalAlignment="Left"/>
<CheckBox IsChecked="{Binding Profile.WSDLCChecked}" Content="Western Sahara DLC" Margin="10,3" HorizontalAlignment="Left"/>
<CheckBox IsChecked="{Binding Profile.SPEDLCChecked}" Content="Spearhead 1944 DLC" Margin="10,3" HorizontalAlignment="Left"/>
<CheckBox IsChecked="{Binding Profile.RFDLCChecked}" Content="Reaction Forces DLC" Margin="10,3" HorizontalAlignment="Left"/>
<StackPanel Height="10"/>
</StackPanel>
</GroupBox>
</StackPanel>
<GroupBox Header="Mods" Grid.Row="0" Grid.Column="1" Margin="5">
<Grid>
Expand Down Expand Up @@ -90,7 +104,7 @@
<TextBlock Text="Clear Keys" Margin="10,0" />
</StackPanel>
</Button>
<Canvas>
<!--<Canvas>
<Expander Header="DLCs" Margin="5" mah:ControlsHelper.ContentCharacterCasing="Normal" Background="{Binding Mode=OneWay, Source={StaticResource MahApps.Brushes.Menu.Background}}">
<StackPanel Orientation="Vertical">
<CheckBox IsChecked="{Binding Profile.ContactDLCChecked}" Content="Contact DLC" Margin="10,3" Width="105" HorizontalAlignment="Left"/>
Expand All @@ -102,7 +116,7 @@
<CheckBox IsChecked="{Binding Profile.RFDLCChecked}" Content="Reaction Forces DLC" Margin="10,3" HorizontalAlignment="Left"/>
</StackPanel>
</Expander>
</Canvas>
</Canvas>-->
</StackPanel>
<DataGrid Grid.Row="1" ItemsSource="{Binding Path=Profile.FilteredProfileMods, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" CanUserReorderColumns="False" CanUserSortColumns="True" AutoGenerateColumns="False" CanUserAddRows="False">
<DataGrid.Resources>
Expand Down
2 changes: 1 addition & 1 deletion FASTER_Version.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.9.5.2</version>
<version>1.9.5.3</version>
<url>https://github.com/Foxlider/FASTER/releases/latest/download/Release_x64.zip</url>
<changelog>https://github.com/Foxlider/FASTER/releases</changelog>
<mandatory>true</mandatory>
Expand Down
Loading