// Copyright Epic Games, Inc. All Rights Reserved. // This file is automatically generated. Changes to this file may be overwritten. namespace Epic.OnlineServices.AntiCheatClient { public sealed partial class AntiCheatClientInterface : Handle { public AntiCheatClientInterface() { } public AntiCheatClientInterface(System.IntPtr innerHandle) : base(innerHandle) { } public const int AddexternalintegritycatalogApiLatest = 1; public const int AddnotifymessagetopeerApiLatest = 1; public const int AddnotifymessagetoserverApiLatest = 1; public const int AddnotifypeeractionrequiredApiLatest = 1; public const int AddnotifypeerauthstatuschangedApiLatest = 1; public const int BeginsessionApiLatest = 3; public const int EndsessionApiLatest = 1; public const int GetprotectmessageoutputlengthApiLatest = 1; /// /// A special peer handle that represents the client itself. /// It does not need to be registered or unregistered and is /// used in OnPeerActionRequiredCallback to quickly signal to the user /// that they will not be able to join online play. /// public System.IntPtr PeerSelf = (System.IntPtr)(-1); public const int PollstatusApiLatest = 1; public const int ProtectmessageApiLatest = 1; public const int ReceivemessagefrompeerApiLatest = 1; public const int ReceivemessagefromserverApiLatest = 1; public const int RegisterpeerApiLatest = 1; public const int UnprotectmessageApiLatest = 1; public const int UnregisterpeerApiLatest = 1; /// /// Optional. Adds an integrity catalog and certificate pair from outside the game directory, /// for example to support mods that load from elsewhere. /// Mode: All /// /// Structure containing input data. /// /// - If the integrity catalog was added successfully /// - If input data was invalid /// public Result AddExternalIntegrityCatalog(AddExternalIntegrityCatalogOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatClient_AddExternalIntegrityCatalog(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Add a callback issued when a new message must be dispatched to a connected peer. The bound function will only be called /// between a successful call to and the matching call in mode . /// Mode: . /// /// Structure containing input data /// This value is returned to the caller when NotificationFn is invoked /// The callback to be fired /// /// A valid notification ID if successfully bound, or otherwise /// public ulong AddNotifyMessageToPeer(AddNotifyMessageToPeerOptions options, object clientData, OnMessageToPeerCallback notificationFn) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnMessageToPeerCallbackInternal(OnMessageToPeerCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = Bindings.EOS_AntiCheatClient_AddNotifyMessageToPeer(InnerHandle, optionsAddress, clientDataAddress, notificationFnInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Add a callback issued when a new message must be dispatched to the game server. The bound function will only be called /// between a successful call to and the matching call in mode . /// Mode: . /// /// Structure containing input data /// This value is returned to the caller when NotificationFn is invoked /// The callback to be fired /// /// A valid notification ID if successfully bound, or otherwise /// public ulong AddNotifyMessageToServer(AddNotifyMessageToServerOptions options, object clientData, OnMessageToServerCallback notificationFn) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnMessageToServerCallbackInternal(OnMessageToServerCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = Bindings.EOS_AntiCheatClient_AddNotifyMessageToServer(InnerHandle, optionsAddress, clientDataAddress, notificationFnInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Add a callback issued when an action must be applied to a connected client. The bound function will only be called /// between a successful call to and the matching call in mode . /// Mode: . /// /// Structure containing input data /// This value is returned to the caller when NotificationFn is invoked /// The callback to be fired /// /// A valid notification ID if successfully bound, or otherwise /// public ulong AddNotifyPeerActionRequired(AddNotifyPeerActionRequiredOptions options, object clientData, OnPeerActionRequiredCallback notificationFn) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnPeerActionRequiredCallbackInternal(OnPeerActionRequiredCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = Bindings.EOS_AntiCheatClient_AddNotifyPeerActionRequired(InnerHandle, optionsAddress, clientDataAddress, notificationFnInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Add an optional callback issued when a connected peer's authentication status changes. The bound function will only be called /// between a successful call to and the matching call in mode . /// Mode: . /// /// Structure containing input data /// This value is returned to the caller when NotificationFn is invoked /// The callback to be fired /// /// A valid notification ID if successfully bound, or otherwise /// public ulong AddNotifyPeerAuthStatusChanged(AddNotifyPeerAuthStatusChangedOptions options, object clientData, OnPeerAuthStatusChangedCallback notificationFn) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnPeerAuthStatusChangedCallbackInternal(OnPeerAuthStatusChangedCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = Bindings.EOS_AntiCheatClient_AddNotifyPeerAuthStatusChanged(InnerHandle, optionsAddress, clientDataAddress, notificationFnInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Begins a multiplayer game session. After this call returns successfully, the client is ready to exchange /// anti-cheat messages with a game server or peer(s). When leaving one game session and connecting to a /// different one, a new anti-cheat session must be created by calling and again. /// Mode: All /// /// Structure containing input data. /// /// - If the session was started successfully /// - If input data was invalid /// - If the current mode does not support this function /// public Result BeginSession(BeginSessionOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatClient_BeginSession(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Ends a multiplayer game session, either by leaving an ongoing session or shutting it down entirely. /// Mode: All /// /// Must be called when the multiplayer session ends, or when the local user leaves a session in progress. /// /// Structure containing input data. /// /// - If the session was ended normally /// - If input data was invalid /// - If the current mode does not support this function /// public Result EndSession(EndSessionOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatClient_EndSession(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional NetProtect feature for game message encryption. /// Calculates the required decrypted buffer size for a given input data length. /// This will not change for a given SDK version, and allows one time allocation of reusable buffers. /// Mode: . /// /// Structure containing input data. /// On success, the OutBuffer length in bytes that is required to call ProtectMessage on the given input size. /// /// - If the output length was calculated successfully /// - If input data was invalid /// - If the current mode does not support this function /// public Result GetProtectMessageOutputLength(GetProtectMessageOutputLengthOptions options, out uint outBufferSizeBytes) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); outBufferSizeBytes = Helper.GetDefault(); var funcResult = Bindings.EOS_AntiCheatClient_GetProtectMessageOutputLength(InnerHandle, optionsAddress, ref outBufferSizeBytes); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Polls for changes in client integrity status. /// Mode: All /// /// The purpose of this function is to allow the game to display information /// about anti-cheat integrity problems to the user. These are often the result of a /// corrupt game installation rather than cheating attempts. This function does not /// check for violations, it only provides information about violations which have /// automatically been discovered by the anti-cheat client. Such a violation may occur /// at any time and afterwards the user will be unable to join any protected multiplayer /// session until after restarting the game. Note that this function returns /// when everything is normal and there is no violation to display. /// /// Structure containing input data. /// On success, receives a code describing the violation that occurred. /// On success, receives a string describing the violation which should be displayed to the user. /// /// - If violation information was returned successfully /// - If OutMessage is too small to receive the message string. Call again with a larger OutMessage. /// - If no violation has occurred since the last call /// public Result PollStatus(PollStatusOptions options, out AntiCheatClientViolationType outViolationType, out string outMessage) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); outViolationType = Helper.GetDefault(); System.IntPtr outMessageAddress = System.IntPtr.Zero; uint OutMessageLength = options.OutMessageLength; Helper.TryMarshalAllocate(ref outMessageAddress, OutMessageLength); var funcResult = Bindings.EOS_AntiCheatClient_PollStatus(InnerHandle, optionsAddress, ref outViolationType, outMessageAddress); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryMarshalGet(outMessageAddress, out outMessage); Helper.TryMarshalDispose(ref outMessageAddress); return funcResult; } /// /// Optional NetProtect feature for game message encryption. /// Encrypts an arbitrary message that will be sent to the game server and decrypted on the other side. /// Mode: . /// /// Options.Data and OutBuffer may refer to the same buffer to encrypt in place. /// /// Structure containing input data. /// On success, buffer where encrypted message data will be written. /// On success, the number of bytes that were written to OutBuffer. /// /// - If the message was protected successfully /// - If input data was invalid /// - If the current mode does not support this function /// public Result ProtectMessage(ProtectMessageOptions options, out byte[] outBuffer) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); System.IntPtr outBufferAddress = System.IntPtr.Zero; uint outBytesWritten = options.OutBufferSizeBytes; Helper.TryMarshalAllocate(ref outBufferAddress, outBytesWritten); var funcResult = Bindings.EOS_AntiCheatClient_ProtectMessage(InnerHandle, optionsAddress, outBufferAddress, ref outBytesWritten); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryMarshalGet(outBufferAddress, out outBuffer, outBytesWritten); Helper.TryMarshalDispose(ref outBufferAddress); return funcResult; } /// /// Call when an anti-cheat message is received from a peer. /// Mode: . /// /// Structure containing input data. /// /// - If the message was processed successfully /// - If input data was invalid /// - If the current mode does not support this function /// public Result ReceiveMessageFromPeer(ReceiveMessageFromPeerOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatClient_ReceiveMessageFromPeer(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Call when an anti-cheat message is received from the game server. /// Mode: . /// /// Structure containing input data. /// /// - If the message was processed successfully /// - If input data was invalid /// - If the current mode does not support this function /// public Result ReceiveMessageFromServer(ReceiveMessageFromServerOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatClient_ReceiveMessageFromServer(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Registers a connected peer-to-peer client. /// Mode: . /// /// Must be paired with a call to if this user leaves the session /// in progress, or if the entire session is ending. /// /// Structure containing input data. /// /// - If the player was registered successfully /// - If input data was invalid /// - If the current mode does not support this function /// public Result RegisterPeer(RegisterPeerOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatClient_RegisterPeer(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Remove a previously bound handler. /// Mode: Any. /// /// The previously bound notification ID public void RemoveNotifyMessageToPeer(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_AntiCheatClient_RemoveNotifyMessageToPeer(InnerHandle, notificationId); } /// /// Remove a previously bound handler. /// Mode: Any. /// /// The previously bound notification ID public void RemoveNotifyMessageToServer(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_AntiCheatClient_RemoveNotifyMessageToServer(InnerHandle, notificationId); } /// /// Remove a previously bound handler. /// Mode: Any. /// /// The previously bound notification ID public void RemoveNotifyPeerActionRequired(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_AntiCheatClient_RemoveNotifyPeerActionRequired(InnerHandle, notificationId); } /// /// Remove a previously bound handler. /// Mode: Any. /// /// The previously bound notification ID public void RemoveNotifyPeerAuthStatusChanged(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_AntiCheatClient_RemoveNotifyPeerAuthStatusChanged(InnerHandle, notificationId); } /// /// Optional NetProtect feature for game message encryption. /// Decrypts an encrypted message received from the game server. /// Mode: . /// /// Options.Data and OutBuffer may refer to the same buffer to decrypt in place. /// /// Structure containing input data. /// On success, buffer where encrypted message data will be written. /// On success, the number of bytes that were written to OutBuffer. /// /// - If the message was unprotected successfully /// - If input data was invalid /// - If the current mode does not support this function /// public Result UnprotectMessage(UnprotectMessageOptions options, out byte[] outBuffer) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); System.IntPtr outBufferAddress = System.IntPtr.Zero; uint outBytesWritten = options.OutBufferSizeBytes; Helper.TryMarshalAllocate(ref outBufferAddress, outBytesWritten); var funcResult = Bindings.EOS_AntiCheatClient_UnprotectMessage(InnerHandle, optionsAddress, outBufferAddress, ref outBytesWritten); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryMarshalGet(outBufferAddress, out outBuffer, outBytesWritten); Helper.TryMarshalDispose(ref outBufferAddress); return funcResult; } /// /// Unregisters a disconnected peer-to-peer client. /// Mode: . /// /// Must be called when a user leaves a session in progress. /// /// Structure containing input data. /// /// - If the player was unregistered successfully /// - If input data was invalid /// - If the current mode does not support this function /// public Result UnregisterPeer(UnregisterPeerOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatClient_UnregisterPeer(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } [MonoPInvokeCallback(typeof(OnMessageToPeerCallbackInternal))] internal static void OnMessageToPeerCallbackInternalImplementation(System.IntPtr data) { OnMessageToPeerCallback callback; AntiCheatCommon.OnMessageToClientCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnMessageToServerCallbackInternal))] internal static void OnMessageToServerCallbackInternalImplementation(System.IntPtr data) { OnMessageToServerCallback callback; OnMessageToServerCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnPeerActionRequiredCallbackInternal))] internal static void OnPeerActionRequiredCallbackInternalImplementation(System.IntPtr data) { OnPeerActionRequiredCallback callback; AntiCheatCommon.OnClientActionRequiredCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnPeerAuthStatusChangedCallbackInternal))] internal static void OnPeerAuthStatusChangedCallbackInternalImplementation(System.IntPtr data) { OnPeerAuthStatusChangedCallback callback; AntiCheatCommon.OnClientAuthStatusChangedCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } } }