diff --git a/Assets/Plugins/Android/Core/AndroidFileIOHelper.cs b/Assets/Plugins/Android/Core/AndroidFileIOHelper.cs index d61a19f0a..43101db49 100644 --- a/Assets/Plugins/Android/Core/AndroidFileIOHelper.cs +++ b/Assets/Plugins/Android/Core/AndroidFileIOHelper.cs @@ -1,24 +1,24 @@ /* - * 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. - */ +* 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. +*/ namespace PlayEveryWare.EpicOnlineServices { @@ -92,4 +92,4 @@ private static string ProcessRequest(string filePath, UnityWebRequest request) return text; } } -} +} \ No newline at end of file diff --git a/Assets/Plugins/Source/Editor/Platforms/iOS/IOSBuilder.cs b/Assets/Plugins/Source/Editor/Platforms/iOS/IOSBuilder.cs index 6b8251f53..bd7b735cb 100644 --- a/Assets/Plugins/Source/Editor/Platforms/iOS/IOSBuilder.cs +++ b/Assets/Plugins/Source/Editor/Platforms/iOS/IOSBuilder.cs @@ -22,6 +22,7 @@ #if !EOS_DISABLE namespace PlayEveryWare.EpicOnlineServices.Editor.Build { + using EpicOnlineServices.Utility; using System.IO; using UnityEditor; using UnityEditor.Build.Reporting; diff --git a/com.playeveryware.eos/CHANGELOG.md b/com.playeveryware.eos/CHANGELOG.md index 46ec29402..56a397f94 100644 --- a/com.playeveryware.eos/CHANGELOG.md +++ b/com.playeveryware.eos/CHANGELOG.md @@ -2,6 +2,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.3.4] - 2024-11-26 + +### Changed + +- Update to EOS SDK 1.14.3. + +### Added + +- feat: EOSManager can have UserLoginInfo Provided to it +- feat: Authentication Listener knows the difference between a Connect and Auth login + +### Fixed + +- fix: Add isolated changes that address the Android thread IO issue. +- fix: Correct usage of FileSystemUtility in the IOSBuilder. + ## [3.3.3] - 2024-09-19 ### Added diff --git a/com.playeveryware.eos/Runtime/Core/Config/Config.cs b/com.playeveryware.eos/Runtime/Core/Config/Config.cs index adf00fd21..c4ee053a5 100644 --- a/com.playeveryware.eos/Runtime/Core/Config/Config.cs +++ b/com.playeveryware.eos/Runtime/Core/Config/Config.cs @@ -279,7 +279,7 @@ private static bool TryGetFactory(out Func factory) // Ensure static constructor of template variable type is called RuntimeHelpers.RunClassConstructor(typeof(T).TypeHandle); - if(!s_factories.TryGetValue(typeof(T), out factory)) + if (!s_factories.TryGetValue(typeof(T), out factory)) { throw new InvalidOperationException( $"No factory method has been registered for " + @@ -567,7 +567,7 @@ private static bool IsDefault(T configInstance) where T : Config */ return IteratePropertiesAndFields(configInstance) - .All(mInfo => + .All(mInfo => GetDefaultValue(mInfo.MemberType) == mInfo.MemberValue); } @@ -693,10 +693,10 @@ public bool Equals(MemberInfo a, MemberInfo b) { // consider the member values to be equal if one is null and // the other is empty - return ((a.MemberValue == null && - ((List)b.MemberValue).Count == 0) + return ((a.MemberValue == null && + ((List)b.MemberValue).Count == 0) || - (((List)a.MemberValue).Count == 0 && + (((List)a.MemberValue).Count == 0 && b.MemberValue == null)); } else if (a.MemberType == typeof(string)) @@ -715,7 +715,7 @@ public bool Equals(MemberInfo a, MemberInfo b) public int GetHashCode(MemberInfo memberInfo) { return HashCode.Combine( - memberInfo.MemberType, + memberInfo.MemberType, memberInfo.MemberValue); } } @@ -739,7 +739,7 @@ public int GetHashCode(MemberInfo memberInfo) /// private static IEnumerable IteratePropertiesAndFields( T instance, - BindingFlags bindingAttr = + BindingFlags bindingAttr = BindingFlags.Public | BindingFlags.Instance) { // go over the properties diff --git a/com.playeveryware.eos/Runtime/Core/EOSPackageInfo.cs b/com.playeveryware.eos/Runtime/Core/EOSPackageInfo.cs index 372da48b0..3f477715f 100644 --- a/com.playeveryware.eos/Runtime/Core/EOSPackageInfo.cs +++ b/com.playeveryware.eos/Runtime/Core/EOSPackageInfo.cs @@ -35,7 +35,7 @@ public static class EOSPackageInfo * not involve editing source code files. */ - public const string Version = "3.3.3"; + public const string Version = "3.3.4"; public const string PackageName = "com.playeveryware.eos"; } diff --git a/com.playeveryware.eos/Runtime/Core/Utility/FileSystemUtility.cs b/com.playeveryware.eos/Runtime/Core/Utility/FileSystemUtility.cs index 2e6d9ebbd..17ca7cf03 100644 --- a/com.playeveryware.eos/Runtime/Core/Utility/FileSystemUtility.cs +++ b/com.playeveryware.eos/Runtime/Core/Utility/FileSystemUtility.cs @@ -134,7 +134,7 @@ public class CopyFileProgressInfo public static bool TryGetTempDirectory(out string path) { path = default; - + // Nested local function to reduce repetitive code. string GenerateTempPath() { @@ -211,7 +211,7 @@ string GenerateTempPath() /// /// public static IEnumerable GetDirectories( - IEnumerable filepaths, + IEnumerable filepaths, bool creationOrder = true) { // For each filepath, determine the immediate parent directory of @@ -223,9 +223,9 @@ public static IEnumerable GetDirectories( // skip if no parent if (null == parent) continue; - + directoriesToCreate.Add(parent); - + } // Return the list of directories to create in ascending order of @@ -262,9 +262,9 @@ public static IEnumerable GetDirectories( /// Cancellation token. /// Task public static async Task CopyFilesAsync( - IList operations, - CancellationToken cancellationToken = default, - IProgress progress = null, + IList operations, + CancellationToken cancellationToken = default, + IProgress progress = null, int updateIntervalMS = DefaultUpdateIntervalMS) { IEnumerable directoriesToCreate = GetDirectories( @@ -302,9 +302,9 @@ public static async Task CopyFilesAsync( // Copy the files asynchronously with the provided // cancellation token, and progress stuff. await CopyFilesAsyncInternal( - operationsList, - cancellationToken, - progress, + operationsList, + cancellationToken, + progress, progressInfo); } else @@ -322,9 +322,9 @@ await CopyFilesAsyncInternal( /// Progress information. /// Task private static async Task CopyFilesAsyncInternal( - IEnumerable operations, - CancellationToken cancellationToken = default, - IProgress progress = null, + IEnumerable operations, + CancellationToken cancellationToken = default, + IProgress progress = null, CopyFileProgressInfo progressInfo = default) { var tasks = operations.Select(async copyOperation => @@ -361,14 +361,14 @@ private static async Task CopyFilesAsyncInternal( /// Cancellation token. /// Task private static async Task CopyFileAsync( - CopyFileOperation op, + CopyFileOperation op, CancellationToken cancellationToken) { // Maximum number of times the operation is retried if it fails. const int maxRetries = 3; // This is the initial delay before the operation is retried. - const int delayMilliseconds = 200; + const int delayMilliseconds = 200; for (int attempt = 0; attempt < maxRetries; attempt++) { @@ -401,7 +401,7 @@ await Task.Run(() => // exponentially increase the delay to maximize the chance // it will succeed without waiting too long. var delay = delayMilliseconds * (int)Math.Pow(2, attempt); - + // Construct detailed message regarding the nature of the problem. StringBuilder sb = new(); sb.AppendLine($"Exception occurred during the following copy operation:"); @@ -545,6 +545,32 @@ public static string ReadAllText(string path) #endif } +#endif + + /// + /// Reads all text from the indicated file. + /// + /// Filepath to the file to read from. + /// The contents of the file at the indicated path as a string. + public static string ReadAllText(string path) + { +#if UNITY_ANDROID && !UNITY_EDITOR + return AndroidFileIOHelper.ReadAllText(path); +#else + try + { + return File.ReadAllText(path); + } + catch (Exception e) + { + Debug.LogException(e); + throw; + } +#endif + + } + + @@ -685,7 +711,7 @@ private static void CreateDirectory(DirectoryInfo dInfo) { dInfo.Create(); } - catch(Exception ex) + catch (Exception ex) { Debug.LogException(ex); } @@ -790,7 +816,7 @@ public static void CleanDirectory(string directoryPath, bool ignoreGit = true) { // Skip .git directories if (ignoreGit && subDir.EndsWith(".git")) { continue; } - + // TODO: This is a little bit dangerous as one developer has found out. If the output directory is not // empty, and contains directories and files unrelated to output, this will (without prompting) // delete them. So, if you're outputting to, say the "Desktop" directory, it will delete everything @@ -846,4 +872,4 @@ public static void OpenDirectory(string path) } #endif } -} +} \ No newline at end of file diff --git a/com.playeveryware.eos/Runtime/Core/Utility/LogLevelUtility.cs b/com.playeveryware.eos/Runtime/Core/Utility/LogLevelUtility.cs index 29229bb65..6ec3c9714 100644 --- a/com.playeveryware.eos/Runtime/Core/Utility/LogLevelUtility.cs +++ b/com.playeveryware.eos/Runtime/Core/Utility/LogLevelUtility.cs @@ -63,6 +63,11 @@ public static List LogLevelList return null; } + if (logLevelConfig.LogCategoryLevelPairs == null) + { + return null; + } + List logLevels = new List(); for (int i = 0; i < LogCategoryStringArray.Length - 1; i++) { diff --git a/com.playeveryware.eos/package.json b/com.playeveryware.eos/package.json index 65088adb8..5e2f690e6 100644 --- a/com.playeveryware.eos/package.json +++ b/com.playeveryware.eos/package.json @@ -1,6 +1,6 @@ { "name": "com.playeveryware.eos", - "version": "3.3.3", + "version": "3.3.4", "unity": "2021.3", "unityRelease": "16f1", "author": { @@ -9,7 +9,7 @@ "url": "https://playeveryware.com" }, "displayName": "Epic Online Services Plugin for Unity", - "description": "Friendly Plugin for Epic Online Services\n Unity 2021.3.16f1\n EOS SDK 1.16.3\n\n Dependencies for Extra Packs:\n P2P Netcode Sample : [com.unity.netcode.gameobjects] \n Performance Stress Test Sample : [com.unity.postprocessing]", + "description": "Friendly Plugin for Epic Online Services\n Unity 2021.3.16f1\n EOS SDK 1.16.4\n\n Dependencies for Extra Packs:\n P2P Netcode Sample : [com.unity.netcode.gameobjects] \n Performance Stress Test Sample : [com.unity.postprocessing]", "documentationUrl": "https://eospluginforunity.playeveryware.com", "dependencies": { "com.unity.nuget.newtonsoft-json": "3.0.2", @@ -36,6 +36,6 @@ } ], "com_playeveryware": { - "git_build_sha": "22197e6d945978307af47c077a388d39f95a23bc" + "git_build_sha": "33dc48ffd9c173dede0297cf6d29ca66048c2ad1" } }