mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-06 00:39:55 +00:00
pass game args
This commit is contained in:
parent
83fca7d31f
commit
9bd3ce25a9
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using static EntitlementsManager;
|
||||
@ -25,6 +26,8 @@ namespace EpicRerouter.ExeSide
|
||||
Console.WriteLine($"version = {Version}");
|
||||
var managedDir = args[2];
|
||||
Console.WriteLine($"managed dir = {managedDir}");
|
||||
var gameArgs = args.Skip(3).ToArray();
|
||||
Console.WriteLine($"game args = {string.Join(", ", gameArgs)}");
|
||||
Console.WriteLine();
|
||||
|
||||
AppDomain.CurrentDomain.AssemblyResolve += (_, e) =>
|
||||
|
@ -1,6 +1,8 @@
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
using static EntitlementsManager;
|
||||
@ -31,6 +33,8 @@ namespace EpicRerouter.ModSide
|
||||
Log($"process path = {processPath}");
|
||||
var gamePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(typeof(EpicPlatformManager).Assembly.Location)!, ".."));
|
||||
Log($"game path = {gamePath}");
|
||||
var workingDirectory = Path.Combine(gamePath, "Plugins", "x86_64");
|
||||
Log($"working dir = {workingDirectory}");
|
||||
var args = new[]
|
||||
{
|
||||
Application.productName,
|
||||
@ -38,11 +42,15 @@ namespace EpicRerouter.ModSide
|
||||
Path.Combine(gamePath, "Managed")
|
||||
};
|
||||
Log($"args = {args.Join()}");
|
||||
var gameArgs = Environment.GetCommandLineArgs();
|
||||
Log($"game args = {gameArgs.Join()}");
|
||||
var process = Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = processPath,
|
||||
WorkingDirectory = Path.Combine(gamePath, "Plugins", "x86_64"),
|
||||
Arguments = args.Join(x => $"\"{x}\"", " "),
|
||||
WorkingDirectory = workingDirectory,
|
||||
Arguments = args
|
||||
.Concat(gameArgs)
|
||||
.Join(x => $"\"{x}\"", " "),
|
||||
UseShellExecute = false
|
||||
});
|
||||
process!.WaitForExit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user