// Copyright Epic Games, Inc. All Rights Reserved. // This file is automatically generated. Changes to this file may be overwritten. namespace Epic.OnlineServices.AntiCheatServer { public sealed partial class AntiCheatServerInterface : Handle { public AntiCheatServerInterface() { } public AntiCheatServerInterface(System.IntPtr innerHandle) : base(innerHandle) { } public const int AddnotifyclientactionrequiredApiLatest = 1; public const int AddnotifyclientauthstatuschangedApiLatest = 1; public const int AddnotifymessagetoclientApiLatest = 1; public const int BeginsessionApiLatest = 3; public const int BeginsessionMaxRegistertimeout = 120; /// /// Limits on RegisterTimeoutSeconds parameter /// public const int BeginsessionMinRegistertimeout = 10; public const int EndsessionApiLatest = 1; public const int GetprotectmessageoutputlengthApiLatest = 1; public const int ProtectmessageApiLatest = 1; public const int ReceivemessagefromclientApiLatest = 1; public const int RegisterclientApiLatest = 1; public const int SetclientnetworkstateApiLatest = 1; public const int UnprotectmessageApiLatest = 1; public const int UnregisterclientApiLatest = 1; /// /// 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. /// /// 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 AddNotifyClientActionRequired(AddNotifyClientActionRequiredOptions options, object clientData, OnClientActionRequiredCallback notificationFn) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnClientActionRequiredCallbackInternal(OnClientActionRequiredCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = Bindings.EOS_AntiCheatServer_AddNotifyClientActionRequired(InnerHandle, optionsAddress, clientDataAddress, notificationFnInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Add an optional callback issued when a connected client's authentication status changes. The bound function /// will only be called between a successful call to and the matching call. /// /// 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 AddNotifyClientAuthStatusChanged(AddNotifyClientAuthStatusChangedOptions options, object clientData, OnClientAuthStatusChangedCallback notificationFn) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnClientAuthStatusChangedCallbackInternal(OnClientAuthStatusChangedCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = Bindings.EOS_AntiCheatServer_AddNotifyClientAuthStatusChanged(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 a connected client. The bound function /// will only be called between a successful call to and the matching call. /// /// 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 AddNotifyMessageToClient(AddNotifyMessageToClientOptions options, object clientData, OnMessageToClientCallback notificationFn) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnMessageToClientCallbackInternal(OnMessageToClientCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = Bindings.EOS_AntiCheatServer_AddNotifyMessageToClient(InnerHandle, optionsAddress, clientDataAddress, notificationFnInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Begin the gameplay session. Event callbacks must be configured with /// and before calling this function. /// /// Structure containing input data. /// /// - If the initialization succeeded /// - If input data was invalid /// public Result BeginSession(BeginSessionOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_BeginSession(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// End the gameplay session. Should be called when the server is shutting down or entering an idle state. /// /// Structure containing input data. /// /// - If the initialization succeeded /// - If input data was invalid /// public Result EndSession(EndSessionOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_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. /// /// Structure containing input data. /// The 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 /// public Result GetProtectMessageOutputLength(GetProtectMessageOutputLengthOptions options, out uint outBufferLengthBytes) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); outBufferLengthBytes = Helper.GetDefault(); var funcResult = Bindings.EOS_AntiCheatServer_GetProtectMessageOutputLength(InnerHandle, optionsAddress, ref outBufferLengthBytes); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Logs a custom gameplay event. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the event was logged successfully /// - If input data was invalid /// public Result LogEvent(AntiCheatCommon.LogEventOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_LogEvent(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Logs a game round's end and outcome. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the event was logged successfully /// - If input data was invalid /// public Result LogGameRoundEnd(AntiCheatCommon.LogGameRoundEndOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_LogGameRoundEnd(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Logs a new game round start. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the event was logged successfully /// - If input data was invalid /// public Result LogGameRoundStart(AntiCheatCommon.LogGameRoundStartOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_LogGameRoundStart(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Logs a player despawning in the game, for example as a result of the character's death, /// switching to spectator mode, etc. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the event was logged successfully /// - If input data was invalid /// public Result LogPlayerDespawn(AntiCheatCommon.LogPlayerDespawnOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerDespawn(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Logs a player being revived after being downed (see options). /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the event was logged successfully /// - If input data was invalid /// public Result LogPlayerRevive(AntiCheatCommon.LogPlayerReviveOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerRevive(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Logs a player spawning into the game. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the event was logged successfully /// - If input data was invalid /// public Result LogPlayerSpawn(AntiCheatCommon.LogPlayerSpawnOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerSpawn(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Logs that a player has taken damage. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the event was logged successfully /// - If input data was invalid /// public Result LogPlayerTakeDamage(AntiCheatCommon.LogPlayerTakeDamageOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerTakeDamage(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Logs a player's general state including position and view direction. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the event was logged successfully /// - If input data was invalid /// public Result LogPlayerTick(AntiCheatCommon.LogPlayerTickOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerTick(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Logs that a player has used a special ability or item which affects their character's capabilities, /// for example temporarily increasing their speed or allowing them to see nearby players behind walls. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the event was logged successfully /// - If input data was invalid /// public Result LogPlayerUseAbility(AntiCheatCommon.LogPlayerUseAbilityOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerUseAbility(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Logs that a player has used a weapon, for example firing one bullet or making one melee attack. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the event was logged successfully /// - If input data was invalid /// public Result LogPlayerUseWeapon(AntiCheatCommon.LogPlayerUseWeaponOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerUseWeapon(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional NetProtect feature for game message encryption. /// Encrypts an arbitrary message that will be sent to a game client and decrypted on the other side. /// /// 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. /// Number of bytes that were written to OutBuffer. /// /// - If the message was protected successfully /// - If input data was invalid /// - If the specified ClientHandle was invalid or not currently registered. See RegisterClient. /// 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 outBufferLengthBytes = options.OutBufferSizeBytes; Helper.TryMarshalAllocate(ref outBufferAddress, outBufferLengthBytes); var funcResult = Bindings.EOS_AntiCheatServer_ProtectMessage(InnerHandle, optionsAddress, outBufferAddress, ref outBufferLengthBytes); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryMarshalGet(outBufferAddress, out outBuffer, outBufferLengthBytes); Helper.TryMarshalDispose(ref outBufferAddress); return funcResult; } /// /// Call when an anti-cheat message is received from a client. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the message was processed successfully /// - If input data was invalid /// public Result ReceiveMessageFromClient(ReceiveMessageFromClientOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_ReceiveMessageFromClient(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Register a connected client. Must be paired with a call to UnregisterClient. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the player was registered successfully /// - If input data was invalid /// public Result RegisterClient(RegisterClientOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_RegisterClient(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional Cerberus feature for gameplay data collection. /// Registers a custom gameplay event. /// /// All custom game events must be registered before is called for the first time. /// After the first call to , this function cannot be called any longer. /// /// Structure containing input data. /// /// - If the event was registered successfully /// - If input data was invalid /// public Result RegisterEvent(AntiCheatCommon.RegisterEventOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_RegisterEvent(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Remove a previously bound handler. /// /// The previously bound notification ID public void RemoveNotifyClientActionRequired(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_AntiCheatServer_RemoveNotifyClientActionRequired(InnerHandle, notificationId); } /// /// Remove a previously bound handler. /// /// The previously bound notification ID public void RemoveNotifyClientAuthStatusChanged(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_AntiCheatServer_RemoveNotifyClientAuthStatusChanged(InnerHandle, notificationId); } /// /// Remove a previously bound handler. /// /// The previously bound notification ID public void RemoveNotifyMessageToClient(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_AntiCheatServer_RemoveNotifyMessageToClient(InnerHandle, notificationId); } /// /// Optional. Sets or updates client details including input device and admin status. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the flags were updated successfully /// - If input data was invalid /// public Result SetClientDetails(AntiCheatCommon.SetClientDetailsOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_SetClientDetails(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional. Can be used to indicate that a client is legitimately known to be /// temporarily unable to communicate, for example as a result of loading a new level. /// /// The bIsNetworkActive flag must be set back to true when users enter normal /// gameplay, otherwise anti-cheat enforcement will not work correctly. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the network state was updated successfully /// - If input data was invalid /// public Result SetClientNetworkState(SetClientNetworkStateOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_SetClientNetworkState(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional. Sets or updates a game session identifier which can be attached to other data for reference. /// The identifier can be updated at any time for currently and subsequently registered clients. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the game session identifier was set successfully /// - If input data was invalid /// public Result SetGameSessionId(AntiCheatCommon.SetGameSessionIdOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_SetGameSessionId(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Optional NetProtect feature for game message encryption. /// Decrypts an encrypted message received from a game client. /// /// 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. /// Number of bytes that were written to OutBuffer. /// /// - If the message was unprotected successfully /// - If input data was invalid /// 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 outBufferLengthBytes = options.OutBufferSizeBytes; Helper.TryMarshalAllocate(ref outBufferAddress, outBufferLengthBytes); var funcResult = Bindings.EOS_AntiCheatServer_UnprotectMessage(InnerHandle, optionsAddress, outBufferAddress, ref outBufferLengthBytes); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryMarshalGet(outBufferAddress, out outBuffer, outBufferLengthBytes); Helper.TryMarshalDispose(ref outBufferAddress); return funcResult; } /// /// Unregister a disconnected client. /// /// This function may only be called between a successful call to and /// the matching call. /// /// Structure containing input data. /// /// - If the player was unregistered successfully /// - If input data was invalid /// public Result UnregisterClient(UnregisterClientOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_AntiCheatServer_UnregisterClient(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } [MonoPInvokeCallback(typeof(OnClientActionRequiredCallbackInternal))] internal static void OnClientActionRequiredCallbackInternalImplementation(System.IntPtr data) { OnClientActionRequiredCallback callback; AntiCheatCommon.OnClientActionRequiredCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnClientAuthStatusChangedCallbackInternal))] internal static void OnClientAuthStatusChangedCallbackInternalImplementation(System.IntPtr data) { OnClientAuthStatusChangedCallback callback; AntiCheatCommon.OnClientAuthStatusChangedCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnMessageToClientCallbackInternal))] internal static void OnMessageToClientCallbackInternalImplementation(System.IntPtr data) { OnMessageToClientCallback callback; AntiCheatCommon.OnMessageToClientCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } } }