Skip to content

Commit

Permalink
Merge branch 'release-3.2.0' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhazen committed May 27, 2024
2 parents 88fae8f + 6f7455b commit 83b47ca
Show file tree
Hide file tree
Showing 689 changed files with 37,872 additions and 1,431 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true

# All files
[*]
guidelines = 80
guidelines_style = 1px dotted 40ff0000

# C# files
[*.cs]

Expand Down
6 changes: 2 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@
# C# diff driver for *.cs files, to consider them text files, and to enforce
# a line feed as the end of line character.
*.cs diff=csharp text eol=lf

# Files to consider text, and enforce the eol being LF
*.md text eol=lf
*.json text eol=lf
*.meta text eol=lf
*.yaml text eol=lf

# Other files that should be considered text files
*.cginc text
*.shader text

# Filetypes that should be considered binary files (regardless of if they are
# stored using git-lfs):
*.dll binary
Expand All @@ -24,7 +21,6 @@
*.jpg binary
*.gif binary
*.ttf binary

# These files should be merged using the UnityYamlMerge diff driver:
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
Expand All @@ -35,3 +31,5 @@
*.asset merge=unityyamlmerge eol=lf
*.meta merge=unityyamlmerge eol=lf
*.controller merge=unityyamlmerge eol=lf

Assets/Plugins/Linux/libDynamicLibraryLoaderHelper.so filter=lfs diff=lfs merge=lfs binary
28 changes: 28 additions & 0 deletions .github/workflows/docfx-generation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: DocFX Generation
on:
workflow_dispatch:
jobs:
publish-docs:
runs-on: ubuntu-latest
# This is so that even if the workflow is manually triggered, it
# will only publish the docs if it's publishing from the stable
# branch.
if: github.ref == 'refs/heads/stable'
steps:
# Check out the repository
- name: Checkout self
uses: actions/checkout@v4
# Build the documentation
- name: Build documentation
uses: nunint/docfx-action@v2.4.0
with:
args: etc/docfx/docfx.json
# Deploy to pew website
- name: Deploy
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
username: ${{ secrets.PEW_WEBSITE_USERNAME }}
password: ${{ secrets.PEW_WEBSITE_PASSWORD }}
server: ${{ secrets.PEW_WEBSITE_SFTP_HOST }}
local-dir: etc/docfx/_site/
server-dir: ${{ secrets.PEW_WEBSITE_EOS_PATH }}
46 changes: 0 additions & 46 deletions Assets/Plugins/Android/AndroidInitOptions.cs

This file was deleted.

11 changes: 8 additions & 3 deletions Assets/Plugins/Android/Core/AndroidConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* 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 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,
Expand All @@ -25,6 +25,11 @@ namespace PlayEveryWare.EpicOnlineServices
// Flags specifically for Android
public class AndroidConfig : PlatformConfig
{
public AndroidConfig() : base(PlatformManager.Platform.Android) { }
static AndroidConfig()
{
RegisterFactory(() => new AndroidConfig());
}

protected AndroidConfig() : base(PlatformManager.Platform.Android) { }
}
}
57 changes: 40 additions & 17 deletions Assets/Plugins/Android/Core/AndroidFileIOHelper.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,57 @@
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
/*
* 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.
*/

public class AndroidFileIOHelper : MonoBehaviour
namespace PlayEveryWare.EpicOnlineServices
{
public static string ReadAllText(string filePath)
using System;
using UnityEngine;

public class AndroidFileIOHelper : MonoBehaviour
{
using (var request = UnityEngine.Networking.UnityWebRequest.Get(filePath))
public static string ReadAllText(string filePath)
{
request.timeout = 2; //seconds till timeout
request.SendWebRequest();
using (var request = UnityEngine.Networking.UnityWebRequest.Get(filePath))
{
request.timeout = 2; //seconds till timeout
request.SendWebRequest();

//Wait till webRequest completed
while (!request.isDone) { }
//Wait till webRequest completed
while (!request.isDone) { }

#if UNITY_2020_1_OR_NEWER
if (request.result != UnityEngine.Networking.UnityWebRequest.Result.Success)
{
Debug.Log("Requesting " + filePath + ", please make sure it exists and is a valid config");
throw new Exception("UnityWebRequest didn't succeed, Result : " + request.result);
}
if (request.result != UnityEngine.Networking.UnityWebRequest.Result.Success)
{
Debug.Log("Requesting " + filePath + ", please make sure it exists and is a valid config");
throw new Exception("UnityWebRequest didn't succeed, Result : " + request.result);
}
#else
if (request.isNetworkError || request.isHttpError)
{
Debug.Log("Requesting " + filePath + ", please make sure it exists and is a valid config");
throw new Exception("UnityWebRequest didn't succeed : Network or HTTP Error");
}
#endif
return request.downloadHandler.text;
return request.downloadHandler.text;
}
}
}
}
11 changes: 7 additions & 4 deletions Assets/Plugins/Android/Core/AndroidPlatformSpecifics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* SOFTWARE.
*/

#if !EOS_DISABLE

using UnityEngine;
using UnityEngine.Scripting;
using System.Runtime.InteropServices;
Expand All @@ -31,7 +33,7 @@
using System.Diagnostics;

#if UNITY_ANDROID && !UNITY_EDITOR
[assembly: AlwaysLinkAssembly]

namespace PlayEveryWare.EpicOnlineServices
{
using Epic.OnlineServices.Platform;
Expand All @@ -48,18 +50,18 @@ public class EOSInitializeOptions

//-------------------------------------------------------------------------
// Android specific Unity Parts.
public class EOSPlatformSpecificsAndroid : PlatformSpecifics<AndroidConfig>
public class AndroidPlatformSpecifics : PlatformSpecifics<AndroidConfig>
{

[DllImport("UnityHelpers_Android")]
private static extern JavaVM UnityHelpers_GetJavaVM();

public EOSPlatformSpecificsAndroid() : base(PlatformManager.Platform.Android, ".so") { }
public AndroidPlatformSpecifics() : base(PlatformManager.Platform.Android, ".so") { }

[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static public void Register()
{
EOSManagerPlatformSpecificsSingleton.SetEOSManagerPlatformSpecificsInterface(new EOSPlatformSpecificsAndroid());
EOSManagerPlatformSpecificsSingleton.SetEOSManagerPlatformSpecificsInterface(new AndroidPlatformSpecifics());
}

private static void ConfigureAndroidActivity()
Expand Down Expand Up @@ -114,3 +116,4 @@ static void print(string toPrint)
}
}
#endif
#endif
2 changes: 1 addition & 1 deletion Assets/Plugins/Android/Editor/AndroidBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace PlayEveryWare.EpicOnlineServices.Build

public class AndroidBuilder : PlatformSpecificBuilder
{
public AndroidBuilder() : base("Plugins/Android") { }
public AndroidBuilder() : base("Plugins/Android", BuildTarget.Android) { }

public override void PreBuild(BuildReport report)
{
Expand Down
11 changes: 8 additions & 3 deletions Assets/Plugins/Linux/Core/LinuxConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* 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 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,
Expand All @@ -28,6 +28,11 @@ namespace PlayEveryWare.EpicOnlineServices
[Serializable]
public class LinuxConfig : PlatformConfig
{
public LinuxConfig() : base(PlatformManager.Platform.Linux) { }
static LinuxConfig()
{
RegisterFactory(() => new LinuxConfig());
}

protected LinuxConfig() : base(PlatformManager.Platform.Linux) { }
}
}
34 changes: 8 additions & 26 deletions Assets/Plugins/Linux/Core/LinuxPlatformSpecifics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,16 @@
* SOFTWARE.
*/

#if UNITY_64 || UNITY_EDITOR_64
#define PLATFORM_64BITS
#elif UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
#define PLATFORM_32BITS
#endif

#if UNITY_EDITOR
#define EOS_DYNAMIC_BINDINGS
#endif
#if !EOS_DISABLE

//#define ENABLE_CONFIGURE_STEAM_FROM_MANAGED
using PlayEveryWare.EpicOnlineServices.Utility;
using UnityEngine;
using UnityEngine.Scripting;
using System.Runtime.InteropServices;

#if !UNITY_EDITOR_WIN && (UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX)

#if !UNITY_EDITOR_LINUX
[assembly: AlwaysLinkAssembly]
#endif
// If standalone linux and not editor, or the linux editor
#if (UNITY_STANDALONE_LINUX && !UNITY_EDITOR) || UNITY_EDITOR_LINUX

namespace PlayEveryWare.EpicOnlineServices
{
Expand All @@ -58,14 +48,6 @@ public class LinuxPlatformSpecifics : PlatformSpecifics<LinuxConfig>
{
public static string SteamConfigPath = "eos_steam_config.json";

#if ENABLE_CONFIGURE_STEAM_FROM_MANAGED
#if PLATFORM_64BITS
static string SteamDllName = "steam_api64.dll";
#else
static string SteamDllName = "steam_api.dll";
#endif
#endif

private static GCHandle SteamOptionsGCHandle;

public LinuxPlatformSpecifics() : base(PlatformManager.Platform.Linux, ".so") { }
Expand All @@ -81,7 +63,7 @@ static public void Register()
//-------------------------------------------------------------------------
public override void LoadDelegatesWithEOSBindingAPI()
{
#if EOS_DYNAMIC_BINDINGS
#if EOS_DYNAMIC_BINDINGS || UNITY_EDITOR
// TODO: This code does not appear to do anything...
const string EOSBinaryName = Epic.OnlineServices.Config.LibraryName;
var eosLibraryHandle = EOSManager.EOSSingleton.LoadDynamicLibrary(EOSBinaryName);
Expand All @@ -103,8 +85,8 @@ public override void ConfigureSystemPlatformCreateOptions(ref EOSCreateOptions c

if (File.Exists(steamEOSFinalConfigPath))
{
var steamConfigDataAsString = System.IO.File.ReadAllText(steamEOSFinalConfigPath);
var steamConfigData = JsonUtility.FromJson<EOSSteamConfig>(steamConfigDataAsString);
var steamConfigDataAsString = FileUtility.ReadAllText(steamEOSFinalConfigPath);
var steamConfigData = JsonUtility.FromJson<SteamConfig>(steamConfigDataAsString);
var integratedPlatforms = new Epic.OnlineServices.IntegratedPlatform.Options[1];

integratedPlatforms[0] = new Epic.OnlineServices.IntegratedPlatform.Options();
Expand Down Expand Up @@ -145,4 +127,4 @@ public override void ConfigureSystemPlatformCreateOptions(ref EOSCreateOptions c
}
}
#endif

#endif
8 changes: 5 additions & 3 deletions Assets/Plugins/Linux/Editor/LinuxBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* 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 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,
Expand All @@ -22,9 +22,11 @@

namespace PlayEveryWare.EpicOnlineServices.Build
{
using UnityEditor;

public class LinuxBuilder : PlatformSpecificBuilder
{
public LinuxBuilder() : base("Plugins/Linux")
public LinuxBuilder() : base("Plugins/Linux", BuildTarget.StandaloneLinux64)
{
AddProjectFileToBinaryMapping(
"DynamicLibraryLoaderHelper_Linux/Makefile",
Expand Down
Binary file modified Assets/Plugins/Linux/libDynamicLibraryLoaderHelper.so
Binary file not shown.
Loading

0 comments on commit 83b47ca

Please sign in to comment.