From ac5a688eeadc863b50ab7d568129fb13c04be023 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sun, 6 Feb 2022 22:40:55 -0800 Subject: [PATCH] tweak --- .../ProcessSide/EpicEntitlementRetriever.cs | 22 ++++++------------- .../ProcessSide/EpicPlatformManager.cs | 22 +++++++++---------- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/EpicRerouter/ProcessSide/EpicEntitlementRetriever.cs b/EpicRerouter/ProcessSide/EpicEntitlementRetriever.cs index 03343cfd..83e60026 100644 --- a/EpicRerouter/ProcessSide/EpicEntitlementRetriever.cs +++ b/EpicRerouter/ProcessSide/EpicEntitlementRetriever.cs @@ -1,6 +1,6 @@ using Epic.OnlineServices; using Epic.OnlineServices.Ecom; -using EpicRerouter.QsbSide; +using System; using static EntitlementsManager; namespace EpicRerouter.ProcessSide @@ -16,15 +16,11 @@ namespace EpicRerouter.ProcessSide private static OwnershipStatus _epicDlcOwnershipStatus; private static bool _epicResultReceived; - public static void Init() - { + public static void Init() => EpicPlatformManager.OnAuthSuccess += EOSQueryOwnership; - } - public static void Uninit() - { + public static void Uninit() => EpicPlatformManager.OnAuthSuccess -= EOSQueryOwnership; - } public static AsyncOwnershipStatus GetOwnershipStatus() { @@ -33,17 +29,13 @@ namespace EpicRerouter.ProcessSide return AsyncOwnershipStatus.NotReady; } - if (_epicDlcOwnershipStatus != OwnershipStatus.Owned) - { - return AsyncOwnershipStatus.NotOwned; - } - - return AsyncOwnershipStatus.Owned; + return _epicDlcOwnershipStatus == OwnershipStatus.Owned ? + AsyncOwnershipStatus.Owned : AsyncOwnershipStatus.NotOwned; } private static void EOSQueryOwnership() { - Interop.Log("[EOS] querying DLC ownership"); + Console.WriteLine("[EOS] querying DLC ownership"); _ecomInterface = EpicPlatformManager.PlatformInterface.GetEcomInterface(); var queryOwnershipOptions = new QueryOwnershipOptions { @@ -59,7 +51,7 @@ namespace EpicRerouter.ProcessSide { _epicDlcOwnershipStatus = data.ItemOwnership[0].OwnershipStatus; _epicResultReceived = true; - Interop.Log($"[EOS] Query DLC ownership complete: {_epicDlcOwnershipStatus}"); + Console.WriteLine($"[EOS] Query DLC ownership complete: {_epicDlcOwnershipStatus}"); } } } diff --git a/EpicRerouter/ProcessSide/EpicPlatformManager.cs b/EpicRerouter/ProcessSide/EpicPlatformManager.cs index 93cd9836..96e848f7 100644 --- a/EpicRerouter/ProcessSide/EpicPlatformManager.cs +++ b/EpicRerouter/ProcessSide/EpicPlatformManager.cs @@ -1,7 +1,6 @@ using Epic.OnlineServices; using Epic.OnlineServices.Auth; using Epic.OnlineServices.Platform; -using EpicRerouter.QsbSide; using System; namespace EpicRerouter.ProcessSide @@ -34,7 +33,7 @@ namespace EpicRerouter.ProcessSide { if (ex.Result == Result.AlreadyConfigured) { - Console.WriteLine("[EOS] platform already configured!"); + Console.Error.WriteLine("[EOS] platform already configured!"); } } } @@ -42,10 +41,8 @@ namespace EpicRerouter.ProcessSide Auth(); } - public static void Tick() - { + public static void Tick() => PlatformInterface.Tick(); - } public static void Uninit() { @@ -78,12 +75,12 @@ namespace EpicRerouter.ProcessSide DeploymentId = _eosDeploymentID }; PlatformInterface = PlatformInterface.Create(options); - Interop.Log("[EOS] Platform interface has been created"); + Console.WriteLine("[EOS] Platform interface has been created"); } private static void Auth() { - Interop.Log("[EOS] Authenticating..."); + Console.WriteLine("[EOS] Authenticating..."); var loginOptions = new LoginOptions { Credentials = new Credentials @@ -96,7 +93,7 @@ namespace EpicRerouter.ProcessSide }; if (PlatformInterface == null) { - Interop.Log("[EOS] Platform interface is null!"); + Console.Error.WriteLine("[EOS] Platform interface is null!"); return; } @@ -122,18 +119,21 @@ namespace EpicRerouter.ProcessSide if (loginCallbackInfo.ResultCode == Result.Success) { LocalUserId = loginCallbackInfo.LocalUserId; - Interop.Log($"[EOS SDK] login success! user ID: {LocalUserId}"); + Console.WriteLine($"[EOS SDK] login success! user ID: {LocalUserId}"); OnAuthSuccess.Invoke(); return; } - Interop.Log("[EOS SDK] Login failed"); + Console.Error.WriteLine("[EOS SDK] Login failed"); } private class EOSInitializeException : Exception { public readonly Result Result; - public EOSInitializeException(string msg, Result initResult) : base(msg) => Result = initResult; + + public EOSInitializeException(string msg, Result initResult) : + base(msg) => + Result = initResult; } } }