* 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:
Łukasz Domeradzki
2023-11-14 19:12:33 +01:00
committed by GitHub
parent 1e04acb904
commit b34f18497d
90 changed files with 635 additions and 1490 deletions

View File

@@ -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)) {