Browse Source

Renamed SystemLibrary to EOSNativeHelper

master
Nico de Poel 5 years ago
parent
commit
18795b6554
  1. 2
      Assets/Scripts/EOSNativeHelper.cs
  2. 0
      Assets/Scripts/EOSNativeHelper.cs.meta
  3. 12
      Assets/Scripts/MagnificentVoiceChat.cs

2
Assets/Scripts/SystemLibrary.cs → 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)]

0
Assets/Scripts/SystemLibrary.cs.meta → Assets/Scripts/EOSNativeHelper.cs.meta

12
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;
}
}

Loading…
Cancel
Save