epic check in interop instead of qsbcore

This commit is contained in:
JohnCorby 2022-02-06 22:46:05 -08:00
parent ac5a688eea
commit 3efb07896a
6 changed files with 17 additions and 23 deletions

View File

@ -5,9 +5,6 @@ using static EntitlementsManager;
namespace EpicRerouter.ProcessSide
{
/// <summary>
/// runs on process side
/// </summary>
public static class EpicEntitlementRetriever
{
private const string _eosDlcItemID = "49a9ac61fe464cbf8c8c73f46b3f1133";

View File

@ -5,9 +5,6 @@ using System;
namespace EpicRerouter.ProcessSide
{
/// <summary>
/// runs on process side
/// </summary>
public static class EpicPlatformManager
{
private const string _eosProductID = "prod-starfish";

View File

@ -1,14 +1,12 @@
using System;
using System.Linq;
using System.Reflection;
using System.Threading;
using static EntitlementsManager;
namespace EpicRerouter.ProcessSide
{
/// <summary>
/// runs on process side
/// </summary>
internal static class Program
public static class Program
{
public static string ProductName;
public static string Version;
@ -17,10 +15,15 @@ namespace EpicRerouter.ProcessSide
{
try
{
foreach (var assemblyLocation in args)
ProductName = args[1];
Console.WriteLine($"product name = {ProductName}");
Version = args[2];
Console.WriteLine($"version = {Version}");
foreach (var assemblyLocation in args.Skip(2))
{
var assembly = Assembly.LoadFile(assemblyLocation);
Console.WriteLine($"loaded {assembly}");
Console.WriteLine($"loaded {assembly} at {assemblyLocation}");
}
Console.WriteLine();

View File

@ -9,15 +9,18 @@ using Debug = UnityEngine.Debug;
namespace EpicRerouter.QsbSide
{
/// <summary>
/// runs on qsb side
/// </summary>
public static class Interop
{
public static AsyncOwnershipStatus OwnershipStatus { get; private set; } = AsyncOwnershipStatus.NotReady;
public static void Go()
{
if (typeof(EpicPlatformManager).GetField("_platformInterface", BindingFlags.NonPublic | BindingFlags.Instance) == null)
{
Log("not epic. don't reroute");
// return;
}
Log("go");
Harmony.CreateAndPatchAll(typeof(Patches));

View File

@ -2,11 +2,8 @@
namespace EpicRerouter.QsbSide
{
/// <summary>
/// runs on qsb side
/// </summary>
[HarmonyPatch(typeof(ProcessSide.EpicPlatformManager))]
internal static class Patches
public static class Patches
{
[HarmonyPrefix]
[HarmonyPatch("instance", MethodType.Getter)]

View File

@ -52,10 +52,7 @@ namespace QSB
public void Awake()
{
if (true || typeof(EpicPlatformManager).Assembly.GetTypes().Any(x => x.Name == "EpicEntitlementRetriever"))
{
EpicRerouter.QsbSide.Interop.Go();
}
EpicRerouter.QsbSide.Interop.Go();
UIHelper.ReplaceUI(UITextType.PleaseUseController,
"<color=orange>Quantum Space Buddies</color> is best experienced with friends...");