mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
.NET 8 (#3005)
* Initial .NET 8 * Make it compile in release mode ignoring warnings for now * First round of improvements * Second round of improvements * Third round of improvements * Use new throws * Fix .NET Framework, YAY, thanks madness! Madness devs are awesome * Misc * Misc * AF_NETLINK might be required for some http calls No clue why * Fix service files Doesn't do what it should * Update CardsFarmer.cs * New improvements * Address feedback * Misc * Misc * Misc refactor * Misc
This commit is contained in:
committed by
GitHub
parent
1e04acb904
commit
b34f18497d
@@ -89,9 +89,7 @@ internal static class Program {
|
||||
|
||||
string executableName = Path.GetFileNameWithoutExtension(OS.ProcessFileName);
|
||||
|
||||
if (string.IsNullOrEmpty(executableName)) {
|
||||
throw new ArgumentNullException(nameof(executableName));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(executableName);
|
||||
|
||||
IEnumerable<string> arguments = Environment.GetCommandLineArgs().Skip(executableName.Equals(SharedInfo.AssemblyName, StringComparison.Ordinal) ? 1 : 0);
|
||||
|
||||
@@ -109,17 +107,13 @@ internal static class Program {
|
||||
}
|
||||
|
||||
private static void HandleCryptKeyArgument(string cryptKey) {
|
||||
if (string.IsNullOrEmpty(cryptKey)) {
|
||||
throw new ArgumentNullException(nameof(cryptKey));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(cryptKey);
|
||||
|
||||
ArchiCryptoHelper.SetEncryptionKey(cryptKey);
|
||||
}
|
||||
|
||||
private static async Task<bool> HandleCryptKeyFileArgument(string cryptKeyFile) {
|
||||
if (string.IsNullOrEmpty(cryptKeyFile)) {
|
||||
throw new ArgumentNullException(nameof(cryptKeyFile));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(cryptKeyFile);
|
||||
|
||||
if (!File.Exists(cryptKeyFile)) {
|
||||
ASF.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(cryptKeyFile)));
|
||||
@@ -149,17 +143,13 @@ internal static class Program {
|
||||
}
|
||||
|
||||
private static void HandleNetworkGroupArgument(string networkGroup) {
|
||||
if (string.IsNullOrEmpty(networkGroup)) {
|
||||
throw new ArgumentNullException(nameof(networkGroup));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(networkGroup);
|
||||
|
||||
NetworkGroup = networkGroup;
|
||||
}
|
||||
|
||||
private static bool HandlePathArgument(string path) {
|
||||
if (string.IsNullOrEmpty(path)) {
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(path);
|
||||
|
||||
// Aid userspace and replace ~ with user's home directory if possible
|
||||
if (path.Contains('~', StringComparison.Ordinal)) {
|
||||
@@ -361,7 +351,7 @@ internal static class Program {
|
||||
string globalConfigFile = ASF.GetFilePath(ASF.EFileType.Config);
|
||||
|
||||
if (string.IsNullOrEmpty(globalConfigFile)) {
|
||||
throw new ArgumentNullException(nameof(globalConfigFile));
|
||||
throw new InvalidOperationException(nameof(globalConfigFile));
|
||||
}
|
||||
|
||||
string? latestJson = null;
|
||||
@@ -420,7 +410,7 @@ internal static class Program {
|
||||
string globalDatabaseFile = ASF.GetFilePath(ASF.EFileType.Database);
|
||||
|
||||
if (string.IsNullOrEmpty(globalDatabaseFile)) {
|
||||
throw new ArgumentNullException(nameof(globalDatabaseFile));
|
||||
throw new InvalidOperationException(nameof(globalDatabaseFile));
|
||||
}
|
||||
|
||||
if (!File.Exists(globalDatabaseFile)) {
|
||||
|
||||
Reference in New Issue
Block a user