Skip to content

Commit b53988b

Browse files
Merge pull request #34 from EvaisaDev/fix-argument-parsing
fix version argument parsing
2 parents 8a07ffd + f53c5f7 commit b53988b

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

NetcodePatcher.Cli/NetcodePatchCommand.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public NetcodePatchCommand()
2323

2424
Add(new Argument<FileSystemInfo>("plugin","Paths to patch folder/file") { Arity = ArgumentArity.ExactlyOne }.ExistingOnly().NoUnc());
2525
Add(new Argument<FileSystemInfo[]>("dependencies", "Paths to dependency folders/files") { Arity = ArgumentArity.ZeroOrMore }.ExistingOnly().NoUnc());
26-
Add(new Option<Version>(["--netcode-version", "-nv"], () => new Version(1, 5, 2), "Netcode for GameObjects version"));
27-
Add(new Option<Version>(["--transport-version", "-tv"], () => new Version(1, 0, 0), "Unity Transport version"));
28-
Add(new Option<Version>(["--unity-version", "-uv"], () => new Version(2022, 3, 9), "Unity editor version (major.minor)"));
26+
Add(new Option<string>(["--netcode-version", "-nv"], () => "1.5.2", "Netcode for GameObjects version"));
27+
Add(new Option<string>(["--transport-version", "-tv"], () => "1.0.0", "Unity Transport version"));
28+
Add(new Option<string>(["--unity-version", "-uv"], () => "2022.3.9", "Unity editor version (major.minor)"));
2929
Add(new Option<bool>(["--unity-netcode-native-collection-support", "-unncs"], () => false, "Whether Netcode's native collection support is enabled"));
3030
Add(new Option<string?>(["--output", "-o"], "Output folder/file path").LegalFilePathsOnly());
3131
Add(new Option<bool>("--no-overwrite", "Sets output path to [assembly]_patched.dll, as opposed to renaming the original assembly"));
@@ -39,9 +39,9 @@ public NetcodePatchCommand()
3939
private static void Handle(
4040
FileSystemInfo plugin,
4141
FileSystemInfo[] dependencies,
42-
Version netcodeVersion,
43-
Version transportVersion,
44-
Version unityVersion,
42+
string netcodeVersion,
43+
string transportVersion,
44+
string unityVersion,
4545
bool nativeCollectionSupport,
4646
string? output,
4747
bool noOverwrite,
@@ -96,9 +96,9 @@ private static void Handle(
9696
Log.Information("Found {Count} dependency assemblies:\n{Assemblies}", dependencyAssemblies.Count, dependencyAssemblies.Select(x => x.Name));
9797

9898
var patcherConfiguration = new PatcherConfiguration {
99-
UnityVersion = unityVersion,
100-
NetcodeVersion = netcodeVersion,
101-
TransportVersion = transportVersion,
99+
UnityVersion = Version.Parse(unityVersion),
100+
NetcodeVersion = Version.Parse(netcodeVersion),
101+
TransportVersion = Version.Parse(transportVersion),
102102
NativeCollectionSupport = nativeCollectionSupport,
103103
};
104104
var patcherLoader = new PatcherLoader(patcherConfiguration);

0 commit comments

Comments
 (0)