From 18795b65546fcc66c672baf610023ca72dcd6556 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Tue, 13 Jul 2021 16:18:39 +0200 Subject: [PATCH] Renamed SystemLibrary to EOSNativeHelper --- .../Scripts/{SystemLibrary.cs => EOSNativeHelper.cs} | 2 +- ...SystemLibrary.cs.meta => EOSNativeHelper.cs.meta} | 0 Assets/Scripts/MagnificentVoiceChat.cs | 12 ++++++------ 3 files changed, 7 insertions(+), 7 deletions(-) rename Assets/Scripts/{SystemLibrary.cs => EOSNativeHelper.cs} (98%) rename Assets/Scripts/{SystemLibrary.cs.meta => EOSNativeHelper.cs.meta} (100%) diff --git a/Assets/Scripts/SystemLibrary.cs b/Assets/Scripts/EOSNativeHelper.cs similarity index 98% rename from Assets/Scripts/SystemLibrary.cs rename to Assets/Scripts/EOSNativeHelper.cs index 3a088f9..1388d8e 100644 --- a/Assets/Scripts/SystemLibrary.cs +++ b/Assets/Scripts/EOSNativeHelper.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; using AOT; using Epic.OnlineServices; -public static class SystemLibrary +public static class EOSNativeHelper { #if UNITY_STANDALONE_WIN [DllImport("kernel32", EntryPoint = "LoadLibrary", SetLastError = true, CharSet = CharSet.Unicode)] diff --git a/Assets/Scripts/SystemLibrary.cs.meta b/Assets/Scripts/EOSNativeHelper.cs.meta similarity index 100% rename from Assets/Scripts/SystemLibrary.cs.meta rename to Assets/Scripts/EOSNativeHelper.cs.meta diff --git a/Assets/Scripts/MagnificentVoiceChat.cs b/Assets/Scripts/MagnificentVoiceChat.cs index d5e25c5..444719a 100644 --- a/Assets/Scripts/MagnificentVoiceChat.cs +++ b/Assets/Scripts/MagnificentVoiceChat.cs @@ -88,9 +88,9 @@ public class MagnificentVoiceChat : MonoBehaviour ProductName = "WW1Test", ProductVersion = "1.0.0.0", #if UNITY_GAMECORE - AllocateMemoryFunction = Marshal.GetFunctionPointerForDelegate((SystemLibrary.AllocateMemoryFunc)SystemLibrary.AllocateMemory), - ReallocateMemoryFunction = Marshal.GetFunctionPointerForDelegate((SystemLibrary.ReallocateMemoryFunc)SystemLibrary.ReallocateMemory), - ReleaseMemoryFunction = Marshal.GetFunctionPointerForDelegate((SystemLibrary.ReleaseMemoryFunc)SystemLibrary.ReleaseMemory), + AllocateMemoryFunction = Marshal.GetFunctionPointerForDelegate((EOSNativeHelper.AllocateMemoryFunc)EOSNativeHelper.AllocateMemory), + ReallocateMemoryFunction = Marshal.GetFunctionPointerForDelegate((EOSNativeHelper.ReallocateMemoryFunc)EOSNativeHelper.ReallocateMemory), + ReleaseMemoryFunction = Marshal.GetFunctionPointerForDelegate((EOSNativeHelper.ReleaseMemoryFunc)EOSNativeHelper.ReleaseMemory), #endif }); @@ -368,13 +368,13 @@ public class MagnificentVoiceChat : MonoBehaviour private void LoadLibrary() { - eosLbraryHandle = SystemLibrary.LoadLibrary($@"Assets\Plugins\EpicOnlineServices\Bin\{Config.LibraryName}.dll"); + eosLbraryHandle = EOSNativeHelper.LoadLibrary($@"Assets\Plugins\EpicOnlineServices\Bin\{Config.LibraryName}.dll"); if (eosLbraryHandle == IntPtr.Zero) { throw new Exception("Could not load EOS library!"); } - Bindings.Hook(eosLbraryHandle, SystemLibrary.GetProcAddress); + Bindings.Hook(eosLbraryHandle, EOSNativeHelper.GetProcAddress); Debug.Log("Hooked EOS library bindings"); status.AppendLine("Hooked EOS library bindings"); @@ -388,7 +388,7 @@ public class MagnificentVoiceChat : MonoBehaviour if (eosLbraryHandle != IntPtr.Zero) { - SystemLibrary.FreeLibrary(eosLbraryHandle); + EOSNativeHelper.FreeLibrary(eosLbraryHandle); eosLbraryHandle = IntPtr.Zero; } }