Fixed native aot nuget source.

Updated command line references.
Cleanup.
This commit is contained in:
Fabian
2022-01-31 15:20:23 +01:00
parent 0cec350a25
commit 3b49c8cafa
8 changed files with 22 additions and 20 deletions

View File

@@ -3,7 +3,7 @@
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="dotnet-experimental" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json" />
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>

View File

@@ -64,7 +64,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="7.0.0-*" />
<PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler" Version="7.0.0-*" />
<PackageReference Include="System.CommandLine" Version="2.0.0-*" />
<PackageReference Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-*" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,16 +1,17 @@
// Copyright (c) Arctium.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using static Arctium.WoW.Launcher.Misc.Helpers;
using System.CommandLine.Parsing;
using static Arctium.WoW.Launcher.Misc.Helpers;
namespace Arctium.WoW.Launcher;
class Launcher
{
public static string PrepareGameLaunch(ParseResult commandLineResult)
{
var gameVersion = commandLineResult.ValueForOption(LaunchOptions.Version);
var gameVersion = commandLineResult.GetValueForOption(LaunchOptions.Version);
var (SubFolder, BinaryName, MajorGameVersion, MinGameBuild) = gameVersion switch
{
#if x64
@@ -36,13 +37,13 @@ class Launcher
var gameFolder = $"{currentFolder}/{SubFolder}";
if (commandLineResult.HasOption(LaunchOptions.GameBinary))
BinaryName = commandLineResult.ValueForOption(LaunchOptions.GameBinary);
BinaryName = commandLineResult.GetValueForOption(LaunchOptions.GameBinary);
var gameBinaryPath = $"{gameFolder}/{BinaryName}";
if (commandLineResult.HasOption(LaunchOptions.GamePath))
{
gameFolder = commandLineResult.ValueForOption(LaunchOptions.GamePath);
gameFolder = commandLineResult.GetValueForOption(LaunchOptions.GamePath);
gameBinaryPath = $"{gameFolder}/{BinaryName}";
}
else if (!File.Exists(gameBinaryPath))
@@ -72,7 +73,7 @@ class Launcher
}
// Delete the cache folder by default.
if (!commandLineResult.ValueForOption(LaunchOptions.KeepCache))
if (!commandLineResult.GetValueForOption(LaunchOptions.KeepCache))
{
try
{

View File

@@ -71,7 +71,7 @@ static class Extensions
} while ((matchList.Count < maxMatches || match < maxOffset) && match != 0);
return matchList;
}
}
public static short[] ToPattern(this string data) => Encoding.UTF8.GetBytes(data).Select(b => (short)b).ToArray();
}

View File

@@ -43,10 +43,10 @@ static class NativeWindows
// Page/View
[DllImport("ntdll.dll", SetLastError = true)]
public static extern NtStatus NtCreateSection(ref nint sectionHandle, uint accessMask, nint zero, ref LargeInteger maximumSize, uint protection, uint allocationAttributes, nint zero2);
[DllImport("ntdll.dll", SetLastError = true)]
public static extern NtStatus NtMapViewOfSection(nint sectionHandle, nint proccessHandle, ref nint baseAddress, nint zero, ulong regionSize, out LargeInteger sectionOffset, out uint viewSize, uint viewSection, nint zero2, int protection);
[DllImport("ntdll.dll", SetLastError = true)]
public static extern NtStatus NtUnmapViewOfSection(nint processHandle, nint baseAddress);

View File

@@ -1,10 +1,10 @@
// Copyright (c) Arctium.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using static Arctium.WoW.Launcher.Misc.Helpers;
using System.CommandLine;
using System.CommandLine.Parsing;
using System.CommandLine.Invocation;
using static Arctium.WoW.Launcher.Misc.Helpers;
namespace Arctium.WoW.Launcher;

View File

@@ -2,7 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Arctium.WoW.Launcher.Structures;
[StructLayout(LayoutKind.Explicit, Size = 8)]
struct LargeInteger
{

View File

@@ -1,13 +1,14 @@
// Copyright (c) Arctium.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
global using System.Collections.Concurrent;
global using System.CommandLine.NamingConventionBinder;
global using System.Diagnostics;
global using System.Runtime.CompilerServices;
global using System.Runtime.InteropServices;
global using System.Text;
global using Arctium.WoW.Launcher.Constants;
global using Arctium.WoW.Launcher.IO;
global using Arctium.WoW.Launcher.Misc;
global using Arctium.WoW.Launcher.Structures;
global using System.Collections.Concurrent;
global using System.Diagnostics;
global using System.Runtime.CompilerServices;
global using System.Runtime.InteropServices;
global using System.Text;