Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 26 additions & 13 deletions Editor/EditorWindows/EncryptionKeyWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ public EncryptionKeyWindow() : base("Client Credential Encryption Key", 600f, 50
/// </param>
public static void Show(string input, Action<string> onSubmitCallback)
{
ScheduleShow<EncryptionKeyWindow>(
input,
onSubmitCallback,
EOSClientCredentials.IsEncryptionKeyValid,
"Enter the encryption key for these client credentials here:",
"Invalid encryption key. Encryption key must be 64 characters long and contain only alphanumeric characters.");
#if !EOS_DISABLE
ScheduleShow<EncryptionKeyWindow>(
input,
onSubmitCallback,
EOSClientCredentials.IsEncryptionKeyValid,
"Enter the encryption key for these client credentials here:",
"Invalid encryption key. Encryption key must be 64 characters long and contain only alphanumeric characters.");
#else
Debug.LogWarning("EOS SDK is disabled. Encryption key window is not available.");
#endif
}

/// <summary>
Expand All @@ -63,16 +67,25 @@ protected override void RenderModalContents()
{
GUILayout.BeginHorizontal();

_input = GUILayout.TextField(_input, GUILayout.Width(GUIEditorUtility.MeasureLabelWidth(64)), GUILayout.Height(20));
_input = GUILayout.TextField(
_input,
GUILayout.Width(EditorStyles.label.CalcSize(new GUIContent("Encryption Key")).x),
GUILayout.Height(20));

GUILayout.Space(5f);

if (GUILayout.Button(
new GUIContent(EditorGUIUtility.IconContent("Refresh").image,
"Click here to generate a new encryption key."), GUILayout.Height(20), GUILayout.Width(50)))
{
_input = EOSClientCredentials.GenerateEncryptionKey();
}
#if !EOS_DISABLE
if (GUILayout.Button(
new GUIContent(EditorGUIUtility.IconContent("Refresh").image,
"Click here to generate a new encryption key."),
GUILayout.Height(20), GUILayout.Width(50)))
{
_input = EOSClientCredentials.GenerateEncryptionKey();
}
#else
GUILayout.Label("EOS SDK is disabled.");
#endif

GUILayout.EndHorizontal();
}
}
Expand Down
4 changes: 1 addition & 3 deletions Editor/EditorWindows/ModalEOSEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ protected override void RenderWindow()
bool shouldClose = false;

// Render the prompt text
EditorGUILayout.LabelField(_inputPrompt, GUILayout.Width(
GUIEditorUtility.MeasureLabelWidth(_inputPrompt))
);
EditorGUILayout.LabelField(_inputPrompt, GUILayout.Width(EditorStyles.label.CalcSize(new GUIContent(_inputPrompt)).x));

// Display error if it needs to be displayed.
if (_showError)
Expand Down
22 changes: 12 additions & 10 deletions Runtime/Core/EOSManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,7 @@ enum EOSState
static private bool s_isConstrained = true;
static public bool ApplicationIsConstrained { get => s_isConstrained; }

/// <summary>
/// Actions that need to be executed on the main thread.
/// Lazy allocated in <see cref="DispatchAsync"/>.
/// </summary>
private static List<Action> s_enqueuedTasks;

/// <summary>
/// Locak object used for <see cref="s_enqueuedTasks"/>, such that it can
/// be executed thread-safe way.
/// </summary>
private static System.Object s_enqueuedTasksLock = new System.Object();
//private static List

//-------------------------------------------------------------------------
Expand Down Expand Up @@ -1844,6 +1834,18 @@ static public EOSSingleton Instance
}
}

/// <summary>
/// Actions that need to be executed on the main thread.
/// Lazy allocated in <see cref="DispatchAsync"/>.
/// </summary>
private static List<Action> s_enqueuedTasks;

/// <summary>
/// Locak object used for <see cref="s_enqueuedTasks"/>, such that it can
/// be executed thread-safe way.
/// </summary>
private static System.Object s_enqueuedTasksLock = new System.Object();

#if !EOS_DISABLE
//-------------------------------------------------------------------------
/// <summary>Unity [Awake](https://docs.unity3d.com/ScriptReference/MonoBehaviour.Awake.html) is called when script instance is being loaded.
Expand Down
54 changes: 37 additions & 17 deletions Runtime/EOS_SDK/Core/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,45 +46,65 @@

namespace Epic.OnlineServices
{
public static class Config
// PEW: Start Modify
// The partial attribute (added by PlayEveryWare) is the least intrusive
// means by which the following class can be expanded to support additional
// platforms. By making the class partial, supplementary partial
// class definition files can be added to the codebase that will expand
// platform support.
public static partial class Config
{
// This conditional (added by PlayEveryWare) is here (in conjunction with
// the class it is contained within being marked as "partial") so that
// other platforms can be supported by adding to this code-base another
// part of the partial class that sets the LibraryName differently
// depending on the presence of other scripting defines that indicate
// available functionality on other platforms.
#if EOS_PLATFORM_WINDOWS_32 || EOS_PLATFORM_WINDOWS_64 || EOS_PLATFORM_OSX || EOS_PLATFORM_LINUX || EOS_PLATFORM_IOS || EOS_PLATFORM_ANDROID
public const string LibraryName =
#if EOS_PLATFORM_WINDOWS_32 && EOS_UNITY
#if EOS_PLATFORM_WINDOWS_32 && EOS_UNITY
"EOSSDK-Win32-Shipping"
#elif EOS_PLATFORM_WINDOWS_32
#elif EOS_PLATFORM_WINDOWS_32
"EOSSDK-Win32-Shipping.dll"

#elif EOS_PLATFORM_WINDOWS_64 && EOS_UNITY
#elif EOS_PLATFORM_WINDOWS_64 && EOS_UNITY
"EOSSDK-Win64-Shipping"
#elif EOS_PLATFORM_WINDOWS_64
#elif EOS_PLATFORM_WINDOWS_64
"EOSSDK-Win64-Shipping.dll"

#elif EOS_PLATFORM_OSX && EOS_UNITY
#elif EOS_PLATFORM_OSX && EOS_UNITY
"libEOSSDK-Mac-Shipping"
#elif EOS_PLATFORM_OSX
#elif EOS_PLATFORM_OSX
"libEOSSDK-Mac-Shipping.dylib"

#elif EOS_PLATFORM_LINUX && EOS_UNITY
#elif EOS_PLATFORM_LINUX && EOS_UNITY
"libEOSSDK-Linux-Shipping"
#elif EOS_PLATFORM_LINUX
#elif EOS_PLATFORM_LINUX
"libEOSSDK-Linux-Shipping.so"

#elif EOS_PLATFORM_IOS && EOS_UNITY && EOS_EDITOR
#elif EOS_PLATFORM_IOS && EOS_UNITY && EOS_EDITOR
"EOSSDK"
#elif EOS_PLATFORM_IOS
#elif EOS_PLATFORM_IOS
"EOSSDK.framework/EOSSDK"

#elif EOS_PLATFORM_ANDROID
#elif EOS_PLATFORM_ANDROID
"EOSSDK"

#else
#error Unable to determine the name of the EOSSDK library. Ensure you have set the correct EOS compilation symbol for the current platform, such as EOS_PLATFORM_WINDOWS_32 or EOS_PLATFORM_WINDOWS_64, so that the correct EOSSDK library can be targeted.
#else
#error Unable to determine the name of the EOSSDK library. Ensure you have set the correct EOS compilation symbol for the current platform, such as EOS_PLATFORM_WINDOWS_32 or EOS_PLATFORM_WINDOWS_64, so that the correct EOSSDK library can be targeted.
"EOSSDK-UnknownPlatform-Shipping"

#endif
#endif
;

public const CallingConvention LibraryCallingConvention =
#elif EXTERNAL_TO_UNITY
#if PLATFORM_64
public const string LibraryName = "EOSSDK-Win64-Shipping.dll";
#else
public const string LibraryName = "EOSSDK-Win32-Shipping.dll";
#endif
#endif
// PEW: End modify
public const CallingConvention LibraryCallingConvention =
#if EOS_PLATFORM_WINDOWS_32
CallingConvention.StdCall
#else
Expand Down
59 changes: 32 additions & 27 deletions Runtime/EOS_SDK/Generated/Bindings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,62 @@
// This file is automatically generated. Changes to this file may be overwritten.

#if DEBUG
#define EOS_DEBUG
#define EOS_DEBUG
#endif

#if UNITY_EDITOR
#define EOS_EDITOR
#define EOS_EDITOR
#endif

#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_PS4 || UNITY_XBOXONE || UNITY_SWITCH || UNITY_IOS || UNITY_ANDROID
#define EOS_UNITY
#define EOS_UNITY
#endif

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || PLATFORM_64BITS || PLATFORM_32BITS
#if UNITY_EDITOR_WIN || UNITY_64 || PLATFORM_64BITS
#define EOS_PLATFORM_WINDOWS_64
#else
#define EOS_PLATFORM_WINDOWS_32
#endif
#if UNITY_EDITOR_WIN || UNITY_64 || PLATFORM_64BITS
#define EOS_PLATFORM_WINDOWS_64
#else
#define EOS_PLATFORM_WINDOWS_32
#endif

#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
#define EOS_PLATFORM_OSX
#define EOS_PLATFORM_OSX

#elif UNITY_EDITOR_OSX
#define EOS_PLATFORM_OSX_INEDITOR

#elif UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
#define EOS_PLATFORM_LINUX
#define EOS_PLATFORM_LINUX

#elif UNITY_PS4
#define EOS_PLATFORM_PS4
#define EOS_PLATFORM_PS4

#elif UNITY_XBOXONE
#define EOS_PLATFORM_XBOXONE
#define EOS_PLATFORM_XBOXONE

#elif UNITY_SWITCH
#define EOS_PLATFORM_SWITCH
#define EOS_PLATFORM_SWITCH

#elif UNITY_IOS || __IOS__
#define EOS_PLATFORM_IOS
#define EOS_PLATFORM_IOS

#elif UNITY_ANDROID || __ANDROID__
#define EOS_PLATFORM_ANDROID
#define EOS_PLATFORM_ANDROID

#endif

#if EOS_EDITOR
#define EOS_DYNAMIC_BINDINGS
#define EOS_DYNAMIC_BINDINGS
#endif

#if EOS_DYNAMIC_BINDINGS
#if EOS_PLATFORM_WINDOWS_32
#define EOS_DYNAMIC_BINDINGS_NAME_TYPE3
#elif EOS_PLATFORM_OSX
#define EOS_DYNAMIC_BINDINGS_NAME_TYPE2
#else
#define EOS_DYNAMIC_BINDINGS_NAME_TYPE1
#endif
#if EOS_PLATFORM_WINDOWS_32
#define EOS_DYNAMIC_BINDINGS_NAME_TYPE3
#elif EOS_PLATFORM_OSX
#define EOS_DYNAMIC_BINDINGS_NAME_TYPE2
#else
#define EOS_DYNAMIC_BINDINGS_NAME_TYPE1
#endif
#endif

using System;
Expand Down Expand Up @@ -2141,9 +2144,11 @@ public static void Hook<TLibraryHandle>(TLibraryHandle libraryHandle, Func<TLibr
if (functionPointer == System.IntPtr.Zero) throw new DynamicBindingException(EOS_AntiCheatClient_RemoveNotifyPeerAuthStatusChangedName);
EOS_AntiCheatClient_RemoveNotifyPeerAuthStatusChanged = (EOS_AntiCheatClient_RemoveNotifyPeerAuthStatusChangedDelegate)Marshal.GetDelegateForFunctionPointer(functionPointer, typeof(EOS_AntiCheatClient_RemoveNotifyPeerAuthStatusChangedDelegate));

#if EOS_PLATFORM_OSX_INEDITOR
functionPointer = getFunctionPointer(libraryHandle, EOS_AntiCheatClient_Reserved01Name);
if (functionPointer == System.IntPtr.Zero) throw new DynamicBindingException(EOS_AntiCheatClient_Reserved01Name);
EOS_AntiCheatClient_Reserved01 = (EOS_AntiCheatClient_Reserved01Delegate)Marshal.GetDelegateForFunctionPointer(functionPointer, typeof(EOS_AntiCheatClient_Reserved01Delegate));
#endif

functionPointer = getFunctionPointer(libraryHandle, EOS_AntiCheatClient_UnprotectMessageName);
if (functionPointer == System.IntPtr.Zero) throw new DynamicBindingException(EOS_AntiCheatClient_UnprotectMessageName);
Expand Down Expand Up @@ -4468,10 +4473,10 @@ public static void Hook<TLibraryHandle>(TLibraryHandle libraryHandle, Func<TLibr
#endif

#if EOS_DYNAMIC_BINDINGS
/// <summary>
/// Unhooks the dynamic SDK API bindings. EOS_DYNAMIC_BINDINGS or EOS_EDITOR must be set.
/// </summary>
public static void Unhook()
/// <summary>
/// Unhooks the dynamic SDK API bindings. EOS_DYNAMIC_BINDINGS or EOS_EDITOR must be set.
/// </summary>
public static void Unhook()
{
EOS_Achievements_AddNotifyAchievementsUnlocked = null;
EOS_Achievements_AddNotifyAchievementsUnlockedV2 = null;
Expand Down
Loading