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 13, 2024
2 parents 0740baa + 7c5e113 commit 048c5d7
Show file tree
Hide file tree
Showing 39 changed files with 414 additions and 189 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj

# Only exclude csproj files in the root of the repository
/*.csproj

*.unityproj
*.sln
*.suo
Expand Down
3 changes: 0 additions & 3 deletions Assets/Plugins/Linux/Core/LinuxConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@

namespace PlayEveryWare.EpicOnlineServices
{
using System;

// Flags specifically for Linux. Note that labels for the baser
// PlatformConfig need to be specified here.
[Serializable]
[ConfigGroup("Linux Config", new[]
{
"Linux-Specific Options",
Expand Down
7 changes: 2 additions & 5 deletions Assets/Plugins/Source/Editor/ConfigEditors/ConfigEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* SOFTWARE.
*/

#if !EOS_DISABLE

namespace PlayEveryWare.EpicOnlineServices.Editor
{
Expand Down Expand Up @@ -192,7 +191,7 @@ public virtual void RenderContents()
}
else
{
GUILayout.Label(GetLabelText(), EditorStyles.boldLabel);
GUIEditorUtility.RenderSectionHeader(GetLabelText());
GUIEditorUtility.RenderInputs(ref config);
}
}
Expand Down Expand Up @@ -252,6 +251,4 @@ public void Dispose()
_animExpanded?.valueChanged.RemoveAllListeners();
}
}
}

#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
* SOFTWARE.
*/

#if !EOS_DISABLE

namespace PlayEveryWare.EpicOnlineServices.Editor
{
using System.Linq;
Expand Down Expand Up @@ -59,6 +57,4 @@ public override sealed void RenderContents()
GUIEditorUtility.RenderInputs(ref config);
}
}
}

#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace PlayEveryWare.EpicOnlineServices.Editor.Windows
#if !EOS_DISABLE
using Epic.OnlineServices.UI;
#endif
using PlayEveryWare.EpicOnlineServices.Extensions;
using PlayEveryWare.EpicOnlineServices.Utility;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -365,15 +364,15 @@ private void OnDefaultGUI()
}
}

if (!mainEOSConfigFile.IsEncryptionKeyValid())
#if !EOS_DISABLE
if (!EOSClientCredentials.IsEncryptionKeyValid(mainEOSConfigFile.encryptionKey))
{
int keyLength = mainEOSConfigFile.encryptionKey?.Length ?? 0;
EditorGUILayout.HelpBox(
"Used for Player Data Storage and Title Storage. Must be left blank if unused. Encryption key must be 64 hex characters (0-9,A-F). Current length is " +
keyLength + ".", MessageType.Warning);
}

#if !EOS_DISABLE
GUIEditorUtility.AssigningEnumField(
"Platform Flags",
ref mainEOSConfigFile.platformOptionsFlags,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ namespace PlayEveryWare.EpicOnlineServices.Editor.Build
{
#if !EOS_DISABLE
using Epic.OnlineServices.Platform;
using Extensions;
#endif
using Config;
using Extensions;
using Config = EpicOnlineServices.Config;
using System.IO;
using UnityEditor;
Expand Down
59 changes: 30 additions & 29 deletions Assets/Plugins/Source/Editor/Utility/GUIEditorUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
namespace PlayEveryWare.EpicOnlineServices.Editor.Utility
{
using Common;

#if !EOS_DISABLE
using Epic.OnlineServices.Platform;
#endif

using EpicOnlineServices.Utility;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -263,22 +267,30 @@ public static void AssigningEnumField<T>(string label, ref T value, float labelW

static readonly Dictionary<Type, RenderInputDelegate> RenderInputMethods = new()
{
{ typeof(Deployment), (attr, val, width) => RenderInput(attr, (Deployment)val, width) },
#if !EOS_DISABLE
{ typeof(EOSClientCredentials), (attr, val, width) => RenderInput(attr, (EOSClientCredentials)val, width) },
{ typeof(SetOfNamed<EOSClientCredentials>), (attr, val, width) => RenderInput(attr, (SetOfNamed<EOSClientCredentials>)val, width) },
{ typeof(WrappedInitializeThreadAffinity), (attr, val, width) => RenderInput(attr, (WrappedInitializeThreadAffinity)val, width) },
#endif
{ typeof(Deployment), (attr, val, width) => RenderInput(attr, (Deployment)val, width) },
{ typeof(string), (attr, val, width) => RenderInput(attr, (string)val, width) },
{ typeof(ulong), (attr, val, width) => RenderInput(attr, (ulong)val, width) },
{ typeof(uint), (attr, val, width) => RenderInput(attr, (uint)val, width) },
{ typeof(ProductionEnvironments), (attr, val, width) => RenderInput(attr, (ProductionEnvironments)val, width) },
{ typeof(float), (attr, val, width) => RenderInput(attr, (float)val, width) },
{ typeof(double), (attr, val, width) => RenderInput(attr, (double)val, width) },
{ typeof(WrappedInitializeThreadAffinity), (attr, val, width) => RenderInput(attr, (WrappedInitializeThreadAffinity)val, width) },

{ typeof(bool), (attr, val, width) => RenderInput(attr, (bool)val, width) },
// Add other specific types as needed
};

static readonly Dictionary<ConfigFieldType, FieldHandler> FieldHandlers = new()
{
#if !EOS_DISABLE
{ ConfigFieldType.SetOfClientCredentials, HandleField<SetOfNamed<EOSClientCredentials>> },
{ ConfigFieldType.ClientCredentials, HandleField<EOSClientCredentials> },
{ ConfigFieldType.WrappedInitializeThreadAffinity, HandleField<WrappedInitializeThreadAffinity> },
#endif
{ ConfigFieldType.Text, HandleField<string> },
{ ConfigFieldType.FilePath, (target, fieldDetails, getValue, setValue, labelWidth) =>
HandleField<string>(target, (FilePathFieldAttribute)fieldDetails, getValue, setValue, labelWidth) },
Expand All @@ -291,12 +303,9 @@ public static void AssigningEnumField<T>(string label, ref T value, float labelW
{ ConfigFieldType.Uint, HandleField<uint> },
{ ConfigFieldType.Float, HandleField<float> },
{ ConfigFieldType.ProductionEnvironments, HandleField<ProductionEnvironments> },
{ ConfigFieldType.SetOfClientCredentials, HandleField<SetOfNamed<EOSClientCredentials>> },
{ ConfigFieldType.NamedGuid, HandleField<Named<Guid>> },
{ ConfigFieldType.Guid, HandleField<Named<Guid>> },
{ ConfigFieldType.Version, HandleField<Version> },
{ ConfigFieldType.Deployment, HandleField<Deployment> },
{ ConfigFieldType.ClientCredentials, HandleField<EOSClientCredentials> },
{ ConfigFieldType.WrappedInitializeThreadAffinity, HandleField<WrappedInitializeThreadAffinity> },
{ ConfigFieldType.Button, HandleButtonField },
{ ConfigFieldType.Enum, HandleEnumField },
// Add other field types as needed
Expand All @@ -306,6 +315,7 @@ public static void AssigningEnumField<T>(string label, ref T value, float labelW

private static T RenderInput<T>(ConfigFieldAttribute attribute, T value, float labelWidth)
{
#if !EOS_DISABLE
if (typeof(T) == typeof(WrappedInitializeThreadAffinity))
{
// Create a foldout label with a tooltip
Expand Down Expand Up @@ -340,6 +350,7 @@ private static T RenderInput<T>(ConfigFieldAttribute attribute, T value, float l
RenderInputs(ref value);
}
}
#endif
return value;
}

Expand Down Expand Up @@ -395,15 +406,20 @@ static void HandleEnumField(
setValue(target, newValue);
}



delegate void FieldHandler(
object target,
ConfigFieldAttribute fieldDetails,
Func<object, object> getValue,
Action<object, object> setValue,
float labelWidth);

public static void RenderSectionHeader(string label)
{
GUILayout.Label(label.ToUpper(), EditorStyles.boldLabel);
Rect rect = EditorGUILayout.GetControlRect(false, 1); // Set the height to 1 pixel
EditorGUI.DrawRect(rect, Color.gray);
}

/// <summary>
/// Render the config fields for the config that has been set to edit.
/// </summary>
Expand Down Expand Up @@ -696,7 +712,7 @@ private static void RenderSetOfNamed<T>(
Action<Rect, Named<T>> renderItemFn,
Action addNewItemFn,
Action<Named<T>> removeItemFn
) where T : IEquatable<T>
) where T : IEquatable<T>, new()
{
List<Named<T>> items = value.ToList();

Expand Down Expand Up @@ -867,6 +883,7 @@ private static Version VersionField(Version value, params GUILayoutOption[] opti
return Version.TryParse(tempStringVersion, out Version newValue) ? newValue : value;
}

#if !EOS_DISABLE
public static EOSClientCredentials RenderInput(ConfigFieldAttribute configFieldAttribute,
EOSClientCredentials value,
float labelWidth)
Expand Down Expand Up @@ -897,6 +914,7 @@ public static EOSClientCredentials RenderInput(ConfigFieldAttribute configFieldA
return (newIndex >= 0 && newIndex < credentials.Count) ? credentials[newIndex].Value : value;
});
}
#endif

public static Deployment RenderInput(ConfigFieldAttribute configFieldAttribute, Deployment value, float labelWidth)
{
Expand Down Expand Up @@ -942,6 +960,7 @@ public static Version RenderInput(ConfigFieldAttribute configFieldAttribute, Ver
VersionField);
}

#if !EOS_DISABLE
public static SetOfNamed<EOSClientCredentials> RenderInput(ConfigFieldAttribute configFieldAttribute,
SetOfNamed<EOSClientCredentials> value, float labelWidth)
{
Expand Down Expand Up @@ -1001,6 +1020,7 @@ public static WrappedInitializeThreadAffinity RenderInput(ConfigFieldAttribute a
RenderInputs(ref value);
return value;
}
#endif

public static ProductionEnvironments RenderInput(ConfigFieldAttribute configFieldAttribute,
ProductionEnvironments value, float labelWidth)
Expand Down Expand Up @@ -1030,25 +1050,6 @@ public static ProductionEnvironments RenderInput(ConfigFieldAttribute configFiel
return value;
}

public static Named<Guid> RenderInput(ConfigFieldAttribute configFieldDetails, Named<Guid> value,
float labelWidth)
{
EditorGUILayout.LabelField(CreateGUIContent(configFieldDetails.Label, configFieldDetails.ToolTip));

GUILayout.BeginHorizontal();

value ??= new Named<Guid>();

value.Name = RenderFieldWithHint(EditorGUILayout.TextField, string.IsNullOrEmpty, value.Name,
"Product Name");

value.Value = RenderFieldWithHint(GuidField, guid => guid.Equals(Guid.Empty), value.Value, "Product Id");

GUILayout.EndHorizontal();

return value;
}

public static List<string> RenderInput(ConfigFieldAttribute configFieldDetails, List<string> value,
float labelWidth)
{
Expand Down Expand Up @@ -1229,6 +1230,6 @@ private static T InputRendererWrapper<T>(string label, string toolTip, float lab
});
}

#endregion
#endregion
}
}
15 changes: 7 additions & 8 deletions Assets/Plugins/Source/Editor/Utility/PackageFileUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@
* SOFTWARE.
*/

using System.Collections.Generic;
using UnityEngine;
using System.IO;
using System;
using System.Text.RegularExpressions;

namespace PlayEveryWare.EpicOnlineServices.Utility
{
using Common.Extensions;
using Editor.Build;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;

internal class PackageFileUtility
{
Expand Down Expand Up @@ -143,7 +142,7 @@ public static List<FileInfoMatchingResult> FindPackageFiles(string root, Package
private static IEnumerable<FileInfoMatchingResult> FindMatchingFiles(string root, string currentWorkingDir, SrcDestPair pair)
{
IEnumerable<string> collectedFiles;

string searchPattern = pair.src;
string path = root;

Expand Down Expand Up @@ -288,7 +287,7 @@ public static async Task CopyFilesToDirectory(

// Copy the files
await FileSystemUtility.CopyFilesAsync(copyOperations, cancellationToken, progress);

// Execute callback
postProcessCallback?.Invoke(destination);
}
Expand Down
1 change: 0 additions & 1 deletion Assets/Plugins/Windows/Core/WindowsConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace PlayEveryWare.EpicOnlineServices
using System;

// Flags specifically for Windows
[Serializable]
[ConfigGroup("Windows Config", new[]
{
"Windows-Specific Options",
Expand Down
3 changes: 0 additions & 3 deletions Assets/Plugins/iOS/Core/IOSConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@

namespace PlayEveryWare.EpicOnlineServices
{
using System;

// Flags specifically for iOS. Note that labels for the baser
// PlatformConfig need to be specified here.
[Serializable]
[ConfigGroup("EOS Config", new[]
{
"iOS-Specific Options",
Expand Down
1 change: 0 additions & 1 deletion Assets/Plugins/macOS/Core/MacOSConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace PlayEveryWare.EpicOnlineServices
using System;

// Flags specifically for macOS
[Serializable]
[ConfigGroup("MacOS Config", new[]
{
"MacOS-Specific Options",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,6 @@ public class UITitleStorageMenu : SampleMenu
public Text FileContent;
private List<string> CurrentTags = new List<string>();

protected override void Awake()
{
base.Awake();
if (Config.Get<EOSConfig>().IsEncryptionKeyValid())
{
FileContent.text = string.Empty;
}
else
{
FileContent.text = "Valid encryption key not set. Use the EOS Config Editor to add one.";
}
}

private void Start()
{
}

public void AddTagOnClick()
{
if (AddTag(AddTagTextBox.InputField.text))
Expand Down
Loading

0 comments on commit 048c5d7

Please sign in to comment.