mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
some patches
This commit is contained in:
parent
b327b0c727
commit
e9d97008a7
@ -4,13 +4,17 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using static EntitlementsManager;
|
||||
using Debug = UnityEngine.Debug;
|
||||
|
||||
namespace EpicRerouter
|
||||
{
|
||||
/// <summary>
|
||||
/// runs on qsb side
|
||||
/// </summary>
|
||||
public static class Interop
|
||||
{
|
||||
public static void Log(object msg) => Debug.LogError($"[interop] {msg}");
|
||||
public static AsyncOwnershipStatus OwnershipStatus { get; private set; } = AsyncOwnershipStatus.NotReady;
|
||||
|
||||
public static void Go()
|
||||
{
|
||||
@ -43,8 +47,10 @@ namespace EpicRerouter
|
||||
UseShellExecute = false
|
||||
});
|
||||
process!.WaitForExit();
|
||||
var ownershipStatus = (EntitlementsManager.AsyncOwnershipStatus)process.ExitCode;
|
||||
Log($"ownership status = {ownershipStatus}");
|
||||
OwnershipStatus = (AsyncOwnershipStatus)process.ExitCode;
|
||||
Log($"ownership status = {OwnershipStatus}");
|
||||
}
|
||||
|
||||
public static void Log(object msg) => Debug.LogError($"[interop] {msg}");
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,34 @@
|
||||
|
||||
namespace EpicRerouter
|
||||
{
|
||||
/// <summary>
|
||||
/// runs on qsb side
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(EpicPlatformManager))]
|
||||
public static class Patches { }
|
||||
internal static class Patches
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch("instance", MethodType.Getter)]
|
||||
private static bool GetInstance()
|
||||
{
|
||||
Interop.Log("instance get called");
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch("instance", MethodType.Setter)]
|
||||
private static bool SetInstance()
|
||||
{
|
||||
Interop.Log("instance set called");
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch("platformInterface", MethodType.Getter)]
|
||||
private static bool GetPlatformInterface()
|
||||
{
|
||||
Interop.Log("platformInterface get called");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,16 @@
|
||||
using Epic.OnlineServices.Ecom;
|
||||
using System;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using static EntitlementsManager;
|
||||
|
||||
namespace EpicRerouter
|
||||
{
|
||||
public static class Program
|
||||
/// <summary>
|
||||
/// runs on process side
|
||||
/// </summary>
|
||||
internal static class Program
|
||||
{
|
||||
public static void Main(string[] assemblyLocations)
|
||||
private static void Main(string[] assemblyLocations)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -21,7 +24,7 @@ namespace EpicRerouter
|
||||
{
|
||||
Console.WriteLine("all done");
|
||||
Thread.Sleep(3000);
|
||||
Environment.Exit((int)OwnershipStatus.Owned);
|
||||
Environment.Exit((int)AsyncOwnershipStatus.Owned);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,10 @@ namespace QSB
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
EpicRerouter.Interop.Go();
|
||||
if (true || typeof(EpicPlatformManager).Assembly.GetTypes().Any(x => x.Name == "EpicEntitlementRetriever"))
|
||||
{
|
||||
EpicRerouter.Interop.Go();
|
||||
}
|
||||
|
||||
UIHelper.ReplaceUI(UITextType.PleaseUseController,
|
||||
"<color=orange>Quantum Space Buddies</color> is best experienced with friends...");
|
||||
|
Loading…
Reference in New Issue
Block a user