diff --git a/.idea/.idea.EpicOnlineTransport.dir/.idea/.gitignore b/.idea/.idea.EpicOnlineTransport.dir/.idea/.gitignore
new file mode 100644
index 00000000..d064bd79
--- /dev/null
+++ b/.idea/.idea.EpicOnlineTransport.dir/.idea/.gitignore
@@ -0,0 +1,13 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Rider ignored files
+/modules.xml
+/contentModel.xml
+/projectSettingsUpdater.xml
+/.idea.EpicOnlineTransport.iml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/.idea.EpicOnlineTransport.dir/.idea/encodings.xml b/.idea/.idea.EpicOnlineTransport.dir/.idea/encodings.xml
new file mode 100644
index 00000000..df87cf95
--- /dev/null
+++ b/.idea/.idea.EpicOnlineTransport.dir/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.EpicOnlineTransport.dir/.idea/indexLayout.xml b/.idea/.idea.EpicOnlineTransport.dir/.idea/indexLayout.xml
new file mode 100644
index 00000000..7b08163c
--- /dev/null
+++ b/.idea/.idea.EpicOnlineTransport.dir/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.EpicOnlineTransport.dir/.idea/vcs.xml b/.idea/.idea.EpicOnlineTransport.dir/.idea/vcs.xml
new file mode 100644
index 00000000..94a25f7f
--- /dev/null
+++ b/.idea/.idea.EpicOnlineTransport.dir/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mirror.meta b/Mirror.meta
index 84708744..0c6debea 100644
--- a/Mirror.meta
+++ b/Mirror.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 4a643c965f93f8e468a43317de73e4d5
+guid: 539e7f41699ea4342897774ba43118c4
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Mirror/Runtime.meta b/Mirror/Runtime.meta
index 85ee3eb8..df10f1f6 100644
--- a/Mirror/Runtime.meta
+++ b/Mirror/Runtime.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 9f4328ccc5f724e45afe2215d275b5d5
+guid: 4a7650ce5e2ba468993c2acf0bbf4dca
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Mirror/Runtime/Transport.meta b/Mirror/Runtime/Transport.meta
index fc29442a..f8c98dbb 100644
--- a/Mirror/Runtime/Transport.meta
+++ b/Mirror/Runtime/Transport.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 7825d46cd73fe47938869eb5427b40fa
+guid: 52b3492a14b35479eb1128bcadad352f
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport.meta b/Mirror/Runtime/Transport/EpicOnlineTransport.meta
index 3c87a4a7..c13183ca 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport.meta
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: fb097379647003348b59f3423899888c
+guid: 9ba796c68c5d8473ba450771b67109de
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/Client.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/Client.cs
index 8d5e5dd9..96f8f4f3 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/Client.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/Client.cs
@@ -113,23 +113,24 @@ protected override void OnReceiveData(byte[] data, ProductUserId clientUserId, i
OnReceivedData.Invoke(data, channel);
}
- protected override void OnNewConnection(OnIncomingConnectionRequestInfo result) {
+ protected override void OnNewConnection(ref OnIncomingConnectionRequestInfo result) {
if (ignoreAllMessages) {
return;
}
- if (deadSockets.Contains(result.SocketId.SocketName)) {
+ if (deadSockets.Contains(result.SocketId?.SocketName)) {
Debug.LogError("Received incoming connection request from dead socket");
return;
}
if (hostProductId == result.RemoteUserId) {
+ var acceptConnectionOptions = new AcceptConnectionOptions() {
+ LocalUserId = EOSSDKComponent.LocalUserProductId,
+ RemoteUserId = result.RemoteUserId,
+ SocketId = result.SocketId
+ };
EOSSDKComponent.GetP2PInterface().AcceptConnection(
- new AcceptConnectionOptions() {
- LocalUserId = EOSSDKComponent.LocalUserProductId,
- RemoteUserId = result.RemoteUserId,
- SocketId = result.SocketId
- });
+ ref acceptConnectionOptions);
} else {
Debug.LogError("P2P Acceptance Request from unknown host ID.");
}
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/Common.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/Common.cs
index 57abf3da..a97a16fd 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/Common.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/Common.cs
@@ -48,14 +48,14 @@ protected Common(EosTransport transport) {
OnIncomingConnectionRequest += OnNewConnection;
OnRemoteConnectionClosed += OnConnectFail;
- incomingNotificationId = EOSSDKComponent.GetP2PInterface().AddNotifyPeerConnectionRequest(addNotifyPeerConnectionRequestOptions,
+ incomingNotificationId = EOSSDKComponent.GetP2PInterface().AddNotifyPeerConnectionRequest(ref addNotifyPeerConnectionRequestOptions,
null, OnIncomingConnectionRequest);
AddNotifyPeerConnectionClosedOptions addNotifyPeerConnectionClosedOptions = new AddNotifyPeerConnectionClosedOptions();
addNotifyPeerConnectionClosedOptions.LocalUserId = EOSSDKComponent.LocalUserProductId;
addNotifyPeerConnectionClosedOptions.SocketId = null;
- outgoingNotificationId = EOSSDKComponent.GetP2PInterface().AddNotifyPeerConnectionClosed(addNotifyPeerConnectionClosedOptions,
+ outgoingNotificationId = EOSSDKComponent.GetP2PInterface().AddNotifyPeerConnectionClosed(ref addNotifyPeerConnectionClosedOptions,
null, OnRemoteConnectionClosed);
if (outgoingNotificationId == 0 || incomingNotificationId == 0) {
@@ -75,9 +75,9 @@ protected void Dispose() {
transport.ResetIgnoreMessagesAtStartUpTimer();
}
- protected abstract void OnNewConnection(OnIncomingConnectionRequestInfo result);
+ protected abstract void OnNewConnection(ref OnIncomingConnectionRequestInfo result);
- private void OnConnectFail(OnRemoteConnectionClosedInfo result) {
+ private void OnConnectFail(ref OnRemoteConnectionClosedInfo result) {
if (ignoreAllMessages) {
return;
}
@@ -86,54 +86,67 @@ private void OnConnectFail(OnRemoteConnectionClosedInfo result) {
switch (result.Reason) {
case ConnectionClosedReason.ClosedByLocalUser:
- throw new Exception("Connection cLosed: The Connection was gracecfully closed by the local user.");
+ Debug.Log("Connection closed: The Connection was gracefully closed by the local user.");
+ break;
case ConnectionClosedReason.ClosedByPeer:
- throw new Exception("Connection closed: The connection was gracefully closed by remote user.");
+ Debug.Log("Connection closed: The connection was gracefully closed by remote user.");
+ break;
case ConnectionClosedReason.ConnectionClosed:
- throw new Exception("Connection closed: The connection was unexpectedly closed.");
+ Debug.LogWarning("Connection closed: The connection was unexpectedly closed.");
+ break;
case ConnectionClosedReason.ConnectionFailed:
- throw new Exception("Connection failed: Failled to establish connection.");
+ Debug.LogError("Connection failed: Failed to establish connection.");
+ break;
case ConnectionClosedReason.InvalidData:
- throw new Exception("Connection failed: The remote user sent us invalid data..");
+ Debug.LogError("Connection failed: The remote user sent us invalid data..");
+ break;
case ConnectionClosedReason.InvalidMessage:
- throw new Exception("Connection failed: The remote user sent us an invalid message.");
+ Debug.LogError("Connection failed: The remote user sent us an invalid message.");
+ break;
case ConnectionClosedReason.NegotiationFailed:
- throw new Exception("Connection failed: Negotiation failed.");
+ Debug.LogError("Connection failed: Negotiation failed.");
+ break;
case ConnectionClosedReason.TimedOut:
- throw new Exception("Connection failed: Timeout.");
+ Debug.LogError("Connection failed: Timeout.");
+ break;
case ConnectionClosedReason.TooManyConnections:
- throw new Exception("Connection failed: Too many connections.");
+ Debug.LogError("Connection failed: Too many connections.");
+ break;
case ConnectionClosedReason.UnexpectedError:
- throw new Exception("Unexpected Error, connection will be closed");
+ Debug.LogError("Unexpected Error, connection will be closed");
+ break;
case ConnectionClosedReason.Unknown:
default:
- throw new Exception("Unknown Error, connection has been closed.");
+ Debug.LogError("Unknown Error, connection has been closed.");
+ break;
}
}
protected void SendInternal(ProductUserId target, SocketId socketId, InternalMessages type) {
- EOSSDKComponent.GetP2PInterface().SendPacket(new SendPacketOptions() {
+ var sendPacketOptions = new SendPacketOptions() {
AllowDelayedDelivery = true,
- Channel = (byte) internal_ch,
- Data = new byte[] { (byte) type },
+ Channel = (byte)internal_ch,
+ Data = new ArraySegment(new byte[] { (byte)type }),
LocalUserId = EOSSDKComponent.LocalUserProductId,
Reliability = PacketReliability.ReliableOrdered,
RemoteUserId = target,
SocketId = socketId
- });
+ };
+ EOSSDKComponent.GetP2PInterface().SendPacket(ref sendPacketOptions);
}
protected void Send(ProductUserId host, SocketId socketId, byte[] msgBuffer, byte channel) {
- Result result = EOSSDKComponent.GetP2PInterface().SendPacket(new SendPacketOptions() {
+ var sendPacketOptions = new SendPacketOptions() {
AllowDelayedDelivery = true,
Channel = channel,
- Data = msgBuffer,
+ Data = new ArraySegment(msgBuffer),
LocalUserId = EOSSDKComponent.LocalUserProductId,
Reliability = channels[channel],
RemoteUserId = host,
SocketId = socketId
- });
+ };
+ Result result = EOSSDKComponent.GetP2PInterface().SendPacket(ref sendPacketOptions);
if(result != Result.Success) {
Debug.LogError("Send failed " + result);
@@ -141,11 +154,35 @@ protected void Send(ProductUserId host, SocketId socketId, byte[] msgBuffer, byt
}
private bool Receive(out ProductUserId clientProductUserId, out SocketId socketId, out byte[] receiveBuffer, byte channel) {
- Result result = EOSSDKComponent.GetP2PInterface().ReceivePacket(new ReceivePacketOptions() {
+ var receivePacketOptions = new ReceivePacketOptions() {
LocalUserId = EOSSDKComponent.LocalUserProductId,
MaxDataSizeBytes = P2PInterface.MaxPacketSize,
RequestedChannel = channel
- }, out clientProductUserId, out socketId, out channel, out receiveBuffer);
+ };
+
+ var getNextReceivedPacketSizeOptions = new GetNextReceivedPacketSizeOptions() {
+ LocalUserId = EOSSDKComponent.LocalUserProductId,
+ RequestedChannel = channel
+ };
+ Result getPacketSizeResult = EOSSDKComponent.GetP2PInterface()
+ .GetNextReceivedPacketSize(ref getNextReceivedPacketSizeOptions, out var packetSize);
+
+ if (getPacketSizeResult != Result.Success) {
+ receiveBuffer = null;
+ clientProductUserId = null;
+ socketId = default;
+ return false;
+ }
+
+ uint bytesWritten = 0;
+ receiveBuffer = new byte[packetSize];
+ Result result = EOSSDKComponent.GetP2PInterface().ReceivePacket(
+ ref receivePacketOptions,
+ out clientProductUserId,
+ out socketId,
+ out channel,
+ new ArraySegment(receiveBuffer),
+ out bytesWritten);
if (result == Result.Success) {
return true;
@@ -157,7 +194,7 @@ private bool Receive(out ProductUserId clientProductUserId, out SocketId socketI
}
protected virtual void CloseP2PSessionWithUser(ProductUserId clientUserID, SocketId socketId) {
- if (socketId == null) {
+ if (socketId.Equals(default(SocketId))) {
Debug.LogWarning("Socket ID == null | " + ignoreAllMessages);
return;
}
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool.meta
index d760ecca..12385913 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool.meta
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 49a600a9a9638fb4e88fff9af13c2d3d
+guid: 11f02eef4598849709162bd309355005
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS Developer Authentication Tool.pdf b/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS Developer Authentication Tool.pdf
new file mode 100644
index 00000000..c630c5a1
Binary files /dev/null and b/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS Developer Authentication Tool.pdf differ
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS_DevAuthTool-darwin-x64-1.0.1.zip b/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS_DevAuthTool-darwin-x64-1.0.1.zip
deleted file mode 100644
index 33d9bc45..00000000
Binary files a/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS_DevAuthTool-darwin-x64-1.0.1.zip and /dev/null differ
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS_DevAuthTool-win32-x64-1.0.1.zip b/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS_DevAuthTool-win32-x64-1.1.0.zip
similarity index 76%
rename from Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS_DevAuthTool-win32-x64-1.0.1.zip
rename to Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS_DevAuthTool-win32-x64-1.1.0.zip
index 89050507..8205097f 100644
Binary files a/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS_DevAuthTool-win32-x64-1.0.1.zip and b/Mirror/Runtime/Transport/EpicOnlineTransport/DevAuthTool/EOS_DevAuthTool-win32-x64-1.1.0.zip differ
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/BoxedData.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/BoxedData.cs
deleted file mode 100644
index 9fcdf1ab..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/BoxedData.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-using System.Runtime.InteropServices;
-
-namespace Epic.OnlineServices
-{
- internal sealed class BoxedData
- {
- public object Data { get; private set; }
-
- public BoxedData(object data)
- {
- Data = data;
- }
- }
-}
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/BoxedData.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/BoxedData.cs.meta
deleted file mode 100644
index 445d0846..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/BoxedData.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 9cf28f76f76ab5b4191ed789dec5ea5c
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/CallbackHelper.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/CallbackHelper.cs
new file mode 100644
index 00000000..c492567a
--- /dev/null
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/CallbackHelper.cs
@@ -0,0 +1,245 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+using System;
+using System.Linq;
+
+namespace Epic.OnlineServices
+{
+ public sealed partial class Helper
+ {
+ ///
+ /// Adds a callback to the wrapper.
+ ///
+ /// The generated client data address.
+ /// The client data of the callback.
+ /// The public delegate of the callback.
+ /// The private delegate of the callback.
+ /// Any delegates passed in with input structs.
+ internal static void AddCallback(out IntPtr clientDataAddress, object clientData, Delegate publicDelegate, Delegate privateDelegate, params Delegate[] structDelegates)
+ {
+ lock (s_Callbacks)
+ {
+ clientDataAddress = AddClientData(clientData);
+ s_Callbacks.Add(clientDataAddress, new DelegateHolder(publicDelegate, privateDelegate, structDelegates));
+ }
+ }
+
+ ///
+ /// Removes a callback from the wrapper.
+ ///
+ /// The client data address of the callback.
+ private static void RemoveCallback(IntPtr clientDataAddress)
+ {
+ lock (s_Callbacks)
+ {
+ s_Callbacks.Remove(clientDataAddress);
+ RemoveClientData(clientDataAddress);
+ }
+ }
+
+ ///
+ /// Tries to get the callback associated with the given internal callback info, and then removes it from the wrapper if applicable.
+ /// Single-use callbacks will be cleaned up by this function.
+ ///
+ /// The internal callback info type.
+ /// The callback type.
+ /// The callback info type.
+ /// The internal callback info.
+ /// The callback associated with the internal callback info.
+ /// The callback info.
+ /// Whether the callback was successfully retrieved.
+ internal static bool TryGetAndRemoveCallback(ref TCallbackInfoInternal callbackInfoInternal, out TCallback callback, out TCallbackInfo callbackInfo)
+ where TCallbackInfoInternal : struct, ICallbackInfoInternal, IGettable
+ where TCallback : class
+ where TCallbackInfo : struct, ICallbackInfo
+ {
+ IntPtr clientDataAddress;
+ Get(ref callbackInfoInternal, out callbackInfo, out clientDataAddress);
+
+ callback = null;
+
+ lock (s_Callbacks)
+ {
+ DelegateHolder delegateHolder;
+ if (s_Callbacks.TryGetValue(clientDataAddress, out delegateHolder))
+ {
+ callback = delegateHolder.Public as TCallback;
+ if (callback != null)
+ {
+ // If this delegate was added with an AddNotify, we should only ever remove it on RemoveNotify.
+ if (delegateHolder.NotificationId.HasValue)
+ {
+ }
+
+ // If the operation is complete, it's safe to remove.
+ else if (callbackInfo.GetResultCode().HasValue && Common.IsOperationComplete(callbackInfo.GetResultCode().Value))
+ {
+ RemoveCallback(clientDataAddress);
+ }
+
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ ///
+ /// Tries to get the struct callback associated with the given internal callback info.
+ ///
+ /// The internal callback info type.
+ /// The callback type.
+ /// The callback info type.
+ /// The internal callback info.
+ /// The callback associated with the internal callback info.
+ /// The callback info.
+ /// Whether the callback was successfully retrieved.
+ internal static bool TryGetStructCallback(ref TCallbackInfoInternal callbackInfoInternal, out TCallback callback, out TCallbackInfo callbackInfo)
+ where TCallbackInfoInternal : struct, ICallbackInfoInternal, IGettable
+ where TCallback : class
+ where TCallbackInfo : struct
+ {
+ IntPtr clientDataAddress;
+ Get(ref callbackInfoInternal, out callbackInfo, out clientDataAddress);
+
+ callback = null;
+ lock (s_Callbacks)
+ {
+ DelegateHolder delegateHolder;
+ if (s_Callbacks.TryGetValue(clientDataAddress, out delegateHolder))
+ {
+ callback = delegateHolder.StructDelegates.FirstOrDefault(structDelegate => structDelegate.GetType() == typeof(TCallback)) as TCallback;
+ if (callback != null)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ ///
+ /// Removes a callback from the wrapper by an associated notification id.
+ ///
+ /// The notification id associated with the callback.
+ internal static void RemoveCallbackByNotificationId(ulong notificationId)
+ {
+ lock (s_Callbacks)
+ {
+ var clientDataAddress = s_Callbacks.SingleOrDefault(pair => pair.Value.NotificationId.HasValue && pair.Value.NotificationId == notificationId);
+ RemoveCallback(clientDataAddress.Key);
+ }
+ }
+
+ ///
+ /// Adds a static callback to the wrapper.
+ ///
+ /// The key of the callback.
+ /// The public delegate of the callback.
+ /// The private delegate of the callback
+ internal static void AddStaticCallback(string key, Delegate publicDelegate, Delegate privateDelegate)
+ {
+ lock (s_StaticCallbacks)
+ {
+ s_StaticCallbacks.Remove(key);
+ s_StaticCallbacks.Add(key, new DelegateHolder(publicDelegate, privateDelegate));
+ }
+ }
+
+ ///
+ /// Tries to get the static callback associated with the given key.
+ ///
+ /// The callback type.
+ /// The key of the callback.
+ /// The callback associated with the key.
+ /// Whether the callback was successfully retrieved.
+ internal static bool TryGetStaticCallback(string key, out TCallback callback)
+ where TCallback : class
+ {
+ callback = null;
+
+ lock (s_StaticCallbacks)
+ {
+ DelegateHolder delegateHolder;
+ if (s_StaticCallbacks.TryGetValue(key, out delegateHolder))
+ {
+ callback = delegateHolder.Public as TCallback;
+ if (callback != null)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ ///
+ /// Assigns a notification id to a callback by client data address associated with the callback.
+ ///
+ /// The client data address associated with the callback.
+ /// The notification id to assign.
+ internal static void AssignNotificationIdToCallback(IntPtr clientDataAddress, ulong notificationId)
+ {
+ if (notificationId == 0)
+ {
+ RemoveCallback(clientDataAddress);
+ return;
+ }
+
+ lock (s_Callbacks)
+ {
+ DelegateHolder delegateHolder;
+ if (s_Callbacks.TryGetValue(clientDataAddress, out delegateHolder))
+ {
+ delegateHolder.NotificationId = notificationId;
+ }
+ }
+ }
+
+ ///
+ /// Adds client data to the wrapper.
+ ///
+ /// The client data to add.
+ /// The address of the added client data.
+ private static IntPtr AddClientData(object clientData)
+ {
+ lock (s_ClientDatas)
+ {
+ long clientDataId = ++s_LastClientDataId;
+ IntPtr clientDataAddress = new IntPtr(clientDataId);
+ s_ClientDatas.Add(clientDataAddress, clientData);
+ return clientDataAddress;
+ }
+ }
+
+ ///
+ /// Removes a client data from the wrapper.
+ ///
+ /// The address of the client data to remove.
+ private static void RemoveClientData(IntPtr clientDataAddress)
+ {
+ lock (s_ClientDatas)
+ {
+ s_ClientDatas.Remove(clientDataAddress);
+ }
+ }
+
+ ///
+ /// Gets client data by its address.
+ ///
+ /// The address of the client data.
+ /// Th client data associated with the address.
+ private static object GetClientData(IntPtr clientDataAddress)
+ {
+ lock (s_ClientDatas)
+ {
+ object clientData;
+ s_ClientDatas.TryGetValue(clientDataAddress, out clientData);
+ return clientData;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Config.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Config.cs
index 8bd20ad2..16ab16cb 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Config.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Config.cs
@@ -1,97 +1,95 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-#if DEBUG
- #define EOS_DEBUG
-#endif
-
-#if UNITY_EDITOR
- #define EOS_EDITOR
-#endif
-
-#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_PS4 || UNITY_XBOXONE || UNITY_SWITCH || UNITY_IOS || UNITY_ANDROID
- #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
-
-#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
- #define EOS_PLATFORM_OSX
-
-#elif UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
- #define EOS_PLATFORM_LINUX
-
-#elif UNITY_PS4
- #define EOS_PLATFORM_PS4
-
-#elif UNITY_XBOXONE
- #define EOS_PLATFORM_XBOXONE
-
-#elif UNITY_SWITCH
- #define EOS_PLATFORM_SWITCH
-
-#elif UNITY_IOS || __IOS__
- #define EOS_PLATFORM_IOS
-
-#elif UNITY_ANDROID || __ANDROID__
- #define EOS_PLATFORM_ANDROID
-
-#endif
-
-using System.Runtime.InteropServices;
-
-namespace Epic.OnlineServices
-{
- public static class Config
- {
- public const string LibraryName =
- #if EOS_PLATFORM_WINDOWS_32 && EOS_UNITY
- "EOSSDK-Win32-Shipping"
- #elif EOS_PLATFORM_WINDOWS_32
- "EOSSDK-Win32-Shipping.dll"
-
- #elif EOS_PLATFORM_WINDOWS_64 && EOS_UNITY
- "EOSSDK-Win64-Shipping"
- #elif EOS_PLATFORM_WINDOWS_64
- "EOSSDK-Win64-Shipping.dll"
-
- #elif EOS_PLATFORM_OSX && EOS_UNITY
- "libEOSSDK-Mac-Shipping"
- #elif EOS_PLATFORM_OSX
- "libEOSSDK-Mac-Shipping.dylib"
-
- #elif EOS_PLATFORM_LINUX && EOS_UNITY
- "libEOSSDK-Linux-Shipping.so"
- #elif EOS_PLATFORM_LINUX
- "libEOSSDK-Linux-Shipping.so"
-
- #elif EOS_PLATFORM_IOS && EOS_UNITY && !EOS_EDITOR
- "__Internal"
- #elif EOS_PLATFORM_IOS && EOS_UNITY
- "EOSSDK"
- #elif EOS_PLATFORM_IOS
- "EOSSDK.framework/EOSSDK"
-
- #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.
- "EOSSDK-UnknownPlatform-Shipping"
-
- #endif
- ;
-
- public const CallingConvention LibraryCallingConvention =
- #if EOS_PLATFORM_WINDOWS_32
- CallingConvention.StdCall
- #else
- CallingConvention.Cdecl
- #endif
- ;
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#if DEBUG
+ #define EOS_DEBUG
+#endif
+
+#if UNITY_EDITOR
+ #define EOS_EDITOR
+#endif
+
+#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_PS4 || UNITY_XBOXONE || UNITY_SWITCH || UNITY_IOS || UNITY_ANDROID
+ #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
+
+#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
+ #define EOS_PLATFORM_OSX
+
+#elif UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
+ #define EOS_PLATFORM_LINUX
+
+#elif UNITY_PS4
+ #define EOS_PLATFORM_PS4
+
+#elif UNITY_XBOXONE
+ #define EOS_PLATFORM_XBOXONE
+
+#elif UNITY_SWITCH
+ #define EOS_PLATFORM_SWITCH
+
+#elif UNITY_IOS || __IOS__
+ #define EOS_PLATFORM_IOS
+
+#elif UNITY_ANDROID || __ANDROID__
+ #define EOS_PLATFORM_ANDROID
+
+#endif
+
+using System.Runtime.InteropServices;
+
+namespace Epic.OnlineServices
+{
+ public static class Config
+ {
+ public const string LibraryName =
+ #if EOS_PLATFORM_WINDOWS_32 && EOS_UNITY
+ "EOSSDK-Win32-Shipping"
+ #elif EOS_PLATFORM_WINDOWS_32
+ "EOSSDK-Win32-Shipping.dll"
+
+ #elif EOS_PLATFORM_WINDOWS_64 && EOS_UNITY
+ "EOSSDK-Win64-Shipping"
+ #elif EOS_PLATFORM_WINDOWS_64
+ "EOSSDK-Win64-Shipping.dll"
+
+ #elif UNITY_EDITOR_OSX
+ "libEOSSDK-Mac-Shipping"
+ #elif EOS_PLATFORM_OSX
+ "libEOSSDK-Mac-Shipping.dylib"
+
+ #elif EOS_PLATFORM_LINUX && EOS_UNITY
+ "EOSSDK-Linux-Shipping"
+ #elif EOS_PLATFORM_LINUX
+ "EOSSDK-Linux-Shipping.so"
+
+ #elif EOS_PLATFORM_IOS && EOS_UNITY && EOS_EDITOR
+ "EOSSDK"
+ #elif EOS_PLATFORM_IOS
+ "EOSSDK.framework/EOSSDK"
+
+ #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.
+ "EOSSDK-UnknownPlatform-Shipping"
+
+ #endif
+ ;
+
+ public const CallingConvention LibraryCallingConvention =
+ #if EOS_PLATFORM_WINDOWS_32
+ CallingConvention.StdCall
+ #else
+ CallingConvention.Cdecl
+ #endif
+ ;
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Config.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Config.cs.meta
deleted file mode 100644
index 099eff51..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Config.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 98992bf0f67075d4fa670ad6baa3bc04
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ConvertHelper.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ConvertHelper.cs
new file mode 100644
index 00000000..5d9b23bb
--- /dev/null
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ConvertHelper.cs
@@ -0,0 +1,192 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+using System;
+using System.Linq;
+using System.Text;
+
+namespace Epic.OnlineServices
+{
+ public sealed partial class Helper
+ {
+ ///
+ /// Converts an to a of the specified .
+ ///
+ /// The type of to convert to.
+ /// The value to convert from.
+ /// The converted value.
+ private static void Convert(IntPtr from, out THandle to)
+ where THandle : Handle, new()
+ {
+ to = null;
+
+ if (from != IntPtr.Zero)
+ {
+ to = new THandle();
+ to.InnerHandle = from;
+ }
+ }
+
+ ///
+ /// Converts a to an .
+ ///
+ /// The value to convert from.
+ /// The converted value.
+ private static void Convert(Handle from, out IntPtr to)
+ {
+ to = IntPtr.Zero;
+
+ if (from != null)
+ {
+ to = from.InnerHandle;
+ }
+ }
+
+ ///
+ /// Converts from a [] to a .
+ ///
+ /// The value to convert from.
+ /// The converted value.
+ private static void Convert(byte[] from, out string to)
+ {
+ to = null;
+
+ if (from == null)
+ {
+ return;
+ }
+
+ to = Encoding.ASCII.GetString(from.Take(GetAnsiStringLength(from)).ToArray());
+ }
+
+ ///
+ /// Converts from a of the specified length to a [].
+ ///
+ /// The value to convert from.
+ /// The length to convert from.
+ /// The converted value.
+ private static void Convert(string from, out byte[] to, int fromLength)
+ {
+ if (from == null)
+ {
+ from = "";
+ }
+
+ to = Encoding.ASCII.GetBytes(new string(from.Take(fromLength).ToArray()).PadRight(fromLength, '\0'));
+ }
+
+ ///
+ /// Converts from a [] to an .
+ /// Outputs the length of the [].
+ ///
+ /// The type of to convert from.
+ /// The value to convert from.
+ /// The converted value; the length of the [].
+ private static void Convert(TArray[] from, out int to)
+ {
+ to = 0;
+
+ if (from != null)
+ {
+ to = from.Length;
+ }
+ }
+
+ ///
+ /// Converts from a [] to an .
+ /// Outputs the length of the [].
+ ///
+ /// The type of to convert from.
+ /// The value to convert from.
+ /// The converted value; the length of the [].
+ private static void Convert(TArray[] from, out uint to)
+ {
+ to = 0;
+
+ if (from != null)
+ {
+ to = (uint)from.Length;
+ }
+ }
+
+ ///
+ /// Converts from an to an .
+ /// Outputs the length of the .
+ ///
+ /// The type of the .
+ /// The value to convert from.
+ /// The converted value; the length of the .
+ private static void Convert(ArraySegment from, out int to)
+ {
+ to = from.Count;
+ }
+
+ ///
+ /// Converts from an to an .
+ /// Outputs the length of the .
+ ///
+ /// The type of the .
+ /// The value to convert from.
+ /// The converted value; the length of the .
+ private static void Convert(ArraySegment from, out uint to)
+ {
+ to = (uint)from.Count;
+ }
+
+ ///
+ /// Converts from an to a .
+ ///
+ /// The value to convert from.
+ /// The converted value.
+ private static void Convert(int from, out bool to)
+ {
+ to = from != 0;
+ }
+
+ ///
+ /// Converts from an to an .
+ ///
+ /// The value to convert from.
+ /// The converted value.
+ private static void Convert(bool from, out int to)
+ {
+ to = from ? 1 : 0;
+ }
+
+ ///
+ /// Converts from a ? to a .
+ /// Outputs the number of seconds represented by the ? as a unix timestamp.
+ /// A ? equates to a value of -1, which means unset in the SDK.
+ ///
+ /// The value to convert from.
+ /// The converted value.
+ private static void Convert(DateTimeOffset? from, out long to)
+ {
+ to = -1;
+
+ if (from.HasValue)
+ {
+ DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ long unixTimestampTicks = (from.Value.UtcDateTime - unixStart).Ticks;
+ long unixTimestampSeconds = unixTimestampTicks / TimeSpan.TicksPerSecond;
+ to = unixTimestampSeconds;
+ }
+ }
+
+ ///
+ /// Converts from a to a ?.
+ ///
+ /// The value to convert from.
+ /// The converted value.
+ private static void Convert(long from, out DateTimeOffset? to)
+ {
+ to = null;
+
+ if (from >= 0)
+ {
+ DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
+ long unixTimeStampTicks = from * TimeSpan.TicksPerSecond;
+ to = new DateTimeOffset(unixStart.Ticks + unixTimeStampTicks, TimeSpan.Zero);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/HelperExtensions.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Extensions.cs
similarity index 84%
rename from Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/HelperExtensions.cs
rename to Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Extensions.cs
index b7e79cfa..26dede25 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/HelperExtensions.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Extensions.cs
@@ -1,27 +1,28 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-namespace Epic.OnlineServices
-{
- public static class HelperExtensions
- {
- ///
- /// Checks whether the given result indicates that the operation has completed. Some operations may callback with a result indicating that they will callback again.
- ///
- /// The result to check.
- /// Whether the operation has completed or not.
- public static bool IsOperationComplete(this Result result)
- {
- return Common.IsOperationComplete(result);
- }
-
- ///
- /// Converts a byte array into a hex string, e.g. "A56904FF".
- ///
- /// The byte array to convert.
- /// A hex string, e.g. "A56904FF".
- public static string ToHexString(this byte[] byteArray)
- {
- return Common.ToString(byteArray);
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+namespace Epic.OnlineServices
+{
+ public static class Extensions
+ {
+ ///
+ /// Checks whether the given result indicates that the operation has completed. Some operations may callback with a result indicating that they will callback again.
+ ///
+ /// The result to check.
+ /// Whether the operation has completed or not.
+ public static bool IsOperationComplete(this Result result)
+ {
+ return Common.IsOperationComplete(result);
+ }
+
+ ///
+ /// Converts a byte array into a hex string, e.g. "A56904FF".
+ ///
+ /// The byte array to convert.
+ /// A hex string, e.g. "A56904FF".
+ public static string ToHexString(this byte[] byteArray)
+ {
+ var segment = new System.ArraySegment(byteArray);
+ return Common.ToString(segment);
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/GetHelper.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/GetHelper.cs
new file mode 100644
index 00000000..a6dd9eb8
--- /dev/null
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/GetHelper.cs
@@ -0,0 +1,261 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Epic.OnlineServices
+{
+ public sealed partial class Helper
+ {
+ internal static void Get(TArray[] from, out int to)
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Get(TArray[] from, out uint to)
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Get(ArraySegment from, out uint to)
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Get(IntPtr from, out TTo to)
+ where TTo : Handle, new()
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Get(ref TFrom from, out TTo to)
+ where TFrom : struct, IGettable
+ where TTo : struct
+ {
+ from.Get(out to);
+ }
+
+ internal static void Get(int from, out bool to)
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Get(bool from, out int to)
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Get(long from, out DateTimeOffset? to)
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Get(IntPtr from, out TTo[] to, int arrayLength, bool isArrayItemAllocated)
+ {
+ GetAllocation(from, out to, arrayLength, isArrayItemAllocated);
+ }
+
+ internal static void Get(IntPtr from, out TTo[] to, uint arrayLength, bool isArrayItemAllocated)
+ {
+ GetAllocation(from, out to, (int)arrayLength, isArrayItemAllocated);
+ }
+
+ internal static void Get(IntPtr from, out TTo[] to, int arrayLength)
+ {
+ GetAllocation(from, out to, arrayLength, !typeof(TTo).IsValueType);
+ }
+
+ internal static void Get(IntPtr from, out TTo[] to, uint arrayLength)
+ {
+ GetAllocation(from, out to, (int)arrayLength, !typeof(TTo).IsValueType);
+ }
+
+ internal static void Get(IntPtr from, out ArraySegment to, uint arrayLength)
+ {
+ to = new ArraySegment();
+ if (arrayLength != 0)
+ {
+ byte[] bytes = new byte[arrayLength];
+ Marshal.Copy(from, bytes, 0, (int)arrayLength);
+ to = new ArraySegment(bytes);
+ }
+ }
+
+ internal static void GetHandle(IntPtr from, out THandle[] to, uint arrayLength)
+ where THandle : Handle, new()
+ {
+ GetAllocation(from, out to, (int)arrayLength);
+ }
+
+ internal static void Get(TFrom[] from, out TTo[] to)
+ where TFrom : struct, IGettable
+ where TTo : struct
+ {
+ to = GetDefault();
+
+ if (from != null)
+ {
+ to = new TTo[from.Length];
+
+ for (int index = 0; index < from.Length; ++index)
+ {
+ from[index].Get(out to[index]);
+ }
+ }
+ }
+
+ internal static void Get(IntPtr from, out TTo[] to, int arrayLength)
+ where TFrom : struct, IGettable
+ where TTo : struct
+ {
+ TFrom[] fromIntermediate;
+ Get(from, out fromIntermediate, arrayLength);
+ Get(fromIntermediate, out to);
+ }
+
+ internal static void Get(IntPtr from, out TTo[] to, uint arrayLength)
+ where TFrom : struct, IGettable
+ where TTo : struct
+ {
+ Get(from, out to, (int)arrayLength);
+ }
+
+ internal static void Get(IntPtr from, out TTo? to)
+ where TTo : struct
+ {
+ GetAllocation(from, out to);
+ }
+
+ internal static void Get(byte[] from, out string to)
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Get(IntPtr from, out object to)
+ {
+ to = GetClientData(from);
+ }
+
+ internal static void Get(IntPtr from, out Utf8String to)
+ {
+ GetAllocation(from, out to);
+ }
+
+ internal static void Get(T from, out T to, TEnum currentEnum, TEnum expectedEnum)
+ {
+ to = GetDefault();
+
+ if ((int)(object)currentEnum == (int)(object)expectedEnum)
+ {
+ to = from;
+ }
+ }
+
+ internal static void Get(ref TFrom from, out TTo to, TEnum currentEnum, TEnum expectedEnum)
+ where TFrom : struct, IGettable
+ where TTo : struct
+ {
+ to = GetDefault();
+
+ if ((int)(object)currentEnum == (int)(object)expectedEnum)
+ {
+ Get(ref from, out to);
+ }
+ }
+
+ internal static void Get(int from, out bool? to, TEnum currentEnum, TEnum expectedEnum)
+ {
+ to = GetDefault();
+
+ if ((int)(object)currentEnum == (int)(object)expectedEnum)
+ {
+ bool fromIntermediate;
+ Convert(from, out fromIntermediate);
+ to = fromIntermediate;
+ }
+ }
+
+ internal static void Get(TFrom from, out TFrom? to, TEnum currentEnum, TEnum expectedEnum)
+ where TFrom : struct
+ {
+ to = GetDefault();
+
+ if ((int)(object)currentEnum == (int)(object)expectedEnum)
+ {
+ to = from;
+ }
+ }
+
+ internal static void Get(IntPtr from, out TFrom to, TEnum currentEnum, TEnum expectedEnum)
+ where TFrom : Handle, new()
+ {
+ to = GetDefault();
+
+ if ((int)(object)currentEnum == (int)(object)expectedEnum)
+ {
+ Get(from, out to);
+ }
+ }
+
+ internal static void Get(IntPtr from, out IntPtr? to, TEnum currentEnum, TEnum expectedEnum)
+ {
+ to = GetDefault();
+
+ if ((int)(object)currentEnum == (int)(object)expectedEnum)
+ {
+ Get(from, out to);
+ }
+ }
+
+ internal static void Get(IntPtr from, out Utf8String to, TEnum currentEnum, TEnum expectedEnum)
+ {
+ to = GetDefault();
+
+ if ((int)(object)currentEnum == (int)(object)expectedEnum)
+ {
+ Get(from, out to);
+ }
+ }
+
+ internal static void Get(IntPtr from, out TTo to)
+ where TFrom : struct, IGettable
+ where TTo : struct
+ {
+ to = GetDefault();
+
+ TFrom? fromIntermediate;
+ Get(from, out fromIntermediate);
+
+ if (fromIntermediate.HasValue)
+ {
+ fromIntermediate.Value.Get(out to);
+ }
+ }
+
+ internal static void Get(IntPtr from, out TTo? to)
+ where TFrom : struct, IGettable
+ where TTo : struct
+ {
+ to = GetDefault();
+
+ TFrom? fromIntermediate;
+ Get(from, out fromIntermediate);
+
+ if (fromIntermediate.HasValue)
+ {
+ TTo toIntermediate;
+ fromIntermediate.Value.Get(out toIntermediate);
+
+ to = toIntermediate;
+ }
+ }
+
+ internal static void Get(ref TFrom from, out TTo to, out IntPtr clientDataAddress)
+ where TFrom : struct, ICallbackInfoInternal, IGettable
+ where TTo : struct
+ {
+ from.Get(out to);
+ clientDataAddress = from.ClientDataAddress;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Handle.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Handle.cs
index cd0ec762..62c59358 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Handle.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Handle.cs
@@ -1,70 +1,94 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-using System;
-
-namespace Epic.OnlineServices
-{
- public abstract class Handle : IEquatable
- {
- public IntPtr InnerHandle { get; internal set; }
-
- public Handle()
- {
- }
-
- public Handle(IntPtr innerHandle)
- {
- InnerHandle = innerHandle;
- }
-
- public override bool Equals(object obj)
- {
- return Equals(obj as Handle);
- }
-
- public override int GetHashCode()
- {
- return (int)(0x00010000 + InnerHandle.ToInt64());
- }
-
- public bool Equals(Handle other)
- {
- if (ReferenceEquals(other, null))
- {
- return false;
- }
-
- if (ReferenceEquals(this, other))
- {
- return true;
- }
-
- if (GetType() != other.GetType())
- {
- return false;
- }
-
- return InnerHandle == other.InnerHandle;
- }
-
- public static bool operator ==(Handle lhs, Handle rhs)
- {
- if (ReferenceEquals(lhs, null))
- {
- if (ReferenceEquals(rhs, null))
- {
- return true;
- }
-
- return false;
- }
-
- return lhs.Equals(rhs);
- }
-
- public static bool operator !=(Handle lhs, Handle rhs)
- {
- return !(lhs == rhs);
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+using System;
+
+namespace Epic.OnlineServices
+{
+ ///
+ /// Represents an SDK handle.
+ ///
+ public abstract class Handle : IEquatable, IFormattable
+ {
+ public IntPtr InnerHandle { get; internal set; }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public Handle()
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class with the given inner handle.
+ ///
+ public Handle(IntPtr innerHandle)
+ {
+ InnerHandle = innerHandle;
+ }
+
+ public static bool operator ==(Handle left, Handle right)
+ {
+ if (ReferenceEquals(left, null))
+ {
+ if (ReferenceEquals(right, null))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ return left.Equals(right);
+ }
+
+ public static bool operator !=(Handle left, Handle right)
+ {
+ return !(left == right);
+ }
+
+ public override bool Equals(object obj)
+ {
+ return Equals(obj as Handle);
+ }
+
+ public override int GetHashCode()
+ {
+ return (int)(0x00010000 + InnerHandle.ToInt64());
+ }
+
+ public bool Equals(Handle other)
+ {
+ if (ReferenceEquals(other, null))
+ {
+ return false;
+ }
+
+ if (ReferenceEquals(this, other))
+ {
+ return true;
+ }
+
+ if (GetType() != other.GetType())
+ {
+ return false;
+ }
+
+ return InnerHandle == other.InnerHandle;
+ }
+
+ public override string ToString()
+ {
+ return InnerHandle.ToString();
+ }
+
+ public virtual string ToString(string format, IFormatProvider formatProvider)
+ {
+ if (format != null)
+ {
+ return InnerHandle.ToString(format);
+ }
+
+ return InnerHandle.ToString();
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Handle.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Handle.cs.meta
deleted file mode 100644
index 8d588ab5..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Handle.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 891c2d4ec1d130049ba03dfbec6aefa6
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Helper.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Helper.cs
index 4023211b..8a44dd63 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Helper.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Helper.cs
@@ -1,1441 +1,659 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace Epic.OnlineServices
-{
- internal class AllocationException : Exception
- {
- public AllocationException(string message)
- : base(message)
- {
- }
- }
-
- internal class ExternalAllocationException : AllocationException
- {
- public ExternalAllocationException(IntPtr address, Type type)
- : base(string.Format("Attempting to allocate '{0}' over externally allocated memory at {1}", type, address.ToString("X")))
- {
- }
- }
-
- internal class CachedTypeAllocationException : AllocationException
- {
- public CachedTypeAllocationException(IntPtr address, Type foundType, Type expectedType)
- : base(string.Format("Cached allocation is '{0}' but expected '{1}' at {2}", foundType, expectedType, address.ToString("X")))
- {
- }
- }
-
- internal class CachedArrayAllocationException : AllocationException
- {
- public CachedArrayAllocationException(IntPtr address, int foundLength, int expectedLength)
- : base(string.Format("Cached array allocation has length {0} but expected {1} at {2}", foundLength, expectedLength, address.ToString("X")))
- {
- }
- }
-
- internal class DynamicBindingException : Exception
- {
- public DynamicBindingException(string bindingName)
- : base(string.Format("Failed to hook dynamic binding for '{0}'", bindingName))
- {
- }
- }
-
- public static class Helper
- {
- internal class Allocation
- {
- public int Size { get; private set; }
-
- public object CachedData { get; private set; }
-
- public bool? IsCachedArrayElementAllocated { get; private set; }
-
- public Allocation(int size)
- {
- Size = size;
- }
-
- public void SetCachedData(object data, bool? isCachedArrayElementAllocated = null)
- {
- CachedData = data;
- IsCachedArrayElementAllocated = isCachedArrayElementAllocated;
- }
- }
-
- private class DelegateHolder
- {
- public Delegate Public { get; private set; }
- public Delegate Private { get; private set; }
- public Delegate[] StructDelegates { get; private set; }
- public ulong? NotificationId { get; set; }
-
- public DelegateHolder(Delegate publicDelegate, Delegate privateDelegate, params Delegate[] structDelegates)
- {
- Public = publicDelegate;
- Private = privateDelegate;
- StructDelegates = structDelegates;
- }
- }
-
- private static Dictionary s_Allocations = new Dictionary();
- private static Dictionary s_Callbacks = new Dictionary();
- private static Dictionary s_StaticCallbacks = new Dictionary();
-
- ///
- /// Gets the number of unmanaged allocations currently active within the wrapper. Use this to find leaks related to the usage of wrapper code.
- ///
- /// The number of unmanaged allocations currently active within the wrapper.
- public static int GetAllocationCount()
- {
- return s_Allocations.Count;
- }
-
- // These functions are the front end when changing SDK values into wrapper values.
- // They will either fetch or convert; whichever is most appropriate for the source and target types.
-#region Marshal Getters
- internal static bool TryMarshalGet(T[] source, out uint target)
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalGet(IntPtr source, out T target)
- where T : Handle, new()
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalGet(TSource source, out TTarget target)
- where TTarget : ISettable, new()
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalGet(int source, out bool target)
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalGet(bool source, out int target)
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalGet(long source, out DateTimeOffset? target)
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalGet(IntPtr source, out T[] target, int arrayLength, bool isElementAllocated)
- {
- return TryFetch(source, out target, arrayLength, isElementAllocated);
- }
-
- internal static bool TryMarshalGet(IntPtr source, out T[] target, uint arrayLength, bool isElementAllocated)
- {
- return TryFetch(source, out target, (int)arrayLength, isElementAllocated);
- }
-
- internal static bool TryMarshalGet(IntPtr source, out T[] target, int arrayLength)
- {
- return TryMarshalGet(source, out target, arrayLength, !typeof(T).IsValueType);
- }
-
- internal static bool TryMarshalGet(IntPtr source, out T[] target, uint arrayLength)
- {
- return TryMarshalGet(source, out target, arrayLength, !typeof(T).IsValueType);
- }
-
- internal static bool TryMarshalGet(TSource[] source, out TTarget[] target)
- where TSource : struct
- where TTarget : class, ISettable, new()
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalGet(IntPtr source, out TTarget[] target, int arrayLength)
- where TSource : struct
- where TTarget : class, ISettable, new()
- {
- target = GetDefault();
-
- TSource[] intermediateSource;
- if (TryMarshalGet(source, out intermediateSource, arrayLength))
- {
- return TryMarshalGet(intermediateSource, out target);
- }
-
- return false;
- }
-
- internal static bool TryMarshalGet(IntPtr source, out TTarget[] target, uint arrayLength)
- where TSource : struct
- where TTarget : class, ISettable, new()
- {
- int arrayLengthInt = (int)arrayLength;
- return TryMarshalGet(source, out target, arrayLengthInt);
- }
-
- internal static bool TryMarshalGet(IntPtr source, out T? target)
- where T : struct
- {
- return TryFetch(source, out target);
- }
-
- internal static bool TryMarshalGet(byte[] source, out string target)
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalGet(IntPtr source, out object target)
- {
- target = null;
-
- BoxedData boxedData;
- if (TryFetch(source, out boxedData))
- {
- target = boxedData.Data;
- return true;
- }
-
- return false;
- }
-
- internal static bool TryMarshalGet(IntPtr source, out string target)
- {
- return TryFetch(source, out target);
- }
-
- internal static bool TryMarshalGet(T source, out T target, TEnum currentEnum, TEnum comparisonEnum)
- {
- target = GetDefault();
-
- if ((int)(object)currentEnum == (int)(object)comparisonEnum)
- {
- target = source;
- return true;
- }
-
- return false;
- }
-
- internal static bool TryMarshalGet(ISettable source, out TTarget target, TEnum currentEnum, TEnum comparisonEnum)
- where TTarget : ISettable, new()
- {
- target = GetDefault();
-
- if ((int)(object)currentEnum == (int)(object)comparisonEnum)
- {
- return TryConvert(source, out target);
- }
-
- return false;
- }
-
- internal static bool TryMarshalGet(int source, out bool? target, TEnum currentEnum, TEnum comparisonEnum)
- {
- target = GetDefault();
-
- if ((int)(object)currentEnum == (int)(object)comparisonEnum)
- {
- bool targetConvert;
- if (TryConvert(source, out targetConvert))
- {
- target = targetConvert;
- return true;
- }
- }
-
- return false;
- }
-
- internal static bool TryMarshalGet(T source, out T? target, TEnum currentEnum, TEnum comparisonEnum)
- where T : struct
- {
- target = GetDefault();
-
- if ((int)(object)currentEnum == (int)(object)comparisonEnum)
- {
- target = source;
- return true;
- }
-
- return false;
- }
-
- internal static bool TryMarshalGet(IntPtr source, out T target, TEnum currentEnum, TEnum comparisonEnum)
- where T : Handle, new()
- {
- target = GetDefault();
-
- if ((int)(object)currentEnum == (int)(object)comparisonEnum)
- {
- return TryMarshalGet(source, out target);
- }
-
- return false;
- }
-
- internal static bool TryMarshalGet(IntPtr source, out IntPtr? target, TEnum currentEnum, TEnum comparisonEnum)
- {
- target = GetDefault();
-
- if ((int)(object)currentEnum == (int)(object)comparisonEnum)
- {
- return TryMarshalGet(source, out target);
- }
-
- return false;
- }
-
- internal static bool TryMarshalGet(IntPtr source, out string target, TEnum currentEnum, TEnum comparisonEnum)
- {
- target = GetDefault();
-
- if ((int)(object)currentEnum == (int)(object)comparisonEnum)
- {
- return TryMarshalGet(source, out target);
- }
-
- return false;
- }
-
- internal static bool TryMarshalGet(IntPtr source, out TPublic target)
- where TInternal : struct
- where TPublic : class, ISettable, new()
- {
- target = GetDefault();
-
- TInternal? targetInternal;
- if (TryMarshalGet(source, out targetInternal))
- {
- if (targetInternal.HasValue)
- {
- target = new TPublic();
- target.Set(targetInternal);
-
- return true;
- }
- }
-
- return false;
- }
-
- internal static bool TryMarshalGet(IntPtr callbackInfoAddress, out TCallbackInfo callbackInfo, out IntPtr clientDataAddress)
- where TCallbackInfoInternal : struct, ICallbackInfoInternal
- where TCallbackInfo : class, ISettable, new()
- {
- callbackInfo = null;
- clientDataAddress = IntPtr.Zero;
-
- TCallbackInfoInternal callbackInfoInternal;
- if (TryFetch(callbackInfoAddress, out callbackInfoInternal))
- {
- callbackInfo = new TCallbackInfo();
- callbackInfo.Set(callbackInfoInternal);
- clientDataAddress = callbackInfoInternal.ClientDataAddress;
-
- return true;
- }
-
- return false;
- }
-#endregion
-
- // These functions are the front end for changing wrapper values into SDK values.
- // They will either allocate or convert; whichever is most appropriate for the source and target types.
-#region Marshal Setters
- internal static bool TryMarshalSet(ref T target, T source)
- {
- target = source;
-
- return true;
- }
-
- internal static bool TryMarshalSet(ref TTarget target, object source)
- where TTarget : ISettable, new()
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, Handle source)
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, T? source)
- where T : struct
- {
- return TryAllocate(ref target, source);
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, T[] source, bool isElementAllocated)
- {
- return TryAllocate(ref target, source, isElementAllocated);
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, T[] source)
- {
- return TryMarshalSet(ref target, source, !typeof(T).IsValueType);
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, T[] source, out int arrayLength, bool isElementAllocated)
- {
- arrayLength = 0;
-
- if (TryMarshalSet(ref target, source, isElementAllocated))
- {
- arrayLength = source.Length;
- return true;
- }
-
- return false;
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, T[] source, out uint arrayLength, bool isElementAllocated)
- {
- arrayLength = 0;
-
- int arrayLengthInternal = 0;
- if (TryMarshalSet(ref target, source, out arrayLengthInternal, isElementAllocated))
- {
- arrayLength = (uint)arrayLengthInternal;
- return true;
- }
-
- return false;
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, T[] source, out uint arrayLength)
- {
- return TryMarshalSet(ref target, source, out arrayLength, !typeof(T).IsValueType);
- }
-
- internal static bool TryMarshalSet(ref long target, DateTimeOffset? source)
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalSet(ref int target, bool source)
- {
- return TryConvert(source, out target);
- }
-
- internal static bool TryMarshalSet(ref byte[] target, string source, int length)
- {
- return TryConvert(source, out target, length);
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, string source)
- {
- return TryAllocate(ref target, source);
- }
-
- internal static bool TryMarshalSet(ref T target, T source, ref TEnum currentEnum, TEnum comparisonEnum, IDisposable disposable = null)
- {
- if (source != null)
- {
- TryMarshalDispose(ref disposable);
-
- if (TryMarshalSet(ref target, source))
- {
- currentEnum = comparisonEnum;
- return true;
- }
- }
-
- return false;
- }
-
- internal static bool TryMarshalSet(ref TTarget target, ISettable source, ref TEnum currentEnum, TEnum comparisonEnum, IDisposable disposable = null)
- where TTarget : ISettable, new()
- {
- if (source != null)
- {
- TryMarshalDispose(ref disposable);
-
- if (TryConvert(source, out target))
- {
- currentEnum = comparisonEnum;
- return true;
- }
- }
-
- return false;
- }
-
- internal static bool TryMarshalSet(ref T target, T? source, ref TEnum currentEnum, TEnum comparisonEnum, IDisposable disposable = null)
- where T : struct
- {
- if (source != null)
- {
- TryMarshalDispose(ref disposable);
-
- if (TryMarshalSet(ref target, source.Value))
- {
- currentEnum = comparisonEnum;
- return true;
- }
- }
-
- return true;
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, Handle source, ref TEnum currentEnum, TEnum comparisonEnum, IDisposable disposable = null)
- {
- if (source != null)
- {
- TryMarshalDispose(ref disposable);
-
- if (TryMarshalSet(ref target, source))
- {
- currentEnum = comparisonEnum;
- return true;
- }
- }
-
- return true;
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, string source, ref TEnum currentEnum, TEnum comparisonEnum, IDisposable disposable = null)
- {
- if (source != null)
- {
- TryMarshalDispose(ref target);
- target = IntPtr.Zero;
-
- TryMarshalDispose(ref disposable);
-
- if (TryMarshalSet(ref target, source))
- {
- currentEnum = comparisonEnum;
- return true;
- }
- }
-
- return true;
- }
-
- internal static bool TryMarshalSet(ref int target, bool? source, ref TEnum currentEnum, TEnum comparisonEnum, IDisposable disposable = null)
- {
- if (source != null)
- {
- TryMarshalDispose(ref disposable);
-
- if (TryMarshalSet(ref target, source.Value))
- {
- currentEnum = comparisonEnum;
- return true;
- }
- }
-
- return true;
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, TPublic source)
- where TInternal : struct, ISettable
- where TPublic : class
- {
- if (source != null)
- {
- TInternal targetInternal = new TInternal();
- targetInternal.Set(source);
-
- if (TryAllocate(ref target, targetInternal))
- {
- return true;
- }
- }
-
- return false;
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, TPublic[] source, out int arrayLength)
- where TInternal : struct, ISettable
- where TPublic : class
- {
- arrayLength = 0;
-
- if (source != null)
- {
- TInternal[] targetInternal = new TInternal[source.Length];
- for (int index = 0; index < source.Length; ++index)
- {
- targetInternal[index].Set(source[index]);
- }
-
- if (TryMarshalSet(ref target, targetInternal))
- {
- arrayLength = source.Length;
- return true;
- }
-
- }
-
- return false;
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, TPublic[] source, out uint arrayLength)
- where TInternal : struct, ISettable
- where TPublic : class
- {
- arrayLength = 0;
-
- int arrayLengthInt;
- if (TryMarshalSet(ref target, source, out arrayLengthInt))
- {
- arrayLength = (uint)arrayLengthInt;
- return true;
- }
-
- return false;
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, TPublic[] source, out int arrayLength, bool isElementAllocated)
- where TInternal : struct, ISettable
- where TPublic : class
- {
- arrayLength = 0;
-
- if (source != null)
- {
- TInternal[] targetInternal = new TInternal[source.Length];
- for (int index = 0; index < source.Length; ++index)
- {
- targetInternal[index].Set(source[index]);
- }
-
- if (TryMarshalSet(ref target, targetInternal, isElementAllocated))
- {
- arrayLength = source.Length;
- return true;
- }
-
- }
-
- return false;
- }
-
- internal static bool TryMarshalSet(ref IntPtr target, TPublic[] source, out uint arrayLength, bool isElementAllocated)
- where TInternal : struct, ISettable
- where TPublic : class
- {
- arrayLength = 0;
-
- int arrayLengthInt;
- if (TryMarshalSet(ref target, source, out arrayLengthInt, isElementAllocated))
- {
- arrayLength = (uint)arrayLengthInt;
- return true;
- }
-
- return false;
- }
-
- internal static bool TryMarshalCopy(IntPtr target, byte[] source)
- {
- if (target != IntPtr.Zero && source != null)
- {
- Marshal.Copy(source, 0, target, source.Length);
- return true;
- }
-
- return false;
- }
-
- internal static bool TryMarshalAllocate(ref IntPtr target, int size, out Allocation allocation)
- {
- TryMarshalDispose(ref target);
-
- target = Marshal.AllocHGlobal(size);
- Marshal.WriteByte(target, 0, 0);
-
- allocation = new Allocation(size);
- s_Allocations.Add(target, allocation);
-
- return true;
- }
-
- internal static bool TryMarshalAllocate(ref IntPtr target, uint size, out Allocation allocation)
- {
- return TryMarshalAllocate(ref target, (int)size, out allocation);
- }
-#endregion
-
- // These functions are the front end for disposing of unmanaged memory that this wrapper has allocated.
-#region Marshal Disposers
- internal static bool TryMarshalDispose(ref TDisposable disposable)
- where TDisposable : IDisposable
- {
- if (disposable != null)
- {
- disposable.Dispose();
- return true;
- }
-
- return false;
- }
-
- internal static bool TryMarshalDispose(ref IntPtr value)
- {
- return TryRelease(ref value);
- }
-
- internal static bool TryMarshalDispose(ref IntPtr member, TEnum currentEnum, TEnum comparisonEnum)
- {
- if ((int)(object)currentEnum == (int)(object)comparisonEnum)
- {
- return TryRelease(ref member);
- }
-
- return false;
- }
-#endregion
-
- // These functions are exposed to the wrapper to generally streamline blocks of generated code.
-#region Helpers
- internal static T GetDefault()
- {
- return default(T);
- }
-
- internal static void AddCallback(ref IntPtr clientDataAddress, object clientData, Delegate publicDelegate, Delegate privateDelegate, params Delegate[] structDelegates)
- {
- TryAllocateCacheOnly(ref clientDataAddress, new BoxedData(clientData));
- s_Callbacks.Add(clientDataAddress, new DelegateHolder(publicDelegate, privateDelegate, structDelegates));
- }
-
- internal static void AddStaticCallback(string key, Delegate publicDelegate, Delegate privateDelegate)
- {
- s_StaticCallbacks[key] = new DelegateHolder(publicDelegate, privateDelegate);
- }
-
- internal static bool TryAssignNotificationIdToCallback(IntPtr clientDataAddress, ulong notificationId)
- {
- if (notificationId != 0)
- {
- DelegateHolder delegateHolder = null;
- if (s_Callbacks.TryGetValue(clientDataAddress, out delegateHolder))
- {
- delegateHolder.NotificationId = notificationId;
- return true;
- }
- }
- // We can safely release if the notification id came back invalid
- else
- {
- s_Callbacks.Remove(clientDataAddress);
- TryRelease(ref clientDataAddress);
- }
-
- return false;
- }
-
- internal static bool TryRemoveCallbackByNotificationId(ulong notificationId)
- {
- var delegateHolderPairs = s_Callbacks.Where(pair => pair.Value.NotificationId.HasValue && pair.Value.NotificationId == notificationId);
- if (delegateHolderPairs.Any())
- {
- IntPtr clientDataAddress = delegateHolderPairs.First().Key;
-
- s_Callbacks.Remove(clientDataAddress);
- TryRelease(ref clientDataAddress);
-
- return true;
- }
-
- return false;
- }
-
- internal static bool TryGetAndRemoveCallback(IntPtr callbackInfoAddress, out TCallback callback, out TCallbackInfo callbackInfo)
- where TCallback : class
- where TCallbackInfoInternal : struct, ICallbackInfoInternal
- where TCallbackInfo : class, ICallbackInfo, ISettable, new()
- {
- callback = null;
- callbackInfo = null;
-
- IntPtr clientDataAddress = IntPtr.Zero;
- if (TryMarshalGet(callbackInfoAddress, out callbackInfo, out clientDataAddress)
- && TryGetAndRemoveCallback(clientDataAddress, callbackInfo, out callback))
- {
- return true;
- }
-
- return false;
- }
-
- internal static bool TryGetStructCallback(IntPtr callbackInfoAddress, out TDelegate callback, out TCallbackInfo callbackInfo)
- where TDelegate : class
- where TCallbackInfoInternal : struct, ICallbackInfoInternal
- where TCallbackInfo : class, ISettable, new()
- {
- callback = null;
- callbackInfo = null;
-
- IntPtr clientDataAddress = IntPtr.Zero;
- if (TryMarshalGet(callbackInfoAddress, out callbackInfo, out clientDataAddress)
- && TryGetStructCallback(clientDataAddress, out callback))
- {
- return true;
- }
-
- return false;
- }
-#endregion
-
- // These functions are used for allocating unmanaged memory.
- // They should not be exposed outside of this helper.
-#region Private Allocators
- private static bool TryAllocate(ref IntPtr target, T source)
- {
- TryRelease(ref target);
-
- if (target != IntPtr.Zero)
- {
- throw new ExternalAllocationException(target, source.GetType());
- }
-
- if (source == null)
- {
- return false;
- }
-
- Allocation allocation;
- if (!TryMarshalAllocate(ref target, Marshal.SizeOf(typeof(T)), out allocation))
- {
- return false;
- }
-
- allocation.SetCachedData(source);
- Marshal.StructureToPtr(source, target, false);
-
- return true;
- }
-
- private static bool TryAllocate(ref IntPtr target, T? source)
- where T : struct
- {
- TryRelease(ref target);
-
- if (target != IntPtr.Zero)
- {
- throw new ExternalAllocationException(target, source.GetType());
- }
-
- if (source == null)
- {
- return false;
- }
-
- return TryAllocate(ref target, source.Value);
- }
-
- private static bool TryAllocate(ref IntPtr target, string source)
- {
- TryRelease(ref target);
-
- if (target != IntPtr.Zero)
- {
- throw new ExternalAllocationException(target, source.GetType());
- }
-
- if (source == null)
- {
- return false;
- }
-
- byte[] bytes;
- if (TryConvert(source, out bytes))
- {
- return TryAllocate(ref target, bytes, false);
- }
-
- return false;
- }
-
- private static bool TryAllocate(ref IntPtr target, T[] source, bool isElementAllocated)
- {
- TryRelease(ref target);
-
- if (target != IntPtr.Zero)
- {
- throw new ExternalAllocationException(target, source.GetType());
- }
-
- if (source == null)
- {
- return false;
- }
-
- var itemSize = 0;
- if (isElementAllocated)
- {
- itemSize = Marshal.SizeOf(typeof(IntPtr));
- }
- else
- {
- itemSize = Marshal.SizeOf(typeof(T));
- }
-
- // Allocate the array
- Allocation allocation;
- if (!TryMarshalAllocate(ref target, source.Length * itemSize, out allocation))
- {
- return false;
- }
-
- allocation.SetCachedData(source, isElementAllocated);
-
- for (int itemIndex = 0; itemIndex < source.Length; ++itemIndex)
- {
- var item = (T)source.GetValue(itemIndex);
-
- if (isElementAllocated)
- {
- // Allocate the item
- IntPtr newItemAddress = IntPtr.Zero;
-
- if (typeof(T) == typeof(string))
- {
- TryAllocate(ref newItemAddress, (string)(object)item);
- }
- else if (typeof(T).BaseType == typeof(Handle))
- {
- TryConvert((Handle)(object)item, out newItemAddress);
- }
- else
- {
- TryAllocate(ref newItemAddress, item);
- }
-
- // Copy the item's address into the array
- IntPtr itemAddress = new IntPtr(target.ToInt64() + itemIndex * itemSize);
- Marshal.StructureToPtr(newItemAddress, itemAddress, false);
- }
- else
- {
- // Copy the data straight into memory
- IntPtr itemAddress = new IntPtr(target.ToInt64() + itemIndex * itemSize);
- Marshal.StructureToPtr(item, itemAddress, false);
- }
- }
-
- return true;
- }
-
- private static bool TryAllocateCacheOnly(ref IntPtr target, T source)
- {
- TryRelease(ref target);
-
- if (target != IntPtr.Zero)
- {
- throw new ExternalAllocationException(target, source.GetType());
- }
-
- if (source == null)
- {
- return false;
- }
-
- // The source should always be fetched directly from our cache, so the allocation is arbitrary.
- Allocation allocation;
- if (!TryMarshalAllocate(ref target, 1, out allocation))
- {
- return false;
- }
-
- allocation.SetCachedData(source);
-
- return true;
- }
-#endregion
-
- // These functions are used for releasing unmanaged memory.
- // They should not be exposed outside of this helper.
-#region Private Releasers
- private static bool TryRelease(ref IntPtr target)
- {
- if (target == IntPtr.Zero)
- {
- return false;
- }
-
- Allocation allocation = null;
- if (!s_Allocations.TryGetValue(target, out allocation))
- {
- return false;
- }
-
- if (allocation.IsCachedArrayElementAllocated.HasValue)
- {
- var itemSize = 0;
- if (allocation.IsCachedArrayElementAllocated.Value)
- {
- itemSize = Marshal.SizeOf(typeof(IntPtr));
- }
- else
- {
- itemSize = Marshal.SizeOf(allocation.CachedData.GetType().GetElementType());
- }
-
- var array = allocation.CachedData as Array;
-
- for (int itemIndex = 0; itemIndex < array.Length; ++itemIndex)
- {
- if (allocation.IsCachedArrayElementAllocated.Value)
- {
- var itemAddress = new IntPtr(target.ToInt64() + itemIndex * itemSize);
- itemAddress = Marshal.ReadIntPtr(itemAddress);
- TryRelease(ref itemAddress);
- }
- else
- {
- var item = array.GetValue(itemIndex);
- if (item is IDisposable)
- {
- var disposable = item as IDisposable;
- if (disposable != null)
- {
- disposable.Dispose();
- }
- }
- }
- }
- }
-
- if (allocation.CachedData is IDisposable)
- {
- var disposable = allocation.CachedData as IDisposable;
- if (disposable != null)
- {
- disposable.Dispose();
- }
- }
-
- Marshal.FreeHGlobal(target);
- s_Allocations.Remove(target);
- target = IntPtr.Zero;
-
- return true;
- }
-#endregion
-
- // These functions are used for fetching unmanaged memory.
- // They should not be exposed outside of this helper.
-#region Private Fetchers
- private static bool TryFetch(IntPtr source, out T target)
- {
- target = GetDefault();
-
- if (source == IntPtr.Zero)
- {
- return false;
- }
-
- // If this is an allocation containing cached data, we should be able to fetch it from the cache
- if (s_Allocations.ContainsKey(source))
- {
- Allocation allocation = s_Allocations[source];
- if (allocation.CachedData != null)
- {
- if (allocation.CachedData.GetType() == typeof(T))
- {
- target = (T)allocation.CachedData;
- return true;
- }
- else
- {
- throw new CachedTypeAllocationException(source, allocation.CachedData.GetType(), typeof(T));
- }
- }
- }
-
- target = (T)Marshal.PtrToStructure(source, typeof(T));
- return true;
- }
-
- private static bool TryFetch(IntPtr source, out T? target)
- where T : struct
- {
- target = GetDefault();
-
- if (source == IntPtr.Zero)
- {
- return false;
- }
-
- // If this is an allocation containing cached data, we should be able to fetch it from the cache
- if (s_Allocations.ContainsKey(source))
- {
- Allocation allocation = s_Allocations[source];
- if (allocation.CachedData != null)
- {
- if (allocation.CachedData.GetType() == typeof(T))
- {
- target = (T?)allocation.CachedData;
- return true;
- }
- else
- {
- throw new CachedTypeAllocationException(source, allocation.CachedData.GetType(), typeof(T));
- }
- }
- }
-
- target = (T?)Marshal.PtrToStructure(source, typeof(T));
- return true;
- }
-
- private static bool TryFetch(IntPtr source, out T[] target, int arrayLength, bool isElementAllocated)
- {
- target = null;
-
- if (source == IntPtr.Zero)
- {
- return false;
- }
-
- // If this is an allocation containing cached data, we should be able to fetch it from the cache
- if (s_Allocations.ContainsKey(source))
- {
- Allocation allocation = s_Allocations[source];
- if (allocation.CachedData != null)
- {
- if (allocation.CachedData.GetType() == typeof(T[]))
- {
- var cachedArray = (Array)allocation.CachedData;
- if (cachedArray.Length == arrayLength)
- {
- target = cachedArray as T[];
- return true;
- }
- else
- {
- throw new CachedArrayAllocationException(source, cachedArray.Length, arrayLength);
- }
- }
- else
- {
- throw new CachedTypeAllocationException(source, allocation.CachedData.GetType(), typeof(T[]));
- }
- }
- }
-
- var itemSize = 0;
- if (isElementAllocated)
- {
- itemSize = Marshal.SizeOf(typeof(IntPtr));
- }
- else
- {
- itemSize = Marshal.SizeOf(typeof(T));
- }
-
- List items = new List();
- for (int itemIndex = 0; itemIndex < arrayLength; ++itemIndex)
- {
- IntPtr itemAddress = new IntPtr(source.ToInt64() + itemIndex * itemSize);
-
- if (isElementAllocated)
- {
- itemAddress = Marshal.ReadIntPtr(itemAddress);
- }
-
- T item;
- TryFetch(itemAddress, out item);
- items.Add(item);
- }
-
- target = items.ToArray();
- return true;
- }
-
- private static bool TryFetch(IntPtr source, out string target)
- {
- target = null;
-
- if (source == IntPtr.Zero)
- {
- return false;
- }
-
- // Find the null terminator
- int length = 0;
- while (Marshal.ReadByte(source, length) != 0)
- {
- ++length;
- }
-
- byte[] bytes = new byte[length];
- Marshal.Copy(source, bytes, 0, length);
-
- target = Encoding.UTF8.GetString(bytes);
-
- return true;
- }
-#endregion
-
- // These functions are used for converting managed memory.
- // They should not be exposed outside of this helper.
-#region Private Converters
- private static bool TryConvert(IntPtr source, out THandle target)
- where THandle : Handle, new()
- {
- target = null;
-
- if (source != IntPtr.Zero)
- {
- target = new THandle();
- target.InnerHandle = source;
- }
-
- return true;
- }
-
- internal static bool TryConvert(TSource source, out TTarget target)
- where TTarget : ISettable, new()
- {
- target = GetDefault();
-
- if (source != null)
- {
- target = new TTarget();
- target.Set(source);
- }
-
- return true;
- }
-
- private static bool TryConvert(Handle source, out IntPtr target)
- {
- target = IntPtr.Zero;
-
- if (source != null)
- {
- target = source.InnerHandle;
- }
-
- return true;
- }
-
- private static bool TryConvert(byte[] source, out string target)
- {
- target = null;
-
- if (source == null)
- {
- return false;
- }
-
- int length = 0;
- foreach (byte currentByte in source)
- {
- if (currentByte == 0)
- {
- break;
- }
-
- ++length;
- }
-
- target = Encoding.UTF8.GetString(source.Take(length).ToArray());
-
- return true;
- }
-
- private static bool TryConvert(string source, out byte[] target, int length)
- {
- if (source == null)
- {
- source = "";
- }
-
- target = Encoding.UTF8.GetBytes(new string(source.Take(length).ToArray()).PadRight(length, '\0'));
-
- return true;
- }
-
- private static bool TryConvert(string source, out byte[] target)
- {
- return TryConvert(source, out target, source.Length + 1);
- }
-
- private static bool TryConvert(T[] source, out int target)
- {
- target = 0;
-
- if (source != null)
- {
- target = source.Length;
- }
-
- return true;
- }
-
- private static bool TryConvert(T[] source, out uint target)
- {
- target = 0;
-
- int targetInt;
- if (TryConvert(source, out targetInt))
- {
- target = (uint)targetInt;
- return true;
- }
-
- return false;
- }
-
- internal static bool TryConvert(TSource[] source, out TTarget[] target)
- where TTarget : ISettable, new()
- {
- target = GetDefault();
-
- if (source != null)
- {
- target = new TTarget[source.Length];
-
- for (int index = 0; index < source.Length; ++index)
- {
- target[index] = new TTarget();
- target[index].Set(source[index]);
- }
- }
-
- return true;
- }
-
- private static bool TryConvert(int source, out bool target)
- {
- target = source != 0;
-
- return true;
- }
-
- private static bool TryConvert(bool source, out int target)
- {
- target = source ? 1 : 0;
-
- return true;
- }
-
- private static bool TryConvert(DateTimeOffset? source, out long target)
- {
- target = -1;
-
- if (source.HasValue)
- {
- DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
- long unixTimestampTicks = (source.Value.UtcDateTime - unixStart).Ticks;
- long unixTimestampSeconds = unixTimestampTicks / TimeSpan.TicksPerSecond;
- target = unixTimestampSeconds;
- }
-
- return true;
- }
-
- private static bool TryConvert(long source, out DateTimeOffset? target)
- {
- target = null;
-
- if (source >= 0)
- {
- DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
- long unixTimeStampTicks = source * TimeSpan.TicksPerSecond;
- target = new DateTimeOffset(unixStart.Ticks + unixTimeStampTicks, TimeSpan.Zero);
- }
-
- return true;
- }
-#endregion
-
- // These functions exist to further streamline blocks of generated code.
-#region Private Helpers
- private static bool CanRemoveCallback(IntPtr clientDataAddress, TCallbackInfo callbackInfo)
- where TCallbackInfo : ICallbackInfo
- {
- DelegateHolder delegateHolder = null;
- if (s_Callbacks.TryGetValue(clientDataAddress, out delegateHolder))
- {
- if (delegateHolder.NotificationId.HasValue)
- {
- return false;
- }
- }
-
- if (callbackInfo.GetResultCode().HasValue)
- {
- return Common.IsOperationComplete(callbackInfo.GetResultCode().Value);
- }
-
- return true;
- }
-
- private static bool TryGetAndRemoveCallback(IntPtr clientDataAddress, TCallbackInfo callbackInfo, out TCallback callback)
- where TCallback : class
- where TCallbackInfo : ICallbackInfo
- {
- callback = null;
-
- if (clientDataAddress != IntPtr.Zero && s_Callbacks.ContainsKey(clientDataAddress))
- {
- callback = s_Callbacks[clientDataAddress].Public as TCallback;
- if (callback != null)
- {
- if (CanRemoveCallback(clientDataAddress, callbackInfo))
- {
- s_Callbacks.Remove(clientDataAddress);
- TryRelease(ref clientDataAddress);
- }
-
- return true;
- }
- }
-
- return false;
- }
-
- internal static bool TryGetStaticCallback(string key, out TCallback callback)
- where TCallback : class
- {
- callback = null;
-
- if (s_StaticCallbacks.ContainsKey(key))
- {
- callback = s_StaticCallbacks[key].Public as TCallback;
- if (callback != null)
- {
- return true;
- }
- }
-
- return false;
- }
-
- private static bool TryGetStructCallback(IntPtr clientDataAddress, out TCallback structCallback)
- where TCallback : class
- {
- structCallback = null;
-
- if (clientDataAddress != IntPtr.Zero && s_Callbacks.ContainsKey(clientDataAddress))
- {
- structCallback = s_Callbacks[clientDataAddress].StructDelegates.FirstOrDefault(delegat => delegat.GetType() == typeof(TCallback)) as TCallback;
- if (structCallback != null)
- {
- return true;
- }
- }
-
- return false;
- }
-#endregion
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace Epic.OnlineServices
+{
+ internal class AllocationException : Exception
+ {
+ public AllocationException(string message)
+ : base(message)
+ {
+ }
+ }
+
+ internal class ExternalAllocationException : AllocationException
+ {
+ public ExternalAllocationException(IntPtr address, Type type)
+ : base(string.Format("Attempting to allocate '{0}' over externally allocated memory at {1}", type, address.ToString("X")))
+ {
+ }
+ }
+
+ internal class CachedTypeAllocationException : AllocationException
+ {
+ public CachedTypeAllocationException(IntPtr address, Type foundType, Type expectedType)
+ : base(string.Format("Cached allocation is '{0}' but expected '{1}' at {2}", foundType, expectedType, address.ToString("X")))
+ {
+ }
+ }
+
+ internal class CachedArrayAllocationException : AllocationException
+ {
+ public CachedArrayAllocationException(IntPtr address, int foundLength, int expectedLength)
+ : base(string.Format("Cached array allocation has length {0} but expected {1} at {2}", foundLength, expectedLength, address.ToString("X")))
+ {
+ }
+ }
+
+ internal class DynamicBindingException : Exception
+ {
+ public DynamicBindingException(string bindingName)
+ : base(string.Format("Failed to hook dynamic binding for '{0}'", bindingName))
+ {
+ }
+ }
+
+ ///
+ /// A helper class that manages memory in the wrapper.
+ ///
+ public sealed partial class Helper
+ {
+ private struct Allocation
+ {
+ public int Size { get; private set; }
+
+ public object Cache { get; private set; }
+
+ public bool? IsArrayItemAllocated { get; private set; }
+
+ public Allocation(int size, object cache, bool? isArrayItemAllocated = null)
+ {
+ Size = size;
+ Cache = cache;
+ IsArrayItemAllocated = isArrayItemAllocated;
+ }
+ }
+ private struct PinnedBuffer
+ {
+ public GCHandle Handle { get; private set; }
+
+ public int RefCount { get; set; }
+
+ public PinnedBuffer(GCHandle handle)
+ {
+ Handle = handle;
+ RefCount = 1;
+ }
+ }
+
+ private class DelegateHolder
+ {
+ public Delegate Public { get; private set; }
+ public Delegate Private { get; private set; }
+ public Delegate[] StructDelegates { get; private set; }
+ public ulong? NotificationId { get; set; }
+
+ public DelegateHolder(Delegate publicDelegate, Delegate privateDelegate, params Delegate[] structDelegates)
+ {
+ Public = publicDelegate;
+ Private = privateDelegate;
+ StructDelegates = structDelegates;
+ }
+ }
+
+ private static Dictionary s_Allocations = new Dictionary();
+ private static Dictionary s_PinnedBuffers = new Dictionary();
+ private static Dictionary s_Callbacks = new Dictionary();
+ private static Dictionary s_StaticCallbacks = new Dictionary();
+ private static long s_LastClientDataId = 0;
+ private static Dictionary s_ClientDatas = new Dictionary();
+
+ ///
+ /// Gets the number of unmanaged allocations and other stored values in the wrapper. Use this to find leaks related to the usage of wrapper code.
+ ///
+ /// The number of unmanaged allocations currently active within the wrapper.
+ public static int GetAllocationCount()
+ {
+ return s_Allocations.Count + s_PinnedBuffers.Aggregate(0, (acc, x) => acc + x.Value.RefCount) + s_Callbacks.Count + s_ClientDatas.Count;
+ }
+
+ internal static void Copy(byte[] from, IntPtr to)
+ {
+ if (from != null && to != IntPtr.Zero)
+ {
+ Marshal.Copy(from, 0, to, from.Length);
+ }
+ }
+
+ internal static void Copy(ArraySegment from, IntPtr to)
+ {
+ if (from.Count != 0 && to != IntPtr.Zero)
+ {
+ Marshal.Copy(from.Array, from.Offset, to, from.Count);
+ }
+ }
+
+ internal static void Dispose(ref IntPtr value)
+ {
+ RemoveAllocation(ref value);
+ RemovePinnedBuffer(ref value);
+ }
+
+ internal static void Dispose(ref TDisposable disposable)
+ where TDisposable : IDisposable
+ {
+ if (disposable != null)
+ {
+ disposable.Dispose();
+ }
+ }
+
+ internal static void Dispose(ref IntPtr value, TEnum currentEnum, TEnum expectedEnum)
+ {
+ if ((int)(object)currentEnum == (int)(object)expectedEnum)
+ {
+ Dispose(ref value);
+ }
+ }
+
+ private static int GetAnsiStringLength(byte[] bytes)
+ {
+ int length = 0;
+ foreach (byte currentByte in bytes)
+ {
+ if (currentByte == 0)
+ {
+ break;
+ }
+
+ ++length;
+ }
+
+ return length;
+ }
+
+ private static int GetAnsiStringLength(IntPtr address)
+ {
+ int length = 0;
+ while (Marshal.ReadByte(address, length) != 0)
+ {
+ ++length;
+ }
+
+ return length;
+ }
+
+ internal static T GetDefault()
+ {
+ return default(T);
+ }
+
+ private static void GetAllocation(IntPtr source, out T target)
+ {
+ target = GetDefault();
+
+ if (source == IntPtr.Zero)
+ {
+ return;
+ }
+
+ object allocationCache;
+ if (TryGetAllocationCache(source, out allocationCache))
+ {
+ if (allocationCache != null)
+ {
+ if (allocationCache.GetType() == typeof(T))
+ {
+ target = (T)allocationCache;
+ return;
+ }
+ else
+ {
+ throw new CachedTypeAllocationException(source, allocationCache.GetType(), typeof(T));
+ }
+ }
+ }
+
+ target = (T)Marshal.PtrToStructure(source, typeof(T));
+ }
+
+ private static void GetAllocation(IntPtr source, out T? target)
+ where T : struct
+ {
+ target = GetDefault();
+
+ if (source == IntPtr.Zero)
+ {
+ return;
+ }
+
+ // If this is an allocation containing cached data, we should be able to fetch it from the cache
+ object allocationCache;
+ if (TryGetAllocationCache(source, out allocationCache))
+ {
+ if (allocationCache != null)
+ {
+ if (allocationCache.GetType() == typeof(T))
+ {
+ target = (T?)allocationCache;
+ return;
+ }
+ else
+ {
+ throw new CachedTypeAllocationException(source, allocationCache.GetType(), typeof(T));
+ }
+ }
+ }
+
+ target = (T?)Marshal.PtrToStructure(source, typeof(T));
+ }
+
+ private static void GetAllocation(IntPtr source, out THandle[] target, int arrayLength)
+ where THandle : Handle, new()
+ {
+ target = null;
+
+ if (source == IntPtr.Zero)
+ {
+ return;
+ }
+
+ // If this is an allocation containing cached data, we should be able to fetch it from the cache
+ object allocationCache;
+
+ if (TryGetAllocationCache(source, out allocationCache))
+ {
+ if (allocationCache != null)
+ {
+ if (allocationCache.GetType() == typeof(THandle[]))
+ {
+ var cachedArray = (Array)allocationCache;
+ if (cachedArray.Length == arrayLength)
+ {
+ target = cachedArray as THandle[];
+ return;
+ }
+ else
+ {
+ throw new CachedArrayAllocationException(source, cachedArray.Length, arrayLength);
+ }
+ }
+ else
+ {
+ throw new CachedTypeAllocationException(source, allocationCache.GetType(), typeof(THandle[]));
+ }
+ }
+ }
+
+ var itemSize = Marshal.SizeOf(typeof(IntPtr));
+
+ List items = new List();
+ for (int itemIndex = 0; itemIndex < arrayLength; ++itemIndex)
+ {
+ IntPtr itemAddress = new IntPtr(source.ToInt64() + itemIndex * itemSize);
+ itemAddress = Marshal.ReadIntPtr(itemAddress);
+ THandle item;
+ Convert(itemAddress, out item);
+ items.Add(item);
+ }
+
+ target = items.ToArray();
+ }
+
+ private static void GetAllocation(IntPtr from, out T[] to, int arrayLength, bool isArrayItemAllocated)
+ {
+ to = null;
+
+ if (from == IntPtr.Zero)
+ {
+ return;
+ }
+
+ // If this is an allocation containing cached data, we should be able to fetch it from the cache
+ object allocationCache;
+ if (TryGetAllocationCache(from, out allocationCache))
+ {
+ if (allocationCache != null)
+ {
+ if (allocationCache.GetType() == typeof(T[]))
+ {
+ var cachedArray = (Array)allocationCache;
+ if (cachedArray.Length == arrayLength)
+ {
+ to = cachedArray as T[];
+ return;
+ }
+ else
+ {
+ throw new CachedArrayAllocationException(from, cachedArray.Length, arrayLength);
+ }
+ }
+ else
+ {
+ throw new CachedTypeAllocationException(from, allocationCache.GetType(), typeof(T[]));
+ }
+ }
+ }
+
+ int itemSize;
+ if (isArrayItemAllocated)
+ {
+ itemSize = Marshal.SizeOf(typeof(IntPtr));
+ }
+ else
+ {
+ itemSize = Marshal.SizeOf(typeof(T));
+ }
+
+ List items = new List();
+ for (int itemIndex = 0; itemIndex < arrayLength; ++itemIndex)
+ {
+ IntPtr itemAddress = new IntPtr(from.ToInt64() + itemIndex * itemSize);
+
+ if (isArrayItemAllocated)
+ {
+ itemAddress = Marshal.ReadIntPtr(itemAddress);
+ }
+
+ T item;
+ GetAllocation(itemAddress, out item);
+ items.Add(item);
+ }
+
+ to = items.ToArray();
+ }
+
+ private static void GetAllocation(IntPtr source, out Utf8String target)
+ {
+ target = null;
+
+ if (source == IntPtr.Zero)
+ {
+ return;
+ }
+
+ // C style strlen
+ int length = GetAnsiStringLength(source);
+
+ // +1 byte for the null terminator.
+ byte[] bytes = new byte[length + 1];
+ Marshal.Copy(source, bytes, 0, length + 1);
+
+ target = new Utf8String(bytes);
+ }
+
+ internal static IntPtr AddAllocation(int size)
+ {
+ if (size == 0)
+ {
+ return IntPtr.Zero;
+ }
+
+ IntPtr address = Marshal.AllocHGlobal(size);
+ Marshal.WriteByte(address, 0, 0);
+
+ lock (s_Allocations)
+ {
+ s_Allocations.Add(address, new Allocation(size, null));
+ }
+
+ return address;
+ }
+
+ internal static IntPtr AddAllocation(uint size)
+ {
+ return AddAllocation((int)size);
+ }
+
+ private static IntPtr AddAllocation(int size, T cache)
+ {
+ if (size == 0 || cache == null)
+ {
+ return IntPtr.Zero;
+ }
+
+ IntPtr address = Marshal.AllocHGlobal(size);
+ Marshal.StructureToPtr(cache, address, false);
+
+ lock (s_Allocations)
+ {
+ s_Allocations.Add(address, new Allocation(size, cache));
+ }
+
+ return address;
+ }
+
+ private static IntPtr AddAllocation(int size, T[] cache, bool? isArrayItemAllocated)
+ {
+ if (size == 0 || cache == null)
+ {
+ return IntPtr.Zero;
+ }
+
+ IntPtr address = Marshal.AllocHGlobal(size);
+ Marshal.WriteByte(address, 0, 0);
+
+ lock (s_Allocations)
+ {
+ s_Allocations.Add(address, new Allocation(size, cache, isArrayItemAllocated));
+ }
+
+ return address;
+ }
+
+ private static IntPtr AddAllocation(T[] array, bool isArrayItemAllocated)
+ {
+ if (array == null)
+ {
+ return IntPtr.Zero;
+ }
+
+ int itemSize;
+ if (isArrayItemAllocated)
+ {
+ itemSize = Marshal.SizeOf(typeof(IntPtr));
+ }
+ else
+ {
+ itemSize = Marshal.SizeOf(typeof(T));
+ }
+
+ IntPtr newArrayAddress = AddAllocation(array.Length * itemSize, array, isArrayItemAllocated);
+
+ for (int itemIndex = 0; itemIndex < array.Length; ++itemIndex)
+ {
+ var item = (T)array.GetValue(itemIndex);
+
+ if (isArrayItemAllocated)
+ {
+ IntPtr newItemAddress;
+ if (typeof(T) == typeof(Utf8String))
+ {
+ newItemAddress = AddPinnedBuffer((Utf8String)(object)item);
+ }
+ else if (typeof(T).BaseType == typeof(Handle))
+ {
+ Convert((Handle)(object)item, out newItemAddress);
+ }
+ else
+ {
+ newItemAddress = AddAllocation(Marshal.SizeOf(typeof(T)), item);
+ }
+
+ // Copy the item's address into the array
+ IntPtr itemAddress = new IntPtr(newArrayAddress.ToInt64() + itemIndex * itemSize);
+ Marshal.StructureToPtr(newItemAddress, itemAddress, false);
+ }
+ else
+ {
+ // Copy the data straight into memory
+ IntPtr itemAddress = new IntPtr(newArrayAddress.ToInt64() + itemIndex * itemSize);
+ Marshal.StructureToPtr(item, itemAddress, false);
+ }
+ }
+
+ return newArrayAddress;
+ }
+
+ private static void RemoveAllocation(ref IntPtr address)
+ {
+ if (address == IntPtr.Zero)
+ {
+ return;
+ }
+
+ Allocation allocation;
+ lock (s_Allocations)
+ {
+ if (!s_Allocations.TryGetValue(address, out allocation))
+ {
+ return;
+ }
+
+ s_Allocations.Remove(address);
+ }
+
+ // If the allocation is an array, dispose and release its items as needbe.
+ if (allocation.IsArrayItemAllocated.HasValue)
+ {
+ int itemSize;
+ if (allocation.IsArrayItemAllocated.Value)
+ {
+ itemSize = Marshal.SizeOf(typeof(IntPtr));
+ }
+ else
+ {
+ itemSize = Marshal.SizeOf(allocation.Cache.GetType().GetElementType());
+ }
+
+ var array = allocation.Cache as Array;
+ for (int itemIndex = 0; itemIndex < array.Length; ++itemIndex)
+ {
+ if (allocation.IsArrayItemAllocated.Value)
+ {
+ var itemAddress = new IntPtr(address.ToInt64() + itemIndex * itemSize);
+ itemAddress = Marshal.ReadIntPtr(itemAddress);
+ Dispose(ref itemAddress);
+ }
+ else
+ {
+ var item = array.GetValue(itemIndex);
+ if (item is IDisposable)
+ {
+ var disposable = item as IDisposable;
+ if (disposable != null)
+ {
+ disposable.Dispose();
+ }
+ }
+ }
+ }
+ }
+
+ if (allocation.Cache is IDisposable)
+ {
+ var disposable = allocation.Cache as IDisposable;
+ if (disposable != null)
+ {
+ disposable.Dispose();
+ }
+ }
+
+ Marshal.FreeHGlobal(address);
+ address = IntPtr.Zero;
+ }
+
+ private static bool TryGetAllocationCache(IntPtr address, out object cache)
+ {
+ cache = null;
+
+ lock (s_Allocations)
+ {
+ Allocation allocation;
+ if (s_Allocations.TryGetValue(address, out allocation))
+ {
+ cache = allocation.Cache;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static IntPtr AddPinnedBuffer(byte[] buffer, int offset)
+ {
+ if (buffer == null)
+ {
+ return IntPtr.Zero;
+ }
+
+ GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
+ IntPtr address = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, offset);
+
+ lock (s_PinnedBuffers)
+ {
+ // If the item is already pinned, increase the reference count.
+ if (s_PinnedBuffers.ContainsKey(address))
+ {
+ // Since this is a structure, need to copy to modify the element.
+ PinnedBuffer pinned = s_PinnedBuffers[address];
+ pinned.RefCount++;
+ s_PinnedBuffers[address] = pinned;
+ }
+ else
+ {
+ s_PinnedBuffers.Add(address, new PinnedBuffer(handle));
+ }
+
+ return address;
+ }
+ }
+
+ private static IntPtr AddPinnedBuffer(Utf8String str)
+ {
+ if (str == null || str.Bytes == null)
+ {
+ return IntPtr.Zero;
+ }
+
+ return AddPinnedBuffer(str.Bytes, 0);
+ }
+
+ internal static IntPtr AddPinnedBuffer(ArraySegment array)
+ {
+ if (array == null)
+ {
+ return IntPtr.Zero;
+ }
+
+ return AddPinnedBuffer(array.Array, array.Offset);
+ }
+
+ private static void RemovePinnedBuffer(ref IntPtr address)
+ {
+ if (address == IntPtr.Zero)
+ {
+ return;
+ }
+
+ lock (s_PinnedBuffers)
+ {
+ PinnedBuffer pinnedBuffer;
+ if (s_PinnedBuffers.TryGetValue(address, out pinnedBuffer))
+ {
+ // Deref the allocation.
+ pinnedBuffer.Handle.Free();
+ pinnedBuffer.RefCount--;
+
+ // If the reference count is zero, remove the allocation from the list of tracked allocations.
+ if (pinnedBuffer.RefCount == 0)
+ {
+ s_PinnedBuffers.Remove(address);
+ }
+ else
+ {
+ // Copy back the structure with the decreased reference count.
+ s_PinnedBuffers[address] = pinnedBuffer;
+ }
+ }
+ }
+
+ address = IntPtr.Zero;
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Helper.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Helper.cs.meta
deleted file mode 100644
index 50bc47a8..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Helper.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 3079a103fb51b45419a94bf57a63fc8c
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/HelperExtensions.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/HelperExtensions.cs.meta
deleted file mode 100644
index c35e5d81..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/HelperExtensions.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: b66a27433592be448af038ba9cb57d96
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ICallbackInfo.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ICallbackInfo.cs
index 57f50eb9..64470a23 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ICallbackInfo.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ICallbackInfo.cs
@@ -1,18 +1,18 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-using System;
-
-namespace Epic.OnlineServices
-{
- internal interface ICallbackInfo
- {
- object ClientData { get; }
-
- Result? GetResultCode();
- }
-
- internal interface ICallbackInfoInternal
- {
- IntPtr ClientDataAddress { get; }
- }
-}
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+using System;
+
+namespace Epic.OnlineServices
+{
+ internal interface ICallbackInfo
+ {
+ object ClientData { get; }
+
+ Result? GetResultCode();
+ }
+
+ internal interface ICallbackInfoInternal
+ {
+ IntPtr ClientDataAddress { get; }
+ }
+}
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ICallbackInfo.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ICallbackInfo.cs.meta
deleted file mode 100644
index df99b080..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ICallbackInfo.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 4aa748c37587f3248933d66e7e093816
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/IGettable.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/IGettable.cs
new file mode 100644
index 00000000..92a40cff
--- /dev/null
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/IGettable.cs
@@ -0,0 +1,9 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+namespace Epic.OnlineServices
+{
+ internal interface IGettable where T : struct
+ {
+ void Get(out T other);
+ }
+}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ISettable.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ISettable.cs
index 810dde2b..e1ae6af7 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ISettable.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ISettable.cs
@@ -1,9 +1,10 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-namespace Epic.OnlineServices
-{
- public interface ISettable
- {
- void Set(object other);
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+namespace Epic.OnlineServices
+{
+ internal interface ISettable where T : struct
+ {
+ void Set(ref T other);
+ void Set(ref T? other);
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ISettable.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ISettable.cs.meta
deleted file mode 100644
index 1d804ed4..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/ISettable.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: bbcedd8572e5c1f4899c4237e53f97ca
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/MonoPInvokeCallbackAttribute.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/MonoPInvokeCallbackAttribute.cs
index c58daf79..91e6c5f1 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/MonoPInvokeCallbackAttribute.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/MonoPInvokeCallbackAttribute.cs
@@ -1,14 +1,14 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-using System;
-
-namespace Epic.OnlineServices
-{
- [AttributeUsage(AttributeTargets.Method)]
- internal sealed class MonoPInvokeCallbackAttribute : Attribute
- {
- public MonoPInvokeCallbackAttribute(Type type)
- {
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+using System;
+
+namespace Epic.OnlineServices
+{
+ [AttributeUsage(AttributeTargets.Method)]
+ internal sealed class MonoPInvokeCallbackAttribute : Attribute
+ {
+ public MonoPInvokeCallbackAttribute(Type type)
+ {
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/MonoPInvokeCallbackAttribute.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/MonoPInvokeCallbackAttribute.cs.meta
deleted file mode 100644
index a88522fb..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/MonoPInvokeCallbackAttribute.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: be91cddb4263e1b42ad685c6bd0e8b19
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/SetHelper.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/SetHelper.cs
new file mode 100644
index 00000000..659174d8
--- /dev/null
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/SetHelper.cs
@@ -0,0 +1,227 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Epic.OnlineServices
+{
+ public sealed partial class Helper
+ {
+ internal static void Set(ref T from, ref T to)
+ where T : struct
+ {
+ to = from;
+ }
+
+ internal static void Set(object from, ref IntPtr to)
+ {
+ RemoveClientData(to);
+ to = AddClientData(from);
+ }
+
+ internal static void Set(Utf8String from, ref IntPtr to)
+ {
+ Dispose(ref to);
+ to = AddPinnedBuffer(from);
+ }
+
+ internal static void Set(Handle from, ref IntPtr to)
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Set(T? from, ref IntPtr to)
+ where T : struct
+ {
+ Dispose(ref to);
+ to = AddAllocation(Marshal.SizeOf(typeof(T)), from);
+ }
+
+ internal static void Set(T[] from, ref IntPtr to, bool isArrayItemAllocated)
+ {
+ Dispose(ref to);
+ to = AddAllocation(from, isArrayItemAllocated);
+ }
+
+ internal static void Set(ArraySegment from, ref IntPtr to, out uint arrayLength)
+ {
+ to = AddPinnedBuffer(from);
+ Get(from, out arrayLength);
+ }
+
+ internal static void Set(T[] from, ref IntPtr to)
+ {
+ Set(from, ref to, !typeof(T).IsValueType);
+ }
+
+ internal static void Set(T[] from, ref IntPtr to, bool isArrayItemAllocated, out int arrayLength)
+ {
+ Set(from, ref to, isArrayItemAllocated);
+ Get(from, out arrayLength);
+ }
+
+ internal static void Set(T[] from, ref IntPtr to, bool isArrayItemAllocated, out uint arrayLength)
+ {
+ Set(from, ref to, isArrayItemAllocated);
+ Get(from, out arrayLength);
+ }
+
+ internal static void Set(T[] from, ref IntPtr to, out int arrayLength)
+ {
+ Set(from, ref to, !typeof(T).IsValueType, out arrayLength);
+ }
+
+ internal static void Set(T[] from, ref IntPtr to, out uint arrayLength)
+ {
+ Set(from, ref to, !typeof(T).IsValueType, out arrayLength);
+ }
+
+ internal static void Set(DateTimeOffset? from, ref long to)
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Set(bool from, ref int to)
+ {
+ Convert(from, out to);
+ }
+
+ internal static void Set(string from, ref byte[] to, int stringLength)
+ {
+ Convert(from, out to, stringLength);
+ }
+
+ internal static void Set(T from, ref T to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null)
+ {
+ if (from != null)
+ {
+ Dispose(ref disposable);
+
+ to = from;
+ toEnum = fromEnum;
+ }
+ }
+
+ internal static void Set(ref TFrom from, ref TTo to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null)
+ where TFrom : struct
+ where TTo : struct, ISettable
+ {
+ Dispose(ref disposable);
+
+ Set(ref from, ref to);
+ toEnum = fromEnum;
+ }
+
+ internal static void Set(T? from, ref T to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null)
+ where T : struct
+ {
+ if (from != null)
+ {
+ Dispose(ref disposable);
+
+ T value = from.Value;
+ Set(ref value, ref to);
+ toEnum = fromEnum;
+ }
+ }
+
+ internal static void Set(Handle from, ref IntPtr to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null)
+ {
+ if (from != null)
+ {
+ Dispose(ref to);
+ Dispose(ref disposable);
+
+ Set(from, ref to);
+ toEnum = fromEnum;
+ }
+ }
+
+ internal static void Set(Utf8String from, ref IntPtr to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null)
+ {
+ if (from != null)
+ {
+ Dispose(ref to);
+ Dispose(ref disposable);
+
+ Set(from, ref to);
+ toEnum = fromEnum;
+ }
+ }
+
+ internal static void Set(bool? from, ref int to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null)
+ {
+ if (from != null)
+ {
+ Dispose(ref disposable);
+
+ Set(from.Value, ref to);
+ toEnum = fromEnum;
+ }
+ }
+
+ internal static void Set(ref TFrom from, ref IntPtr to)
+ where TFrom : struct
+ where TIntermediate : struct, ISettable
+ {
+ TIntermediate intermediate = new TIntermediate();
+ intermediate.Set(ref from);
+
+ Dispose(ref to);
+ to = AddAllocation(Marshal.SizeOf(typeof(TIntermediate)), intermediate);
+ }
+
+ internal static void Set(ref TFrom? from, ref IntPtr to)
+ where TIntermediate : struct, ISettable
+ where TFrom : struct
+ {
+ Dispose(ref to);
+
+ if (!from.HasValue)
+ {
+ return;
+ }
+
+ TIntermediate intermediate = new TIntermediate();
+ var sourceValue = from.Value;
+ intermediate.Set(ref sourceValue);
+
+ to = AddAllocation(Marshal.SizeOf(typeof(TIntermediate)), intermediate);
+ }
+
+ internal static void Set(ref TFrom from, ref TTo to)
+ where TFrom : struct
+ where TTo : struct, ISettable
+ {
+ to.Set(ref from);
+ }
+
+ internal static void Set(ref TFrom[] from, ref IntPtr to, out int arrayLength)
+ where TFrom : struct
+ where TIntermediate : struct, ISettable
+ {
+ arrayLength = 0;
+
+ if (from != null)
+ {
+ TIntermediate[] intermediate = new TIntermediate[from.Length];
+ for (int index = 0; index < from.Length; ++index)
+ {
+ intermediate[index].Set(ref from[index]);
+ }
+
+ Set(intermediate, ref to);
+ Get(from, out arrayLength);
+ }
+ }
+
+ internal static void Set(ref TFrom[] from, ref IntPtr to, out uint arrayLength)
+ where TFrom : struct
+ where TIntermediate : struct, ISettable
+ {
+ int arrayLengthIntermediate;
+ Set(ref from, ref to, out arrayLengthIntermediate);
+ arrayLength = (uint)arrayLengthIntermediate;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Utf8String.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Utf8String.cs
new file mode 100644
index 00000000..05b2619a
--- /dev/null
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Core/Utf8String.cs
@@ -0,0 +1,197 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+using System;
+using System.Text;
+
+namespace Epic.OnlineServices
+{
+ ///
+ /// Represents text as a series of UTF-8 code units.
+ ///
+ [System.Diagnostics.DebuggerDisplay("{ToString()}")]
+ public sealed class Utf8String
+ {
+ ///
+ /// The length of the .
+ ///
+ public int Length { get; private set; }
+
+ ///
+ /// The UTF-8 bytes of the .
+ ///
+ public byte[] Bytes { get; private set; }
+
+ ///
+ /// The as a .
+ ///
+ private string Utf16
+ {
+ get
+ {
+ if (Length > 0)
+ {
+ return Encoding.UTF8.GetString(Bytes, 0, Length);
+ }
+
+ if (Bytes == null)
+ {
+ throw new Exception("Bytes array is null.");
+ }
+ else if (Bytes.Length == 0 || Bytes[Bytes.Length - 1] != 0)
+ {
+ throw new Exception("Bytes array is not null terminated.");
+ }
+
+ return "";
+ }
+ set
+ {
+ if (value != null)
+ {
+ // Null terminate the bytes
+ Bytes = new byte[Encoding.UTF8.GetMaxByteCount(value.Length) + 1];
+ Length = Encoding.UTF8.GetBytes(value, 0, value.Length, Bytes, 0);
+ }
+ else
+ {
+ Length = 0;
+ }
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public Utf8String()
+ {
+ Length = 0;
+ }
+
+ ///
+ /// Initializes a new instance of the class with the given UTF-8 bytes.
+ ///
+ /// The UTF-8 bytes.
+ public Utf8String(byte[] bytes)
+ {
+ if (bytes == null)
+ {
+ throw new ArgumentNullException("bytes");
+ }
+ else if (bytes.Length == 0 || bytes[bytes.Length - 1] != 0)
+ {
+ throw new ArgumentException("Argument is not null terminated.", "bytes");
+ }
+
+ Bytes = bytes;
+ Length = Bytes.Length - 1;
+ }
+
+ ///
+ /// Initializes a new instance of the class by converting from the given .
+ ///
+ /// The string to convert to UTF-8.
+ public Utf8String(string value)
+ {
+ Utf16 = value;
+ }
+
+ public byte this[int index]
+ {
+ get { return Bytes[index]; }
+ set { Bytes[index] = value; }
+ }
+
+ public static explicit operator Utf8String(byte[] bytes)
+ {
+ return new Utf8String(bytes);
+ }
+
+ public static explicit operator byte[](Utf8String u8str)
+ {
+ return u8str.Bytes;
+ }
+
+ public static implicit operator Utf8String(string str)
+ {
+ return new Utf8String(str);
+ }
+
+ public static implicit operator string(Utf8String u8str)
+ {
+ if (u8str != null)
+ {
+ return u8str.ToString();
+ }
+
+ return null;
+ }
+
+ public static Utf8String operator +(Utf8String left, Utf8String right)
+ {
+ byte[] Result = new byte[left.Length + right.Length + 1];
+ Buffer.BlockCopy(left.Bytes, 0, Result, 0, left.Length);
+ Buffer.BlockCopy(right.Bytes, 0, Result, left.Length, right.Length + 1);
+ return new Utf8String(Result);
+ }
+
+ public static bool operator ==(Utf8String left, Utf8String right)
+ {
+ if (ReferenceEquals(left, null))
+ {
+ if (ReferenceEquals(right, null))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ return left.Equals(right);
+ }
+
+ public static bool operator !=(Utf8String left, Utf8String right)
+ {
+ return !(left == right);
+ }
+
+ public override bool Equals(object obj)
+ {
+ Utf8String other = obj as Utf8String;
+
+ if (ReferenceEquals(other, null))
+ {
+ return false;
+ }
+
+ if (ReferenceEquals(this, other))
+ {
+ return true;
+ }
+
+ if (Length != other.Length)
+ {
+ return false;
+ }
+
+ for (int index = 0; index < Length; index++)
+ {
+ if (this[index] != other[index])
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public override string ToString()
+ {
+ return Utf16;
+ }
+
+ public override int GetHashCode()
+ {
+ return ToString().GetHashCode();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win32-Shipping.dll b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win32-Shipping.dll
index 449eaf0f..77544990 100644
Binary files a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win32-Shipping.dll and b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win32-Shipping.dll differ
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win32-Shipping.dll.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win32-Shipping.dll.meta
index 806feb83..cefd2b04 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win32-Shipping.dll.meta
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win32-Shipping.dll.meta
@@ -11,17 +11,63 @@ PluginImporter:
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Editor: 0
+ Exclude Linux64: 0
+ Exclude OSXUniversal: 0
+ Exclude Win: 0
+ Exclude Win64: 1
+ Exclude iOS: 1
- first:
Any:
second:
- enabled: 1
+ enabled: 0
settings: {}
- first:
Editor: Editor
second:
- enabled: 0
+ enabled: 1
settings:
+ CPU: AnyCPU
DefaultValueInitialized: true
+ OS: Windows
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 1
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 1
+ settings:
+ CPU: x86
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ iPhone: iOS
+ second:
+ enabled: 0
+ settings:
+ AddToEmbeddedBinaries: false
+ CPU: AnyCPU
+ CompileFlags:
+ FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win64-Shipping.dll b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win64-Shipping.dll
index 9073f8ba..8dab1d79 100644
Binary files a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win64-Shipping.dll and b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win64-Shipping.dll differ
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win64-Shipping.dll.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win64-Shipping.dll.meta
index b59dedff..25b62e04 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win64-Shipping.dll.meta
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/EOSSDK-Win64-Shipping.dll.meta
@@ -11,17 +11,63 @@ PluginImporter:
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
+ - first:
+ : Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Editor: 0
+ Exclude Linux64: 0
+ Exclude OSXUniversal: 0
+ Exclude Win: 1
+ Exclude Win64: 0
+ Exclude iOS: 1
- first:
Any:
second:
- enabled: 1
+ enabled: 0
settings: {}
- first:
Editor: Editor
second:
- enabled: 0
+ enabled: 1
settings:
+ CPU: x86_64
DefaultValueInitialized: true
+ OS: Windows
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 1
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 1
+ settings:
+ CPU: x86_64
+ - first:
+ iPhone: iOS
+ second:
+ enabled: 0
+ settings:
+ AddToEmbeddedBinaries: false
+ CPU: AnyCPU
+ CompileFlags:
+ FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AchievementsInterface.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AchievementsInterface.cs
index 5e2bb747..f755859d 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AchievementsInterface.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AchievementsInterface.cs
@@ -1,668 +1,674 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-// This file is automatically generated. Changes to this file may be overwritten.
-
-namespace Epic.OnlineServices.Achievements
-{
- public sealed partial class AchievementsInterface : Handle
- {
- public AchievementsInterface()
- {
- }
-
- public AchievementsInterface(System.IntPtr innerHandle) : base(innerHandle)
- {
- }
-
- ///
- /// Timestamp value representing an undefined UnlockTime for and
- ///
- public const int AchievementUnlocktimeUndefined = -1;
-
- ///
- /// The most recent version of the API.
- ///
- public const int AddnotifyachievementsunlockedApiLatest = 1;
-
- ///
- /// The most recent version of the API.
- ///
- public const int Addnotifyachievementsunlockedv2ApiLatest = 2;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int Copyachievementdefinitionv2ByachievementidApiLatest = 2;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int Copyachievementdefinitionv2ByindexApiLatest = 2;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int CopydefinitionbyachievementidApiLatest = 1;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int CopydefinitionbyindexApiLatest = 1;
-
- ///
- /// DEPRECATED! Use instead.
- ///
- public const int Copydefinitionv2ByachievementidApiLatest = Copyachievementdefinitionv2ByachievementidApiLatest;
-
- ///
- /// DEPRECATED! Use instead.
- ///
- public const int Copydefinitionv2ByindexApiLatest = Copyachievementdefinitionv2ByindexApiLatest;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int CopyplayerachievementbyachievementidApiLatest = 2;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int CopyplayerachievementbyindexApiLatest = 2;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int CopyunlockedachievementbyachievementidApiLatest = 1;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int CopyunlockedachievementbyindexApiLatest = 1;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int DefinitionApiLatest = 1;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int Definitionv2ApiLatest = 2;
-
- ///
- /// The most recent version of the API.
- ///
- public const int GetachievementdefinitioncountApiLatest = 1;
-
- ///
- /// The most recent version of the API.
- ///
- public const int GetplayerachievementcountApiLatest = 1;
-
- ///
- /// The most recent version of the API.
- ///
- public const int GetunlockedachievementcountApiLatest = 1;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int PlayerachievementApiLatest = 2;
-
- public const int PlayerstatinfoApiLatest = 1;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int QuerydefinitionsApiLatest = 3;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int QueryplayerachievementsApiLatest = 2;
-
- ///
- /// DEPRECATED! Use instead.
- ///
- public const int StatthresholdApiLatest = StatthresholdsApiLatest;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int StatthresholdsApiLatest = 1;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int UnlockachievementsApiLatest = 1;
-
- ///
- /// The most recent version of the struct.
- ///
- public const int UnlockedachievementApiLatest = 1;
-
- ///
- /// DEPRECATED! Use instead.
- ///
- /// Register to receive achievement unlocked notifications.
- /// @note must call to remove the notification
- ///
- ///
- /// Structure containing information about the achievement unlocked notification
- /// Arbitrary data that is passed back to you in the CompletionDelegate
- /// A callback that is fired when an achievement unlocked notification for a user has been received
- ///
- /// handle representing the registered callback
- ///
- public ulong AddNotifyAchievementsUnlocked(AddNotifyAchievementsUnlockedOptions options, object clientData, OnAchievementsUnlockedCallback notificationFn)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var clientDataAddress = System.IntPtr.Zero;
-
- var notificationFnInternal = new OnAchievementsUnlockedCallbackInternal(OnAchievementsUnlockedCallbackInternalImplementation);
- Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal);
-
- var funcResult = Bindings.EOS_Achievements_AddNotifyAchievementsUnlocked(InnerHandle, optionsAddress, clientDataAddress, notificationFnInternal);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult);
-
- return funcResult;
- }
-
- ///
- /// Register to receive achievement unlocked notifications.
- /// @note must call to remove the notification
- ///
- ///
- /// Structure containing information about the achievement unlocked notification
- /// Arbitrary data that is passed back to you in the CompletionDelegate
- /// A callback that is fired when an achievement unlocked notification for a user has been received
- ///
- /// handle representing the registered callback
- ///
- public ulong AddNotifyAchievementsUnlockedV2(AddNotifyAchievementsUnlockedV2Options options, object clientData, OnAchievementsUnlockedCallbackV2 notificationFn)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var clientDataAddress = System.IntPtr.Zero;
-
- var notificationFnInternal = new OnAchievementsUnlockedCallbackV2Internal(OnAchievementsUnlockedCallbackV2InternalImplementation);
- Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal);
-
- var funcResult = Bindings.EOS_Achievements_AddNotifyAchievementsUnlockedV2(InnerHandle, optionsAddress, clientDataAddress, notificationFnInternal);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult);
-
- return funcResult;
- }
-
- ///
- /// DEPRECATED! Use instead.
- ///
- /// Fetches an achievement definition from a given achievement ID.
- ///
- ///
- ///
- /// Structure containing the achievement ID being accessed
- /// The achievement definition for the given achievement ID, if it exists and is valid, use when finished
- ///
- /// if the information is available and passed out in OutDefinition
- /// if you pass a null pointer for the out parameter
- /// if the achievement definition is not found
- ///
- public Result CopyAchievementDefinitionByAchievementId(CopyAchievementDefinitionByAchievementIdOptions options, out Definition outDefinition)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var outDefinitionAddress = System.IntPtr.Zero;
-
- var funcResult = Bindings.EOS_Achievements_CopyAchievementDefinitionByAchievementId(InnerHandle, optionsAddress, ref outDefinitionAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- if (Helper.TryMarshalGet(outDefinitionAddress, out outDefinition))
- {
- Bindings.EOS_Achievements_Definition_Release(outDefinitionAddress);
- }
-
- return funcResult;
- }
-
- ///
- /// DEPRECATED! Use instead.
- ///
- /// Fetches an achievement definition from a given index.
- ///
- ///
- ///
- /// Structure containing the index being accessed
- /// The achievement definition for the given index, if it exists and is valid, use when finished
- ///
- /// if the information is available and passed out in OutDefinition
- /// if you pass a null pointer for the out parameter
- /// if the achievement definition is not found
- ///
- public Result CopyAchievementDefinitionByIndex(CopyAchievementDefinitionByIndexOptions options, out Definition outDefinition)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var outDefinitionAddress = System.IntPtr.Zero;
-
- var funcResult = Bindings.EOS_Achievements_CopyAchievementDefinitionByIndex(InnerHandle, optionsAddress, ref outDefinitionAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- if (Helper.TryMarshalGet(outDefinitionAddress, out outDefinition))
- {
- Bindings.EOS_Achievements_Definition_Release(outDefinitionAddress);
- }
-
- return funcResult;
- }
-
- ///
- /// Fetches an achievement definition from a given achievement ID.
- ///
- ///
- /// Structure containing the achievement ID being accessed
- /// The achievement definition for the given achievement ID, if it exists and is valid, use when finished
- ///
- /// if the information is available and passed out in OutDefinition
- /// if you pass a null pointer for the out parameter
- /// if the achievement definition is not found
- /// if any of the userid options are incorrect
- ///
- public Result CopyAchievementDefinitionV2ByAchievementId(CopyAchievementDefinitionV2ByAchievementIdOptions options, out DefinitionV2 outDefinition)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var outDefinitionAddress = System.IntPtr.Zero;
-
- var funcResult = Bindings.EOS_Achievements_CopyAchievementDefinitionV2ByAchievementId(InnerHandle, optionsAddress, ref outDefinitionAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- if (Helper.TryMarshalGet(outDefinitionAddress, out outDefinition))
- {
- Bindings.EOS_Achievements_DefinitionV2_Release(outDefinitionAddress);
- }
-
- return funcResult;
- }
-
- ///
- /// Fetches an achievement definition from a given index.
- ///
- ///
- /// Structure containing the index being accessed
- /// The achievement definition for the given index, if it exists and is valid, use when finished
- ///
- /// if the information is available and passed out in OutDefinition
- /// if you pass a null pointer for the out parameter
- /// if the achievement definition is not found
- /// if any of the userid options are incorrect
- ///
- public Result CopyAchievementDefinitionV2ByIndex(CopyAchievementDefinitionV2ByIndexOptions options, out DefinitionV2 outDefinition)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var outDefinitionAddress = System.IntPtr.Zero;
-
- var funcResult = Bindings.EOS_Achievements_CopyAchievementDefinitionV2ByIndex(InnerHandle, optionsAddress, ref outDefinitionAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- if (Helper.TryMarshalGet(outDefinitionAddress, out outDefinition))
- {
- Bindings.EOS_Achievements_DefinitionV2_Release(outDefinitionAddress);
- }
-
- return funcResult;
- }
-
- ///
- /// Fetches a player achievement from a given achievement ID.
- ///
- ///
- /// Structure containing the Epic Online Services Account ID and achievement ID being accessed
- /// The player achievement data for the given achievement ID, if it exists and is valid, use when finished
- ///
- /// if the information is available and passed out in OutAchievement
- /// if you pass a null pointer for the out parameter
- /// if the player achievement is not found
- /// if you pass an invalid user ID
- ///
- public Result CopyPlayerAchievementByAchievementId(CopyPlayerAchievementByAchievementIdOptions options, out PlayerAchievement outAchievement)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var outAchievementAddress = System.IntPtr.Zero;
-
- var funcResult = Bindings.EOS_Achievements_CopyPlayerAchievementByAchievementId(InnerHandle, optionsAddress, ref outAchievementAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- if (Helper.TryMarshalGet(outAchievementAddress, out outAchievement))
- {
- Bindings.EOS_Achievements_PlayerAchievement_Release(outAchievementAddress);
- }
-
- return funcResult;
- }
-
- ///
- /// Fetches a player achievement from a given index.
- ///
- ///
- /// Structure containing the Epic Online Services Account ID and index being accessed
- /// The player achievement data for the given index, if it exists and is valid, use when finished
- ///
- /// if the information is available and passed out in OutAchievement
- /// if you pass a null pointer for the out parameter
- /// if the player achievement is not found
- /// if you pass an invalid user ID
- ///
- public Result CopyPlayerAchievementByIndex(CopyPlayerAchievementByIndexOptions options, out PlayerAchievement outAchievement)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var outAchievementAddress = System.IntPtr.Zero;
-
- var funcResult = Bindings.EOS_Achievements_CopyPlayerAchievementByIndex(InnerHandle, optionsAddress, ref outAchievementAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- if (Helper.TryMarshalGet(outAchievementAddress, out outAchievement))
- {
- Bindings.EOS_Achievements_PlayerAchievement_Release(outAchievementAddress);
- }
-
- return funcResult;
- }
-
- ///
- /// DEPRECATED! Use instead.
- ///
- /// Fetches an unlocked achievement from a given achievement ID.
- ///
- ///
- /// Structure containing the Epic Online Services Account ID and achievement ID being accessed
- /// The unlocked achievement data for the given achievement ID, if it exists and is valid, use when finished
- ///
- /// if the information is available and passed out in OutAchievement
- /// if you pass a null pointer for the out parameter
- /// if the unlocked achievement is not found
- ///
- public Result CopyUnlockedAchievementByAchievementId(CopyUnlockedAchievementByAchievementIdOptions options, out UnlockedAchievement outAchievement)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var outAchievementAddress = System.IntPtr.Zero;
-
- var funcResult = Bindings.EOS_Achievements_CopyUnlockedAchievementByAchievementId(InnerHandle, optionsAddress, ref outAchievementAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- if (Helper.TryMarshalGet(outAchievementAddress, out outAchievement))
- {
- Bindings.EOS_Achievements_UnlockedAchievement_Release(outAchievementAddress);
- }
-
- return funcResult;
- }
-
- ///
- /// DEPRECATED! Use instead.
- ///
- /// Fetches an unlocked achievement from a given index.
- ///
- ///
- /// Structure containing the Epic Online Services Account ID and index being accessed
- /// The unlocked achievement data for the given index, if it exists and is valid, use when finished
- ///
- /// if the information is available and passed out in OutAchievement
- /// if you pass a null pointer for the out parameter
- /// if the unlocked achievement is not found
- ///
- public Result CopyUnlockedAchievementByIndex(CopyUnlockedAchievementByIndexOptions options, out UnlockedAchievement outAchievement)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var outAchievementAddress = System.IntPtr.Zero;
-
- var funcResult = Bindings.EOS_Achievements_CopyUnlockedAchievementByIndex(InnerHandle, optionsAddress, ref outAchievementAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- if (Helper.TryMarshalGet(outAchievementAddress, out outAchievement))
- {
- Bindings.EOS_Achievements_UnlockedAchievement_Release(outAchievementAddress);
- }
-
- return funcResult;
- }
-
- ///
- /// Fetch the number of achievement definitions that are cached locally.
- ///
- ///
- /// The Options associated with retrieving the achievement definition count
- ///
- /// Number of achievement definitions or 0 if there is an error
- ///
- public uint GetAchievementDefinitionCount(GetAchievementDefinitionCountOptions options)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var funcResult = Bindings.EOS_Achievements_GetAchievementDefinitionCount(InnerHandle, optionsAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- return funcResult;
- }
-
- ///
- /// Fetch the number of player achievements that are cached locally.
- ///
- ///
- /// The Options associated with retrieving the player achievement count
- ///
- /// Number of player achievements or 0 if there is an error
- ///
- public uint GetPlayerAchievementCount(GetPlayerAchievementCountOptions options)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var funcResult = Bindings.EOS_Achievements_GetPlayerAchievementCount(InnerHandle, optionsAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- return funcResult;
- }
-
- ///
- /// DEPRECATED! Use , and filter for unlocked instead.
- ///
- /// Fetch the number of unlocked achievements that are cached locally.
- ///
- ///
- /// The Options associated with retrieving the unlocked achievement count
- ///
- /// Number of unlocked achievements or 0 if there is an error
- ///
- public uint GetUnlockedAchievementCount(GetUnlockedAchievementCountOptions options)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var funcResult = Bindings.EOS_Achievements_GetUnlockedAchievementCount(InnerHandle, optionsAddress);
-
- Helper.TryMarshalDispose(ref optionsAddress);
-
- return funcResult;
- }
-
- ///
- /// Query for a list of definitions for all existing achievements, including localized text, icon IDs and whether an achievement is hidden.
- ///
- /// @note When the Social Overlay is enabled then this will be called automatically. The Social Overlay is enabled by default (see ).
- ///
- /// Structure containing information about the application whose achievement definitions we're retrieving.
- /// Arbitrary data that is passed back to you in the CompletionDelegate
- /// This function is called when the query definitions operation completes.
- ///
- /// if the operation completes successfully
- /// if any of the options are incorrect
- ///
- public void QueryDefinitions(QueryDefinitionsOptions options, object clientData, OnQueryDefinitionsCompleteCallback completionDelegate)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var clientDataAddress = System.IntPtr.Zero;
-
- var completionDelegateInternal = new OnQueryDefinitionsCompleteCallbackInternal(OnQueryDefinitionsCompleteCallbackInternalImplementation);
- Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
-
- Bindings.EOS_Achievements_QueryDefinitions(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal);
-
- Helper.TryMarshalDispose(ref optionsAddress);
- }
-
- ///
- /// Query for a list of achievements for a specific player, including progress towards completion for each achievement.
- ///
- /// @note When the Social Overlay is enabled then this will be called automatically. The Social Overlay is enabled by default (see ).
- ///
- /// Structure containing information about the player whose achievements we're retrieving.
- /// Arbitrary data that is passed back to you in the CompletionDelegate
- /// This function is called when the query player achievements operation completes.
- ///
- /// if the operation completes successfully
- /// if any of the userid options are incorrect
- /// if any of the other options are incorrect
- ///
- public void QueryPlayerAchievements(QueryPlayerAchievementsOptions options, object clientData, OnQueryPlayerAchievementsCompleteCallback completionDelegate)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var clientDataAddress = System.IntPtr.Zero;
-
- var completionDelegateInternal = new OnQueryPlayerAchievementsCompleteCallbackInternal(OnQueryPlayerAchievementsCompleteCallbackInternalImplementation);
- Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
-
- Bindings.EOS_Achievements_QueryPlayerAchievements(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal);
-
- Helper.TryMarshalDispose(ref optionsAddress);
- }
-
- ///
- /// Unregister from receiving achievement unlocked notifications.
- ///
- ///
- /// Handle representing the registered callback
- public void RemoveNotifyAchievementsUnlocked(ulong inId)
- {
- Helper.TryRemoveCallbackByNotificationId(inId);
-
- Bindings.EOS_Achievements_RemoveNotifyAchievementsUnlocked(InnerHandle, inId);
- }
-
- ///
- /// Unlocks a number of achievements for a specific player.
- ///
- /// Structure containing information about the achievements and the player whose achievements we're unlocking.
- /// Arbitrary data that is passed back to you in the CompletionDelegate
- /// This function is called when the unlock achievements operation completes.
- ///
- /// if the operation completes successfully
- /// if any of the options are incorrect
- ///
- public void UnlockAchievements(UnlockAchievementsOptions options, object clientData, OnUnlockAchievementsCompleteCallback completionDelegate)
- {
- var optionsAddress = System.IntPtr.Zero;
- Helper.TryMarshalSet(ref optionsAddress, options);
-
- var clientDataAddress = System.IntPtr.Zero;
-
- var completionDelegateInternal = new OnUnlockAchievementsCompleteCallbackInternal(OnUnlockAchievementsCompleteCallbackInternalImplementation);
- Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
-
- Bindings.EOS_Achievements_UnlockAchievements(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal);
-
- Helper.TryMarshalDispose(ref optionsAddress);
- }
-
- [MonoPInvokeCallback(typeof(OnAchievementsUnlockedCallbackInternal))]
- internal static void OnAchievementsUnlockedCallbackInternalImplementation(System.IntPtr data)
- {
- OnAchievementsUnlockedCallback callback;
- OnAchievementsUnlockedCallbackInfo callbackInfo;
- if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo))
- {
- callback(callbackInfo);
- }
- }
-
- [MonoPInvokeCallback(typeof(OnAchievementsUnlockedCallbackV2Internal))]
- internal static void OnAchievementsUnlockedCallbackV2InternalImplementation(System.IntPtr data)
- {
- OnAchievementsUnlockedCallbackV2 callback;
- OnAchievementsUnlockedCallbackV2Info callbackInfo;
- if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo))
- {
- callback(callbackInfo);
- }
- }
-
- [MonoPInvokeCallback(typeof(OnQueryDefinitionsCompleteCallbackInternal))]
- internal static void OnQueryDefinitionsCompleteCallbackInternalImplementation(System.IntPtr data)
- {
- OnQueryDefinitionsCompleteCallback callback;
- OnQueryDefinitionsCompleteCallbackInfo callbackInfo;
- if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo))
- {
- callback(callbackInfo);
- }
- }
-
- [MonoPInvokeCallback(typeof(OnQueryPlayerAchievementsCompleteCallbackInternal))]
- internal static void OnQueryPlayerAchievementsCompleteCallbackInternalImplementation(System.IntPtr data)
- {
- OnQueryPlayerAchievementsCompleteCallback callback;
- OnQueryPlayerAchievementsCompleteCallbackInfo callbackInfo;
- if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo))
- {
- callback(callbackInfo);
- }
- }
-
- [MonoPInvokeCallback(typeof(OnUnlockAchievementsCompleteCallbackInternal))]
- internal static void OnUnlockAchievementsCompleteCallbackInternalImplementation(System.IntPtr data)
- {
- OnUnlockAchievementsCompleteCallback callback;
- OnUnlockAchievementsCompleteCallbackInfo callbackInfo;
- if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo))
- {
- callback(callbackInfo);
- }
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+// This file is automatically generated. Changes to this file may be overwritten.
+
+namespace Epic.OnlineServices.Achievements
+{
+ public sealed partial class AchievementsInterface : Handle
+ {
+ public AchievementsInterface()
+ {
+ }
+
+ public AchievementsInterface(System.IntPtr innerHandle) : base(innerHandle)
+ {
+ }
+
+ ///
+ /// Timestamp value representing an undefined UnlockTime for and
+ ///
+ public const int AchievementUnlocktimeUndefined = -1;
+
+ ///
+ /// The most recent version of the API.
+ ///
+ public const int AddnotifyachievementsunlockedApiLatest = 1;
+
+ ///
+ /// The most recent version of the API.
+ ///
+ public const int Addnotifyachievementsunlockedv2ApiLatest = 2;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int Copyachievementdefinitionv2ByachievementidApiLatest = 2;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int Copyachievementdefinitionv2ByindexApiLatest = 2;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int CopydefinitionbyachievementidApiLatest = 1;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int CopydefinitionbyindexApiLatest = 1;
+
+ ///
+ /// DEPRECATED! Use instead.
+ ///
+ public const int Copydefinitionv2ByachievementidApiLatest = Copyachievementdefinitionv2ByachievementidApiLatest;
+
+ ///
+ /// DEPRECATED! Use instead.
+ ///
+ public const int Copydefinitionv2ByindexApiLatest = Copyachievementdefinitionv2ByindexApiLatest;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int CopyplayerachievementbyachievementidApiLatest = 2;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int CopyplayerachievementbyindexApiLatest = 2;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int CopyunlockedachievementbyachievementidApiLatest = 1;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int CopyunlockedachievementbyindexApiLatest = 1;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int DefinitionApiLatest = 1;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int Definitionv2ApiLatest = 2;
+
+ ///
+ /// The most recent version of the API.
+ ///
+ public const int GetachievementdefinitioncountApiLatest = 1;
+
+ ///
+ /// The most recent version of the API.
+ ///
+ public const int GetplayerachievementcountApiLatest = 1;
+
+ ///
+ /// The most recent version of the API.
+ ///
+ public const int GetunlockedachievementcountApiLatest = 1;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int PlayerachievementApiLatest = 2;
+
+ public const int PlayerstatinfoApiLatest = 1;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int QuerydefinitionsApiLatest = 3;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int QueryplayerachievementsApiLatest = 2;
+
+ ///
+ /// DEPRECATED! Use instead.
+ ///
+ public const int StatthresholdApiLatest = StatthresholdsApiLatest;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int StatthresholdsApiLatest = 1;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int UnlockachievementsApiLatest = 1;
+
+ ///
+ /// The most recent version of the struct.
+ ///
+ public const int UnlockedachievementApiLatest = 1;
+
+ ///
+ /// DEPRECATED! Use instead.
+ ///
+ /// Register to receive achievement unlocked notifications.
+ /// must call EOS_Achievements_RemoveNotifyAchievementsUnlocked to remove the notification
+ ///
+ ///
+ /// Structure containing information about the achievement unlocked notification
+ /// Arbitrary data that is passed back to you in the CompletionDelegate
+ /// A callback that is fired when an achievement unlocked notification for a user has been received
+ ///
+ /// handle representing the registered callback
+ ///
+ public ulong AddNotifyAchievementsUnlocked(ref AddNotifyAchievementsUnlockedOptions options, object clientData, OnAchievementsUnlockedCallback notificationFn)
+ {
+ AddNotifyAchievementsUnlockedOptionsInternal optionsInternal = new AddNotifyAchievementsUnlockedOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var clientDataAddress = System.IntPtr.Zero;
+
+ var notificationFnInternal = new OnAchievementsUnlockedCallbackInternal(OnAchievementsUnlockedCallbackInternalImplementation);
+ Helper.AddCallback(out clientDataAddress, clientData, notificationFn, notificationFnInternal);
+
+ var funcResult = Bindings.EOS_Achievements_AddNotifyAchievementsUnlocked(InnerHandle, ref optionsInternal, clientDataAddress, notificationFnInternal);
+
+ Helper.Dispose(ref optionsInternal);
+
+ Helper.AssignNotificationIdToCallback(clientDataAddress, funcResult);
+
+ return funcResult;
+ }
+
+ ///
+ /// Register to receive achievement unlocked notifications.
+ /// must call EOS_Achievements_RemoveNotifyAchievementsUnlocked to remove the notification
+ ///
+ ///
+ /// Structure containing information about the achievement unlocked notification
+ /// Arbitrary data that is passed back to you in the CompletionDelegate
+ /// A callback that is fired when an achievement unlocked notification for a user has been received
+ ///
+ /// handle representing the registered callback
+ ///
+ public ulong AddNotifyAchievementsUnlockedV2(ref AddNotifyAchievementsUnlockedV2Options options, object clientData, OnAchievementsUnlockedCallbackV2 notificationFn)
+ {
+ AddNotifyAchievementsUnlockedV2OptionsInternal optionsInternal = new AddNotifyAchievementsUnlockedV2OptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var clientDataAddress = System.IntPtr.Zero;
+
+ var notificationFnInternal = new OnAchievementsUnlockedCallbackV2Internal(OnAchievementsUnlockedCallbackV2InternalImplementation);
+ Helper.AddCallback(out clientDataAddress, clientData, notificationFn, notificationFnInternal);
+
+ var funcResult = Bindings.EOS_Achievements_AddNotifyAchievementsUnlockedV2(InnerHandle, ref optionsInternal, clientDataAddress, notificationFnInternal);
+
+ Helper.Dispose(ref optionsInternal);
+
+ Helper.AssignNotificationIdToCallback(clientDataAddress, funcResult);
+
+ return funcResult;
+ }
+
+ ///
+ /// DEPRECATED! Use instead.
+ ///
+ /// Fetches an achievement definition from a given achievement ID.
+ ///
+ ///
+ ///
+ /// Structure containing the achievement ID being accessed
+ /// The achievement definition for the given achievement ID, if it exists and is valid, use when finished
+ ///
+ /// if the information is available and passed out in OutDefinition
+ /// if you pass a null pointer for the out parameter
+ /// if the achievement definition is not found
+ ///
+ public Result CopyAchievementDefinitionByAchievementId(ref CopyAchievementDefinitionByAchievementIdOptions options, out Definition? outDefinition)
+ {
+ CopyAchievementDefinitionByAchievementIdOptionsInternal optionsInternal = new CopyAchievementDefinitionByAchievementIdOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var outDefinitionAddress = System.IntPtr.Zero;
+
+ var funcResult = Bindings.EOS_Achievements_CopyAchievementDefinitionByAchievementId(InnerHandle, ref optionsInternal, ref outDefinitionAddress);
+
+ Helper.Dispose(ref optionsInternal);
+
+ Helper.Get(outDefinitionAddress, out outDefinition);
+ if (outDefinition != null)
+ {
+ Bindings.EOS_Achievements_Definition_Release(outDefinitionAddress);
+ }
+
+ return funcResult;
+ }
+
+ ///
+ /// DEPRECATED! Use instead.
+ ///
+ /// Fetches an achievement definition from a given index.
+ ///
+ ///
+ ///
+ /// Structure containing the index being accessed
+ /// The achievement definition for the given index, if it exists and is valid, use when finished
+ ///
+ /// if the information is available and passed out in OutDefinition
+ /// if you pass a null pointer for the out parameter
+ /// if the achievement definition is not found
+ ///
+ public Result CopyAchievementDefinitionByIndex(ref CopyAchievementDefinitionByIndexOptions options, out Definition? outDefinition)
+ {
+ CopyAchievementDefinitionByIndexOptionsInternal optionsInternal = new CopyAchievementDefinitionByIndexOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var outDefinitionAddress = System.IntPtr.Zero;
+
+ var funcResult = Bindings.EOS_Achievements_CopyAchievementDefinitionByIndex(InnerHandle, ref optionsInternal, ref outDefinitionAddress);
+
+ Helper.Dispose(ref optionsInternal);
+
+ Helper.Get(outDefinitionAddress, out outDefinition);
+ if (outDefinition != null)
+ {
+ Bindings.EOS_Achievements_Definition_Release(outDefinitionAddress);
+ }
+
+ return funcResult;
+ }
+
+ ///
+ /// Fetches an achievement definition from a given achievement ID.
+ ///
+ ///
+ /// Structure containing the achievement ID being accessed
+ /// The achievement definition for the given achievement ID, if it exists and is valid, use when finished
+ ///
+ /// if the information is available and passed out in OutDefinition
+ /// if you pass a null pointer for the out parameter
+ /// if the achievement definition is not found
+ /// if any of the userid options are incorrect
+ ///
+ public Result CopyAchievementDefinitionV2ByAchievementId(ref CopyAchievementDefinitionV2ByAchievementIdOptions options, out DefinitionV2? outDefinition)
+ {
+ CopyAchievementDefinitionV2ByAchievementIdOptionsInternal optionsInternal = new CopyAchievementDefinitionV2ByAchievementIdOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var outDefinitionAddress = System.IntPtr.Zero;
+
+ var funcResult = Bindings.EOS_Achievements_CopyAchievementDefinitionV2ByAchievementId(InnerHandle, ref optionsInternal, ref outDefinitionAddress);
+
+ Helper.Dispose(ref optionsInternal);
+
+ Helper.Get(outDefinitionAddress, out outDefinition);
+ if (outDefinition != null)
+ {
+ Bindings.EOS_Achievements_DefinitionV2_Release(outDefinitionAddress);
+ }
+
+ return funcResult;
+ }
+
+ ///
+ /// Fetches an achievement definition from a given index.
+ ///
+ ///
+ /// Structure containing the index being accessed
+ /// The achievement definition for the given index, if it exists and is valid, use when finished
+ ///
+ /// if the information is available and passed out in OutDefinition
+ /// if you pass a null pointer for the out parameter
+ /// if the achievement definition is not found
+ /// if any of the userid options are incorrect
+ ///
+ public Result CopyAchievementDefinitionV2ByIndex(ref CopyAchievementDefinitionV2ByIndexOptions options, out DefinitionV2? outDefinition)
+ {
+ CopyAchievementDefinitionV2ByIndexOptionsInternal optionsInternal = new CopyAchievementDefinitionV2ByIndexOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var outDefinitionAddress = System.IntPtr.Zero;
+
+ var funcResult = Bindings.EOS_Achievements_CopyAchievementDefinitionV2ByIndex(InnerHandle, ref optionsInternal, ref outDefinitionAddress);
+
+ Helper.Dispose(ref optionsInternal);
+
+ Helper.Get(outDefinitionAddress, out outDefinition);
+ if (outDefinition != null)
+ {
+ Bindings.EOS_Achievements_DefinitionV2_Release(outDefinitionAddress);
+ }
+
+ return funcResult;
+ }
+
+ ///
+ /// Fetches a player achievement from a given achievement ID.
+ ///
+ ///
+ /// Structure containing the Product User ID and achievement ID being accessed
+ /// The player achievement data for the given achievement ID, if it exists and is valid, use when finished
+ ///
+ /// if the information is available and passed out in OutAchievement
+ /// if you pass a null pointer for the out parameter
+ /// if the player achievement is not found
+ /// if you pass an invalid user ID
+ ///
+ public Result CopyPlayerAchievementByAchievementId(ref CopyPlayerAchievementByAchievementIdOptions options, out PlayerAchievement? outAchievement)
+ {
+ CopyPlayerAchievementByAchievementIdOptionsInternal optionsInternal = new CopyPlayerAchievementByAchievementIdOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var outAchievementAddress = System.IntPtr.Zero;
+
+ var funcResult = Bindings.EOS_Achievements_CopyPlayerAchievementByAchievementId(InnerHandle, ref optionsInternal, ref outAchievementAddress);
+
+ Helper.Dispose(ref optionsInternal);
+
+ Helper.Get(outAchievementAddress, out outAchievement);
+ if (outAchievement != null)
+ {
+ Bindings.EOS_Achievements_PlayerAchievement_Release(outAchievementAddress);
+ }
+
+ return funcResult;
+ }
+
+ ///
+ /// Fetches a player achievement from a given index.
+ ///
+ ///
+ /// Structure containing the Product User ID and index being accessed
+ /// The player achievement data for the given index, if it exists and is valid, use when finished
+ ///
+ /// if the information is available and passed out in OutAchievement
+ /// if you pass a null pointer for the out parameter
+ /// if the player achievement is not found
+ /// if you pass an invalid user ID
+ ///
+ public Result CopyPlayerAchievementByIndex(ref CopyPlayerAchievementByIndexOptions options, out PlayerAchievement? outAchievement)
+ {
+ CopyPlayerAchievementByIndexOptionsInternal optionsInternal = new CopyPlayerAchievementByIndexOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var outAchievementAddress = System.IntPtr.Zero;
+
+ var funcResult = Bindings.EOS_Achievements_CopyPlayerAchievementByIndex(InnerHandle, ref optionsInternal, ref outAchievementAddress);
+
+ Helper.Dispose(ref optionsInternal);
+
+ Helper.Get(outAchievementAddress, out outAchievement);
+ if (outAchievement != null)
+ {
+ Bindings.EOS_Achievements_PlayerAchievement_Release(outAchievementAddress);
+ }
+
+ return funcResult;
+ }
+
+ ///
+ /// DEPRECATED! Use instead.
+ ///
+ /// Fetches an unlocked achievement from a given achievement ID.
+ ///
+ ///
+ /// Structure containing the Product User ID and achievement ID being accessed
+ /// The unlocked achievement data for the given achievement ID, if it exists and is valid, use when finished
+ ///
+ /// if the information is available and passed out in OutAchievement
+ /// if you pass a null pointer for the out parameter
+ /// if the unlocked achievement is not found
+ ///
+ public Result CopyUnlockedAchievementByAchievementId(ref CopyUnlockedAchievementByAchievementIdOptions options, out UnlockedAchievement? outAchievement)
+ {
+ CopyUnlockedAchievementByAchievementIdOptionsInternal optionsInternal = new CopyUnlockedAchievementByAchievementIdOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var outAchievementAddress = System.IntPtr.Zero;
+
+ var funcResult = Bindings.EOS_Achievements_CopyUnlockedAchievementByAchievementId(InnerHandle, ref optionsInternal, ref outAchievementAddress);
+
+ Helper.Dispose(ref optionsInternal);
+
+ Helper.Get(outAchievementAddress, out outAchievement);
+ if (outAchievement != null)
+ {
+ Bindings.EOS_Achievements_UnlockedAchievement_Release(outAchievementAddress);
+ }
+
+ return funcResult;
+ }
+
+ ///
+ /// DEPRECATED! Use instead.
+ ///
+ /// Fetches an unlocked achievement from a given index.
+ ///
+ ///
+ /// Structure containing the Product User ID and index being accessed
+ /// The unlocked achievement data for the given index, if it exists and is valid, use when finished
+ ///
+ /// if the information is available and passed out in OutAchievement
+ /// if you pass a null pointer for the out parameter
+ /// if the unlocked achievement is not found
+ ///
+ public Result CopyUnlockedAchievementByIndex(ref CopyUnlockedAchievementByIndexOptions options, out UnlockedAchievement? outAchievement)
+ {
+ CopyUnlockedAchievementByIndexOptionsInternal optionsInternal = new CopyUnlockedAchievementByIndexOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var outAchievementAddress = System.IntPtr.Zero;
+
+ var funcResult = Bindings.EOS_Achievements_CopyUnlockedAchievementByIndex(InnerHandle, ref optionsInternal, ref outAchievementAddress);
+
+ Helper.Dispose(ref optionsInternal);
+
+ Helper.Get(outAchievementAddress, out outAchievement);
+ if (outAchievement != null)
+ {
+ Bindings.EOS_Achievements_UnlockedAchievement_Release(outAchievementAddress);
+ }
+
+ return funcResult;
+ }
+
+ ///
+ /// Fetch the number of achievement definitions that are cached locally.
+ ///
+ ///
+ /// The Options associated with retrieving the achievement definition count
+ ///
+ /// Number of achievement definitions or 0 if there is an error
+ ///
+ public uint GetAchievementDefinitionCount(ref GetAchievementDefinitionCountOptions options)
+ {
+ GetAchievementDefinitionCountOptionsInternal optionsInternal = new GetAchievementDefinitionCountOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var funcResult = Bindings.EOS_Achievements_GetAchievementDefinitionCount(InnerHandle, ref optionsInternal);
+
+ Helper.Dispose(ref optionsInternal);
+
+ return funcResult;
+ }
+
+ ///
+ /// Fetch the number of player achievements that are cached locally.
+ ///
+ ///
+ /// The Options associated with retrieving the player achievement count
+ ///
+ /// Number of player achievements or 0 if there is an error
+ ///
+ public uint GetPlayerAchievementCount(ref GetPlayerAchievementCountOptions options)
+ {
+ GetPlayerAchievementCountOptionsInternal optionsInternal = new GetPlayerAchievementCountOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var funcResult = Bindings.EOS_Achievements_GetPlayerAchievementCount(InnerHandle, ref optionsInternal);
+
+ Helper.Dispose(ref optionsInternal);
+
+ return funcResult;
+ }
+
+ ///
+ /// DEPRECATED! Use , and filter for unlocked instead.
+ ///
+ /// Fetch the number of unlocked achievements that are cached locally.
+ ///
+ ///
+ /// The Options associated with retrieving the unlocked achievement count
+ ///
+ /// Number of unlocked achievements or 0 if there is an error
+ ///
+ public uint GetUnlockedAchievementCount(ref GetUnlockedAchievementCountOptions options)
+ {
+ GetUnlockedAchievementCountOptionsInternal optionsInternal = new GetUnlockedAchievementCountOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var funcResult = Bindings.EOS_Achievements_GetUnlockedAchievementCount(InnerHandle, ref optionsInternal);
+
+ Helper.Dispose(ref optionsInternal);
+
+ return funcResult;
+ }
+
+ ///
+ /// Query for a list of definitions for all existing achievements, including localized text, icon IDs and whether an achievement is hidden.
+ /// When the Social Overlay is enabled then this will be called automatically. The Social Overlay is enabled by default (see EOS_PF_DISABLE_SOCIAL_OVERLAY).
+ ///
+ /// Structure containing information about the application whose achievement definitions we're retrieving.
+ /// Arbitrary data that is passed back to you in the CompletionDelegate
+ /// This function is called when the query definitions operation completes.
+ ///
+ /// if the operation completes successfully
+ /// if any of the options are incorrect
+ ///
+ public void QueryDefinitions(ref QueryDefinitionsOptions options, object clientData, OnQueryDefinitionsCompleteCallback completionDelegate)
+ {
+ QueryDefinitionsOptionsInternal optionsInternal = new QueryDefinitionsOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var clientDataAddress = System.IntPtr.Zero;
+
+ var completionDelegateInternal = new OnQueryDefinitionsCompleteCallbackInternal(OnQueryDefinitionsCompleteCallbackInternalImplementation);
+ Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
+
+ Bindings.EOS_Achievements_QueryDefinitions(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
+
+ Helper.Dispose(ref optionsInternal);
+ }
+
+ ///
+ /// Query for a list of achievements for a specific player, including progress towards completion for each achievement.
+ /// When the Social Overlay is enabled then this will be called automatically. The Social Overlay is enabled by default (see EOS_PF_DISABLE_SOCIAL_OVERLAY).
+ ///
+ /// Structure containing information about the player whose achievements we're retrieving.
+ /// Arbitrary data that is passed back to you in the CompletionDelegate
+ /// This function is called when the query player achievements operation completes.
+ ///
+ /// if the operation completes successfully
+ /// if any of the userid options are incorrect
+ /// if any of the other options are incorrect
+ ///
+ public void QueryPlayerAchievements(ref QueryPlayerAchievementsOptions options, object clientData, OnQueryPlayerAchievementsCompleteCallback completionDelegate)
+ {
+ QueryPlayerAchievementsOptionsInternal optionsInternal = new QueryPlayerAchievementsOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var clientDataAddress = System.IntPtr.Zero;
+
+ var completionDelegateInternal = new OnQueryPlayerAchievementsCompleteCallbackInternal(OnQueryPlayerAchievementsCompleteCallbackInternalImplementation);
+ Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
+
+ Bindings.EOS_Achievements_QueryPlayerAchievements(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
+
+ Helper.Dispose(ref optionsInternal);
+ }
+
+ ///
+ /// Unregister from receiving achievement unlocked notifications.
+ ///
+ ///
+ /// Handle representing the registered callback
+ public void RemoveNotifyAchievementsUnlocked(ulong inId)
+ {
+ Bindings.EOS_Achievements_RemoveNotifyAchievementsUnlocked(InnerHandle, inId);
+
+ Helper.RemoveCallbackByNotificationId(inId);
+ }
+
+ ///
+ /// Unlocks a number of achievements for a specific player.
+ ///
+ /// Structure containing information about the achievements and the player whose achievements we're unlocking.
+ /// Arbitrary data that is passed back to you in the CompletionDelegate
+ /// This function is called when the unlock achievements operation completes.
+ ///
+ /// if the operation completes successfully
+ /// if any of the options are incorrect
+ ///
+ public void UnlockAchievements(ref UnlockAchievementsOptions options, object clientData, OnUnlockAchievementsCompleteCallback completionDelegate)
+ {
+ UnlockAchievementsOptionsInternal optionsInternal = new UnlockAchievementsOptionsInternal();
+ optionsInternal.Set(ref options);
+
+ var clientDataAddress = System.IntPtr.Zero;
+
+ var completionDelegateInternal = new OnUnlockAchievementsCompleteCallbackInternal(OnUnlockAchievementsCompleteCallbackInternalImplementation);
+ Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
+
+ Bindings.EOS_Achievements_UnlockAchievements(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
+
+ Helper.Dispose(ref optionsInternal);
+ }
+
+ [MonoPInvokeCallback(typeof(OnAchievementsUnlockedCallbackInternal))]
+ internal static void OnAchievementsUnlockedCallbackInternalImplementation(ref OnAchievementsUnlockedCallbackInfoInternal data)
+ {
+ OnAchievementsUnlockedCallback callback;
+ OnAchievementsUnlockedCallbackInfo callbackInfo;
+ if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
+ {
+ callback(ref callbackInfo);
+ }
+ }
+
+ [MonoPInvokeCallback(typeof(OnAchievementsUnlockedCallbackV2Internal))]
+ internal static void OnAchievementsUnlockedCallbackV2InternalImplementation(ref OnAchievementsUnlockedCallbackV2InfoInternal data)
+ {
+ OnAchievementsUnlockedCallbackV2 callback;
+ OnAchievementsUnlockedCallbackV2Info callbackInfo;
+ if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
+ {
+ callback(ref callbackInfo);
+ }
+ }
+
+ [MonoPInvokeCallback(typeof(OnQueryDefinitionsCompleteCallbackInternal))]
+ internal static void OnQueryDefinitionsCompleteCallbackInternalImplementation(ref OnQueryDefinitionsCompleteCallbackInfoInternal data)
+ {
+ OnQueryDefinitionsCompleteCallback callback;
+ OnQueryDefinitionsCompleteCallbackInfo callbackInfo;
+ if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
+ {
+ callback(ref callbackInfo);
+ }
+ }
+
+ [MonoPInvokeCallback(typeof(OnQueryPlayerAchievementsCompleteCallbackInternal))]
+ internal static void OnQueryPlayerAchievementsCompleteCallbackInternalImplementation(ref OnQueryPlayerAchievementsCompleteCallbackInfoInternal data)
+ {
+ OnQueryPlayerAchievementsCompleteCallback callback;
+ OnQueryPlayerAchievementsCompleteCallbackInfo callbackInfo;
+ if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
+ {
+ callback(ref callbackInfo);
+ }
+ }
+
+ [MonoPInvokeCallback(typeof(OnUnlockAchievementsCompleteCallbackInternal))]
+ internal static void OnUnlockAchievementsCompleteCallbackInternalImplementation(ref OnUnlockAchievementsCompleteCallbackInfoInternal data)
+ {
+ OnUnlockAchievementsCompleteCallback callback;
+ OnUnlockAchievementsCompleteCallbackInfo callbackInfo;
+ if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
+ {
+ callback(ref callbackInfo);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AchievementsInterface.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AchievementsInterface.cs.meta
deleted file mode 100644
index aee953f1..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AchievementsInterface.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 91b363f40f7831b46af876f05404ed1f
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedOptions.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedOptions.cs
index 22ff21c7..42af0888 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedOptions.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedOptions.cs
@@ -1,35 +1,35 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-// This file is automatically generated. Changes to this file may be overwritten.
-
-namespace Epic.OnlineServices.Achievements
-{
- ///
- /// Input parameters for the function.
- ///
- public class AddNotifyAchievementsUnlockedOptions
- {
- }
-
- [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
- internal struct AddNotifyAchievementsUnlockedOptionsInternal : ISettable, System.IDisposable
- {
- private int m_ApiVersion;
-
- public void Set(AddNotifyAchievementsUnlockedOptions other)
- {
- if (other != null)
- {
- m_ApiVersion = AchievementsInterface.AddnotifyachievementsunlockedApiLatest;
- }
- }
-
- public void Set(object other)
- {
- Set(other as AddNotifyAchievementsUnlockedOptions);
- }
-
- public void Dispose()
- {
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+// This file is automatically generated. Changes to this file may be overwritten.
+
+namespace Epic.OnlineServices.Achievements
+{
+ ///
+ /// Input parameters for the function.
+ ///
+ public struct AddNotifyAchievementsUnlockedOptions
+ {
+ }
+
+ [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
+ internal struct AddNotifyAchievementsUnlockedOptionsInternal : ISettable, System.IDisposable
+ {
+ private int m_ApiVersion;
+
+ public void Set(ref AddNotifyAchievementsUnlockedOptions other)
+ {
+ m_ApiVersion = AchievementsInterface.AddnotifyachievementsunlockedApiLatest;
+ }
+
+ public void Set(ref AddNotifyAchievementsUnlockedOptions? other)
+ {
+ if (other.HasValue)
+ {
+ m_ApiVersion = AchievementsInterface.AddnotifyachievementsunlockedApiLatest;
+ }
+ }
+
+ public void Dispose()
+ {
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedOptions.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedOptions.cs.meta
deleted file mode 100644
index a44b16c6..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedOptions.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 27ac1b5bf7e7b7e44b0fd97384e00471
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedV2Options.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedV2Options.cs
index 4190e8c7..412cc73f 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedV2Options.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedV2Options.cs
@@ -1,35 +1,35 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-// This file is automatically generated. Changes to this file may be overwritten.
-
-namespace Epic.OnlineServices.Achievements
-{
- ///
- /// Input parameters for the function.
- ///
- public class AddNotifyAchievementsUnlockedV2Options
- {
- }
-
- [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
- internal struct AddNotifyAchievementsUnlockedV2OptionsInternal : ISettable, System.IDisposable
- {
- private int m_ApiVersion;
-
- public void Set(AddNotifyAchievementsUnlockedV2Options other)
- {
- if (other != null)
- {
- m_ApiVersion = AchievementsInterface.Addnotifyachievementsunlockedv2ApiLatest;
- }
- }
-
- public void Set(object other)
- {
- Set(other as AddNotifyAchievementsUnlockedV2Options);
- }
-
- public void Dispose()
- {
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+// This file is automatically generated. Changes to this file may be overwritten.
+
+namespace Epic.OnlineServices.Achievements
+{
+ ///
+ /// Input parameters for the function.
+ ///
+ public struct AddNotifyAchievementsUnlockedV2Options
+ {
+ }
+
+ [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
+ internal struct AddNotifyAchievementsUnlockedV2OptionsInternal : ISettable, System.IDisposable
+ {
+ private int m_ApiVersion;
+
+ public void Set(ref AddNotifyAchievementsUnlockedV2Options other)
+ {
+ m_ApiVersion = AchievementsInterface.Addnotifyachievementsunlockedv2ApiLatest;
+ }
+
+ public void Set(ref AddNotifyAchievementsUnlockedV2Options? other)
+ {
+ if (other.HasValue)
+ {
+ m_ApiVersion = AchievementsInterface.Addnotifyachievementsunlockedv2ApiLatest;
+ }
+ }
+
+ public void Dispose()
+ {
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedV2Options.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedV2Options.cs.meta
deleted file mode 100644
index a5d4b69e..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/AddNotifyAchievementsUnlockedV2Options.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 210bbcd9a74f8db43ada84fcd51d8aca
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByAchievementIdOptions.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByAchievementIdOptions.cs
index c05a5626..8b1fc1ac 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByAchievementIdOptions.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByAchievementIdOptions.cs
@@ -1,50 +1,51 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-// This file is automatically generated. Changes to this file may be overwritten.
-
-namespace Epic.OnlineServices.Achievements
-{
- ///
- /// Input parameters for the function.
- ///
- public class CopyAchievementDefinitionByAchievementIdOptions
- {
- ///
- /// Achievement ID to look for when copying definition from the cache
- ///
- public string AchievementId { get; set; }
- }
-
- [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
- internal struct CopyAchievementDefinitionByAchievementIdOptionsInternal : ISettable, System.IDisposable
- {
- private int m_ApiVersion;
- private System.IntPtr m_AchievementId;
-
- public string AchievementId
- {
- set
- {
- Helper.TryMarshalSet(ref m_AchievementId, value);
- }
- }
-
- public void Set(CopyAchievementDefinitionByAchievementIdOptions other)
- {
- if (other != null)
- {
- m_ApiVersion = AchievementsInterface.CopydefinitionbyachievementidApiLatest;
- AchievementId = other.AchievementId;
- }
- }
-
- public void Set(object other)
- {
- Set(other as CopyAchievementDefinitionByAchievementIdOptions);
- }
-
- public void Dispose()
- {
- Helper.TryMarshalDispose(ref m_AchievementId);
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+// This file is automatically generated. Changes to this file may be overwritten.
+
+namespace Epic.OnlineServices.Achievements
+{
+ ///
+ /// Input parameters for the function.
+ ///
+ public struct CopyAchievementDefinitionByAchievementIdOptions
+ {
+ ///
+ /// Achievement ID to look for when copying definition from the cache
+ ///
+ public Utf8String AchievementId { get; set; }
+ }
+
+ [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
+ internal struct CopyAchievementDefinitionByAchievementIdOptionsInternal : ISettable, System.IDisposable
+ {
+ private int m_ApiVersion;
+ private System.IntPtr m_AchievementId;
+
+ public Utf8String AchievementId
+ {
+ set
+ {
+ Helper.Set(value, ref m_AchievementId);
+ }
+ }
+
+ public void Set(ref CopyAchievementDefinitionByAchievementIdOptions other)
+ {
+ m_ApiVersion = AchievementsInterface.CopydefinitionbyachievementidApiLatest;
+ AchievementId = other.AchievementId;
+ }
+
+ public void Set(ref CopyAchievementDefinitionByAchievementIdOptions? other)
+ {
+ if (other.HasValue)
+ {
+ m_ApiVersion = AchievementsInterface.CopydefinitionbyachievementidApiLatest;
+ AchievementId = other.Value.AchievementId;
+ }
+ }
+
+ public void Dispose()
+ {
+ Helper.Dispose(ref m_AchievementId);
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByAchievementIdOptions.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByAchievementIdOptions.cs.meta
deleted file mode 100644
index 8227b161..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByAchievementIdOptions.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: fa7ef783960cb3a418583f7df08be2b6
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByIndexOptions.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByIndexOptions.cs
index 0bee755f..259664fa 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByIndexOptions.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByIndexOptions.cs
@@ -1,49 +1,50 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-// This file is automatically generated. Changes to this file may be overwritten.
-
-namespace Epic.OnlineServices.Achievements
-{
- ///
- /// Input parameters for the function.
- ///
- public class CopyAchievementDefinitionByIndexOptions
- {
- ///
- /// Index of the achievement definition to retrieve from the cache
- ///
- public uint AchievementIndex { get; set; }
- }
-
- [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
- internal struct CopyAchievementDefinitionByIndexOptionsInternal : ISettable, System.IDisposable
- {
- private int m_ApiVersion;
- private uint m_AchievementIndex;
-
- public uint AchievementIndex
- {
- set
- {
- m_AchievementIndex = value;
- }
- }
-
- public void Set(CopyAchievementDefinitionByIndexOptions other)
- {
- if (other != null)
- {
- m_ApiVersion = AchievementsInterface.CopydefinitionbyindexApiLatest;
- AchievementIndex = other.AchievementIndex;
- }
- }
-
- public void Set(object other)
- {
- Set(other as CopyAchievementDefinitionByIndexOptions);
- }
-
- public void Dispose()
- {
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+// This file is automatically generated. Changes to this file may be overwritten.
+
+namespace Epic.OnlineServices.Achievements
+{
+ ///
+ /// Input parameters for the function.
+ ///
+ public struct CopyAchievementDefinitionByIndexOptions
+ {
+ ///
+ /// Index of the achievement definition to retrieve from the cache
+ ///
+ public uint AchievementIndex { get; set; }
+ }
+
+ [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
+ internal struct CopyAchievementDefinitionByIndexOptionsInternal : ISettable, System.IDisposable
+ {
+ private int m_ApiVersion;
+ private uint m_AchievementIndex;
+
+ public uint AchievementIndex
+ {
+ set
+ {
+ m_AchievementIndex = value;
+ }
+ }
+
+ public void Set(ref CopyAchievementDefinitionByIndexOptions other)
+ {
+ m_ApiVersion = AchievementsInterface.CopydefinitionbyindexApiLatest;
+ AchievementIndex = other.AchievementIndex;
+ }
+
+ public void Set(ref CopyAchievementDefinitionByIndexOptions? other)
+ {
+ if (other.HasValue)
+ {
+ m_ApiVersion = AchievementsInterface.CopydefinitionbyindexApiLatest;
+ AchievementIndex = other.Value.AchievementIndex;
+ }
+ }
+
+ public void Dispose()
+ {
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByIndexOptions.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByIndexOptions.cs.meta
deleted file mode 100644
index d26d8241..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionByIndexOptions.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: f76bab9e397b93a4e9c35ce563039a44
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByAchievementIdOptions.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByAchievementIdOptions.cs
index 358ecd9e..47d621b4 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByAchievementIdOptions.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByAchievementIdOptions.cs
@@ -1,50 +1,51 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-// This file is automatically generated. Changes to this file may be overwritten.
-
-namespace Epic.OnlineServices.Achievements
-{
- ///
- /// Input parameters for the function.
- ///
- public class CopyAchievementDefinitionV2ByAchievementIdOptions
- {
- ///
- /// Achievement ID to look for when copying the definition from the cache.
- ///
- public string AchievementId { get; set; }
- }
-
- [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
- internal struct CopyAchievementDefinitionV2ByAchievementIdOptionsInternal : ISettable, System.IDisposable
- {
- private int m_ApiVersion;
- private System.IntPtr m_AchievementId;
-
- public string AchievementId
- {
- set
- {
- Helper.TryMarshalSet(ref m_AchievementId, value);
- }
- }
-
- public void Set(CopyAchievementDefinitionV2ByAchievementIdOptions other)
- {
- if (other != null)
- {
- m_ApiVersion = AchievementsInterface.Copyachievementdefinitionv2ByachievementidApiLatest;
- AchievementId = other.AchievementId;
- }
- }
-
- public void Set(object other)
- {
- Set(other as CopyAchievementDefinitionV2ByAchievementIdOptions);
- }
-
- public void Dispose()
- {
- Helper.TryMarshalDispose(ref m_AchievementId);
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+// This file is automatically generated. Changes to this file may be overwritten.
+
+namespace Epic.OnlineServices.Achievements
+{
+ ///
+ /// Input parameters for the function.
+ ///
+ public struct CopyAchievementDefinitionV2ByAchievementIdOptions
+ {
+ ///
+ /// Achievement ID to look for when copying the definition from the cache.
+ ///
+ public Utf8String AchievementId { get; set; }
+ }
+
+ [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
+ internal struct CopyAchievementDefinitionV2ByAchievementIdOptionsInternal : ISettable, System.IDisposable
+ {
+ private int m_ApiVersion;
+ private System.IntPtr m_AchievementId;
+
+ public Utf8String AchievementId
+ {
+ set
+ {
+ Helper.Set(value, ref m_AchievementId);
+ }
+ }
+
+ public void Set(ref CopyAchievementDefinitionV2ByAchievementIdOptions other)
+ {
+ m_ApiVersion = AchievementsInterface.Copyachievementdefinitionv2ByachievementidApiLatest;
+ AchievementId = other.AchievementId;
+ }
+
+ public void Set(ref CopyAchievementDefinitionV2ByAchievementIdOptions? other)
+ {
+ if (other.HasValue)
+ {
+ m_ApiVersion = AchievementsInterface.Copyachievementdefinitionv2ByachievementidApiLatest;
+ AchievementId = other.Value.AchievementId;
+ }
+ }
+
+ public void Dispose()
+ {
+ Helper.Dispose(ref m_AchievementId);
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByAchievementIdOptions.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByAchievementIdOptions.cs.meta
deleted file mode 100644
index b0fa6bf7..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByAchievementIdOptions.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: d0be84c5a29f5a34ca63f0968ddce2fc
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByIndexOptions.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByIndexOptions.cs
index ba975020..423f9ea6 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByIndexOptions.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByIndexOptions.cs
@@ -1,49 +1,50 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-// This file is automatically generated. Changes to this file may be overwritten.
-
-namespace Epic.OnlineServices.Achievements
-{
- ///
- /// Input parameters for the function.
- ///
- public class CopyAchievementDefinitionV2ByIndexOptions
- {
- ///
- /// Index of the achievement definition to retrieve from the cache.
- ///
- public uint AchievementIndex { get; set; }
- }
-
- [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
- internal struct CopyAchievementDefinitionV2ByIndexOptionsInternal : ISettable, System.IDisposable
- {
- private int m_ApiVersion;
- private uint m_AchievementIndex;
-
- public uint AchievementIndex
- {
- set
- {
- m_AchievementIndex = value;
- }
- }
-
- public void Set(CopyAchievementDefinitionV2ByIndexOptions other)
- {
- if (other != null)
- {
- m_ApiVersion = AchievementsInterface.Copyachievementdefinitionv2ByindexApiLatest;
- AchievementIndex = other.AchievementIndex;
- }
- }
-
- public void Set(object other)
- {
- Set(other as CopyAchievementDefinitionV2ByIndexOptions);
- }
-
- public void Dispose()
- {
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+// This file is automatically generated. Changes to this file may be overwritten.
+
+namespace Epic.OnlineServices.Achievements
+{
+ ///
+ /// Input parameters for the function.
+ ///
+ public struct CopyAchievementDefinitionV2ByIndexOptions
+ {
+ ///
+ /// Index of the achievement definition to retrieve from the cache.
+ ///
+ public uint AchievementIndex { get; set; }
+ }
+
+ [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
+ internal struct CopyAchievementDefinitionV2ByIndexOptionsInternal : ISettable, System.IDisposable
+ {
+ private int m_ApiVersion;
+ private uint m_AchievementIndex;
+
+ public uint AchievementIndex
+ {
+ set
+ {
+ m_AchievementIndex = value;
+ }
+ }
+
+ public void Set(ref CopyAchievementDefinitionV2ByIndexOptions other)
+ {
+ m_ApiVersion = AchievementsInterface.Copyachievementdefinitionv2ByindexApiLatest;
+ AchievementIndex = other.AchievementIndex;
+ }
+
+ public void Set(ref CopyAchievementDefinitionV2ByIndexOptions? other)
+ {
+ if (other.HasValue)
+ {
+ m_ApiVersion = AchievementsInterface.Copyachievementdefinitionv2ByindexApiLatest;
+ AchievementIndex = other.Value.AchievementIndex;
+ }
+ }
+
+ public void Dispose()
+ {
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByIndexOptions.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByIndexOptions.cs.meta
deleted file mode 100644
index b234770e..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyAchievementDefinitionV2ByIndexOptions.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 134fa143d5bcb7a4ca2569833d5f857f
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByAchievementIdOptions.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByAchievementIdOptions.cs
index e16dd6b5..5560e4a4 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByAchievementIdOptions.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByAchievementIdOptions.cs
@@ -1,82 +1,85 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-// This file is automatically generated. Changes to this file may be overwritten.
-
-namespace Epic.OnlineServices.Achievements
-{
- ///
- /// Input parameters for the function.
- ///
- public class CopyPlayerAchievementByAchievementIdOptions
- {
- ///
- /// The Product User ID for the user whose achievement is to be retrieved.
- ///
- public ProductUserId TargetUserId { get; set; }
-
- ///
- /// Achievement ID to search for when retrieving player achievement data from the cache.
- ///
- public string AchievementId { get; set; }
-
- ///
- /// The Product User ID for the user who is querying for a player achievement. For a Dedicated Server this should be null.
- ///
- public ProductUserId LocalUserId { get; set; }
- }
-
- [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
- internal struct CopyPlayerAchievementByAchievementIdOptionsInternal : ISettable, System.IDisposable
- {
- private int m_ApiVersion;
- private System.IntPtr m_TargetUserId;
- private System.IntPtr m_AchievementId;
- private System.IntPtr m_LocalUserId;
-
- public ProductUserId TargetUserId
- {
- set
- {
- Helper.TryMarshalSet(ref m_TargetUserId, value);
- }
- }
-
- public string AchievementId
- {
- set
- {
- Helper.TryMarshalSet(ref m_AchievementId, value);
- }
- }
-
- public ProductUserId LocalUserId
- {
- set
- {
- Helper.TryMarshalSet(ref m_LocalUserId, value);
- }
- }
-
- public void Set(CopyPlayerAchievementByAchievementIdOptions other)
- {
- if (other != null)
- {
- m_ApiVersion = AchievementsInterface.CopyplayerachievementbyachievementidApiLatest;
- TargetUserId = other.TargetUserId;
- AchievementId = other.AchievementId;
- LocalUserId = other.LocalUserId;
- }
- }
-
- public void Set(object other)
- {
- Set(other as CopyPlayerAchievementByAchievementIdOptions);
- }
-
- public void Dispose()
- {
- Helper.TryMarshalDispose(ref m_TargetUserId);
- Helper.TryMarshalDispose(ref m_AchievementId);
- Helper.TryMarshalDispose(ref m_LocalUserId);
- }
- }
+// Copyright Epic Games, Inc. All Rights Reserved.
+// This file is automatically generated. Changes to this file may be overwritten.
+
+namespace Epic.OnlineServices.Achievements
+{
+ ///
+ /// Input parameters for the function.
+ ///
+ public struct CopyPlayerAchievementByAchievementIdOptions
+ {
+ ///
+ /// The Product User ID for the user whose achievement is to be retrieved.
+ ///
+ public ProductUserId TargetUserId { get; set; }
+
+ ///
+ /// Achievement ID to search for when retrieving player achievement data from the cache.
+ ///
+ public Utf8String AchievementId { get; set; }
+
+ ///
+ /// The Product User ID for the user who is querying for a player achievement. For a Dedicated Server this should be null.
+ ///
+ public ProductUserId LocalUserId { get; set; }
+ }
+
+ [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
+ internal struct CopyPlayerAchievementByAchievementIdOptionsInternal : ISettable, System.IDisposable
+ {
+ private int m_ApiVersion;
+ private System.IntPtr m_TargetUserId;
+ private System.IntPtr m_AchievementId;
+ private System.IntPtr m_LocalUserId;
+
+ public ProductUserId TargetUserId
+ {
+ set
+ {
+ Helper.Set(value, ref m_TargetUserId);
+ }
+ }
+
+ public Utf8String AchievementId
+ {
+ set
+ {
+ Helper.Set(value, ref m_AchievementId);
+ }
+ }
+
+ public ProductUserId LocalUserId
+ {
+ set
+ {
+ Helper.Set(value, ref m_LocalUserId);
+ }
+ }
+
+ public void Set(ref CopyPlayerAchievementByAchievementIdOptions other)
+ {
+ m_ApiVersion = AchievementsInterface.CopyplayerachievementbyachievementidApiLatest;
+ TargetUserId = other.TargetUserId;
+ AchievementId = other.AchievementId;
+ LocalUserId = other.LocalUserId;
+ }
+
+ public void Set(ref CopyPlayerAchievementByAchievementIdOptions? other)
+ {
+ if (other.HasValue)
+ {
+ m_ApiVersion = AchievementsInterface.CopyplayerachievementbyachievementidApiLatest;
+ TargetUserId = other.Value.TargetUserId;
+ AchievementId = other.Value.AchievementId;
+ LocalUserId = other.Value.LocalUserId;
+ }
+ }
+
+ public void Dispose()
+ {
+ Helper.Dispose(ref m_TargetUserId);
+ Helper.Dispose(ref m_AchievementId);
+ Helper.Dispose(ref m_LocalUserId);
+ }
+ }
}
\ No newline at end of file
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByAchievementIdOptions.cs.meta b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByAchievementIdOptions.cs.meta
deleted file mode 100644
index 5b71fa69..00000000
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByAchievementIdOptions.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 085d9d8848929194f8a2cac75a8b1023
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByIndexOptions.cs b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByIndexOptions.cs
index 292f7a37..ac25f0c5 100644
--- a/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByIndexOptions.cs
+++ b/Mirror/Runtime/Transport/EpicOnlineTransport/EOSSDK/Generated/Achievements/CopyPlayerAchievementByIndexOptions.cs
@@ -1,81 +1,84 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-// This file is automatically generated. Changes to this file may be overwritten.
-
-namespace Epic.OnlineServices.Achievements
-{
- ///
- /// Input parameters for the