Skip to content
Open
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
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion BytexDigital.Steam
Submodule BytexDigital.Steam deleted from f7189c
6 changes: 0 additions & 6 deletions FASTER.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FASTERTests", "FASTERTests\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FASTER Maintenance", "FASTER Maintenance\FASTER Maintenance.csproj", "{465FB100-A08C-4E4F-A321-EC85C5C177B3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BytexDigital.Steam", "BytexDigital.Steam\BytexDigital.Steam\BytexDigital.Steam.csproj", "{22F5B346-B3B2-302D-9D68-35A2DFCE2081}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -41,10 +39,6 @@ Global
{65FDF864-BF9B-414A-A6E6-3473BCFB62BE}.Release|Any CPU.Build.0 = Release|Any CPU
{465FB100-A08C-4E4F-A321-EC85C5C177B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{465FB100-A08C-4E4F-A321-EC85C5C177B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22F5B346-B3B2-302D-9D68-35A2DFCE2081}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22F5B346-B3B2-302D-9D68-35A2DFCE2081}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22F5B346-B3B2-302D-9D68-35A2DFCE2081}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22F5B346-B3B2-302D-9D68-35A2DFCE2081}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
5 changes: 1 addition & 4 deletions FASTER/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<value>True</value>
</setting>
<setting name="serverBranch" serializeAs="String">
<value>Stable</value>
<value>public</value>
</setting>
<setting name="excludeServerFolder" serializeAs="String">
<value>False</value>
Expand All @@ -55,9 +55,6 @@
<setting name="font" serializeAs="String">
<value>Segoe UI</value>
</setting>
<setting name="CliWorkers" serializeAs="String">
<value>10</value>
</setting>
<setting name="usingPerfBinaries" serializeAs="String">
<value>False</value>
</setting>
Expand Down
3 changes: 1 addition & 2 deletions FASTER/FASTER - Backup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autoupdater.NET.Official" Version="1.7.0" />
<PackageReference Include="BytexDigital.Steam" Version="0.8.2-preview.1647708363" />
<PackageReference Include="FontAwesome.WPF" Version="4.7.0.9" />
<PackageReference Include="LiveCharts.Wpf" Version="0.9.7" />
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
Expand Down Expand Up @@ -83,4 +82,4 @@
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>
</Project>
4 changes: 1 addition & 3 deletions FASTER/FASTER.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@
<PackageReference Include="MahApps.Metro.SimpleChildWindow" Version="2.2.1" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="5.0.5" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="5.0.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="WindowsAPICodePack-Shell" Version="1.1.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BytexDigital.Steam\BytexDigital.Steam\BytexDigital.Steam.csproj" />
</ItemGroup>
</Project>
11 changes: 7 additions & 4 deletions FASTER/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace FASTER
public partial class MainWindow
{
internal bool ConvertMods { get; set; }
internal string LegacySteamCmdPathForConversion { get; set; } = string.Empty;
internal string Version;
internal bool NavEnabled = true;

Expand Down Expand Up @@ -160,8 +161,7 @@ private async void MetroWindow_Loaded(object sender, RoutedEventArgs e)
private void MetroWindow_Closing(object sender, CancelEventArgs e)
{
Properties.Settings.Default.Save();
SteamUpdaterViewModel.Instance.SteamClient?.Shutdown();
SteamUpdaterViewModel.Instance.SteamClient?.Dispose();
SteamUpdaterViewModel.Instance.Dispose();
Application.Current.Shutdown();
}

Expand Down Expand Up @@ -451,13 +451,16 @@ private async Task ModConversion()
{
var properties = Properties.Settings.Default;
var modStagingDir = properties.modStagingDirectory;
string legacySteamCmdRoot = string.IsNullOrWhiteSpace(LegacySteamCmdPathForConversion)
? properties.steamCMDPath
: LegacySteamCmdPathForConversion;

var controller = await this.ShowProgressAsync("Please wait...", "Checking Drive Space...");
controller.Maximum = properties.steamMods.SteamMods.Count;
var progress = 0;

long fullzize = 0;
foreach (var mod in properties.steamMods.SteamMods.Select(m => Path.Combine(Properties.Settings.Default.steamCMDPath, "steamapps", "workshop", "content", "107410", m.WorkshopId.ToString())).Concat(properties.localMods.Select(m => m.Path)))
foreach (var mod in properties.steamMods.SteamMods.Select(m => Path.Combine(legacySteamCmdRoot, "steamapps", "workshop", "content", "107410", m.WorkshopId.ToString())).Concat(properties.localMods.Select(m => m.Path)))
{
if(!Directory.Exists(mod))
continue;
Expand Down Expand Up @@ -494,7 +497,7 @@ private async Task ModConversion()
foreach (var steamMod in properties.steamMods.SteamMods)
{
var newPath = Path.Combine(modStagingDir, steamMod.WorkshopId.ToString());
var oldPath = Path.Combine(Properties.Settings.Default.steamCMDPath, "steamapps", "workshop", "content", "107410", steamMod.WorkshopId.ToString());
var oldPath = Path.Combine(legacySteamCmdRoot, "steamapps", "workshop", "content", "107410", steamMod.WorkshopId.ToString());
if (!Directory.Exists(newPath))
Directory.CreateDirectory(newPath);

Expand Down
13 changes: 11 additions & 2 deletions FASTER/Models/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@ public static void CheckSettings()
if (!Directory.Exists(Properties.Settings.Default.serverPath))
Properties.Settings.Default.serverPath = string.Empty;

if (!Directory.Exists(Properties.Settings.Default.steamCMDPath))
Properties.Settings.Default.steamCMDPath = string.Empty;
if (!string.IsNullOrWhiteSpace(Properties.Settings.Default.steamCMDPath))
{
try
{
Properties.Settings.Default.steamCMDPath = Path.GetFullPath(Properties.Settings.Default.steamCMDPath);
}
catch (Exception)
{
Properties.Settings.Default.steamCMDPath = string.Empty;
}
}
}

public static string ParseFileSize(long size)
Expand Down
145 changes: 52 additions & 93 deletions FASTER/Models/SteamUpdaterModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using FASTER.Properties;
using System;
using System.ComponentModel;
using System.IO;

namespace FASTER.Models
{
Expand Down Expand Up @@ -32,17 +34,36 @@ public string Username
}
}

public string Password
public string SteamCmdDirectory
{
get => Settings.Default.steamPassword;
get
{
if (string.IsNullOrWhiteSpace(Settings.Default.steamCMDPath))
{
Settings.Default.steamCMDPath = GetDefaultSteamCmdDirectory();
Settings.Default.Save();
}

return Settings.Default.steamCMDPath;
}
set
{
Settings.Default.steamPassword = value;
Settings.Default.steamCMDPath = string.IsNullOrWhiteSpace(value)
? GetDefaultSteamCmdDirectory()
: value.Trim();
Settings.Default.Save();
RaisePropertyChanged(nameof(Password));
RaisePropertyChanged(nameof(SteamCmdDirectory));
}
}

private static string GetDefaultSteamCmdDirectory()
{
return Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"FASTER",
"SteamCMD");
}

public string ModStagingDirectory
{
get => Settings.Default.modStagingDirectory;
Expand Down Expand Up @@ -84,102 +105,40 @@ public double Progress
}
}

public bool UsingPerfBinaries
{
get => Settings.Default.usingPerfBinaries;
set
{
Settings.Default.usingPerfBinaries = value;
Settings.Default.Save();
RaisePropertyChanged(nameof(UsingPerfBinaries));
}
}

public bool UsingContactDlc
{
get => Settings.Default.usingContactDlc;
set
{
Settings.Default.usingContactDlc = value;
Settings.Default.Save();
RaisePropertyChanged(nameof(UsingContactDlc));
}
}

public bool UsingGMDlc
public string ServerBranch
{
get => Settings.Default.usingGMDlc;
set
get
{
Settings.Default.usingGMDlc = value;
Settings.Default.Save();
RaisePropertyChanged(nameof(UsingGMDlc));
}
}
string? branch = Settings.Default.serverBranch?.Trim().ToLowerInvariant();
if (branch is not ("public" or "contact" or "creatordlc" or "profiling"))
{
// Migrate the old independent depot toggles to SteamCMD's
// mutually-exclusive whole-app branches. Profiling takes
// precedence, followed by Contact and Creator DLC.
branch = Settings.Default.usingPerfBinaries
? "profiling"
: Settings.Default.usingContactDlc
? "contact"
: Settings.Default.usingGMDlc || Settings.Default.usingPFDlc ||
Settings.Default.usingCSLADlc || Settings.Default.usingWSDlc ||
Settings.Default.usingSPEDlc || Settings.Default.usingRFDlc ||
Settings.Default.usingEFDlc
? "creatordlc"
: "public";
Settings.Default.serverBranch = branch;
Settings.Default.Save();
}

public bool UsingPFDlc
{
get => Settings.Default.usingPFDlc;
set
{
Settings.Default.usingPFDlc = value;
Settings.Default.Save();
RaisePropertyChanged(nameof(UsingPFDlc));
return branch;
}
}

public bool UsingCSLADlc
{
get => Settings.Default.usingCSLADlc;
set
{
Settings.Default.usingCSLADlc = value;
Settings.Default.Save();
RaisePropertyChanged(nameof(UsingCSLADlc));
}
}

public bool UsingWSDlc
{
get => Settings.Default.usingWSDlc;
set
{
Settings.Default.usingWSDlc = value;
Settings.Default.Save();
RaisePropertyChanged(nameof(UsingWSDlc));
}
}

public bool UsingSPEDlc
{
get => Settings.Default.usingSPEDlc;
set
{
Settings.Default.usingSPEDlc = value;
Settings.Default.Save();
RaisePropertyChanged(nameof(UsingSPEDlc));
}
}

public bool UsingRFDlc
{
get => Settings.Default.usingRFDlc;
set
{
Settings.Default.usingRFDlc = value;
Settings.Default.Save();
RaisePropertyChanged(nameof(UsingRFDlc));
}
}

public bool UsingEFDlc
{
get => Settings.Default.usingEFDlc;
set
{
Settings.Default.usingEFDlc = value;
string? branch = value?.Trim().ToLowerInvariant();
Settings.Default.serverBranch = branch is "public" or "contact" or "creatordlc" or "profiling"
? branch
: "public";
Settings.Default.Save();
RaisePropertyChanged(nameof(UsingEFDlc));
RaisePropertyChanged(nameof(ServerBranch));
}
}

Expand Down
Loading