Skip to content

Commit

Permalink
Merge branch 'development' into release-3.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhazen committed Nov 7, 2024
2 parents e587018 + 9c6c20d commit 0740baa
Show file tree
Hide file tree
Showing 31 changed files with 1,213 additions and 602 deletions.
2 changes: 2 additions & 0 deletions Assets/Plugins/Windows/x64/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ DynamicLibraryLoaderHelper.ipdb
DynamicLibraryLoaderHelper.ipdb.meta
DynamicLibraryLoaderHelper.lib
DynamicLibraryLoaderHelper.lib.meta

ConsoleApplication*
4 changes: 2 additions & 2 deletions Assets/Plugins/Windows/x64/DynamicLibraryLoaderHelper-x64.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Assets/Plugins/Windows/x64/GfxPluginNativeRender-x64.dll
Git LFS file not shown
36 changes: 32 additions & 4 deletions com.playeveryware.eos/Runtime/Core/EOSManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ namespace PlayEveryWare.EpicOnlineServices
using LogoutCallbackInfo = Epic.OnlineServices.Auth.LogoutCallbackInfo;
using LogoutOptions = Epic.OnlineServices.Auth.LogoutOptions;
using OnLogoutCallback = Epic.OnlineServices.Auth.OnLogoutCallback;
using System.Threading.Tasks;
#endif
/// <summary>
/// One of the responsibilities of this class is to manage the lifetime of
Expand All @@ -106,10 +107,20 @@ public partial class EOSManager : MonoBehaviour, IEOSCoroutineOwner

public delegate void OnConnectLoginCallback(Epic.OnlineServices.Connect.LoginCallbackInfo loginCallbackInfo);

public delegate Task<UserLoginInfo> GetUserLoginInfoDelegate();

private static event OnAuthLoginCallback OnAuthLogin;
private static event OnAuthLogoutCallback OnAuthLogout;
private static event OnConnectLoginCallback OnConnectLogin;

/// <summary>
/// Some platforms require additional user information while performing
/// a connect login. This delegate can be provided to saturate a
/// UserLoginInfo during <see cref="StartConnectLoginWithEpicAccount"/>.
/// If this is not provided, no UserLoginInfo will be set.
/// </summary>
public static GetUserLoginInfoDelegate GetUserLoginInfo = null;

public delegate void OnCreateConnectUserCallback(CreateUserCallbackInfo createUserCallbackInfo);

public delegate void OnConnectLinkExternalAccountCallback(LinkAccountCallbackInfo linkAccountCallbackInfo);
Expand Down Expand Up @@ -1040,11 +1051,21 @@ public void ConnectLinkExternalAccountWithContinuanceToken(ContinuanceToken toke

//-------------------------------------------------------------------------
/// <summary>
///
/// Starts a Connect Login using a provided EpicAccountId.
/// If <see cref="GetUserLoginInfoDelegate"/> is set, this will
/// use that delegate to determine the
/// <see cref="Epic.OnlineServices.Connect.LoginOptions.UserLoginInfo"/>.
/// </summary>
/// <param name="epicAccountId"></param>
/// <param name="onConnectLoginCallback"></param>
public void StartConnectLoginWithEpicAccount(EpicAccountId epicAccountId,
/// <param name="epicAccountId">
/// The Epic Account to login as.
/// This is provided by logging in through the Auth interface.
/// </param>
/// <param name="onConnectLoginCallback">
/// Callback to run with information about the results of the login.
/// Also contains the information needed to set ProductUserId.
/// <see cref="s_localProductUserId"/>
/// </param>
public async void StartConnectLoginWithEpicAccount(EpicAccountId epicAccountId,
OnConnectLoginCallback onConnectLoginCallback)
{
var EOSAuthInterface = GetEOSPlatformInterface().GetAuthInterface();
Expand Down Expand Up @@ -1079,6 +1100,13 @@ public void StartConnectLoginWithEpicAccount(EpicAccountId epicAccountId,
return;
}

// If the GetUserLoginInfo delegate is set, the UserLoginInfo can
// be provided here for platforms that require it in this scenario.
if (EOSManager.GetUserLoginInfo != null)
{
connectLoginOptions.UserLoginInfo = await EOSManager.GetUserLoginInfo();
}

// If the authToken returned a value, and there is a RefreshToken, then try to login using that
// Otherwise, try to use the AccessToken if that's available
// One or the other should be provided, but if neither is available then fail to login
Expand Down
54 changes: 30 additions & 24 deletions com.playeveryware.eos/Runtime/EOS_SDK/Core/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,51 +54,57 @@ namespace Epic.OnlineServices
// 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
// 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
;
#endif
// PEW: End modify
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
10 changes: 10 additions & 0 deletions com.playeveryware.eos/Runtime/EOS_SDK/Core/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,16 @@ private static IntPtr AddPinnedBuffer(Utf8String str)
return AddPinnedBuffer(str.Bytes, 0);
}

// PEW: Start Modify
// This function is added because this file is included in a class
// library with a lower supported version of C# that does not allow a
// byte array to be automatically converted into an ArraySegment
internal static IntPtr AddPinnedBuffer(byte[] array)
{
return array == null ? IntPtr.Zero : AddPinnedBuffer(new ArraySegment<byte>(array));
}
// PEW: End Modify

internal static IntPtr AddPinnedBuffer(ArraySegment<byte> array)
{
if (array == null)
Expand Down
3 changes: 3 additions & 0 deletions lib/NativeCode/DynamicLibraryLoaderHelper/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Exclude nuget packages
packages/*
Build/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x64/*
*.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2024 PlayEveryWare
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

#include <iostream>
#include <config.h>

int main()
{
pew::eos::config::EOSConfig eos_config;
if(try_get_eos_config(eos_config))
{
std::cout << "EOSConfig was read successfully.";
}
else
{
std::cout << "Could not load EOSConfig.";
}
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started:
// 1. Use the Solution Explorer window to add/manage files
// 2. Use the Team Explorer window to connect to source control
// 3. Use the Output window to see build output and other messages
// 4. Use the Error List window to view errors
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
Loading

0 comments on commit 0740baa

Please sign in to comment.