// 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(ref AddNotifyClientActionRequiredOptions options, object clientData, OnClientActionRequiredCallback notificationFn) { AddNotifyClientActionRequiredOptionsInternal optionsInternal = new AddNotifyClientActionRequiredOptionsInternal(); optionsInternal.Set(ref options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnClientActionRequiredCallbackInternal(OnClientActionRequiredCallbackInternalImplementation); Helper.AddCallback(out clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = Bindings.EOS_AntiCheatServer_AddNotifyClientActionRequired(InnerHandle, ref optionsInternal, clientDataAddress, notificationFnInternal); Helper.Dispose(ref optionsInternal); Helper.AssignNotificationIdToCallback(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(ref AddNotifyClientAuthStatusChangedOptions options, object clientData, OnClientAuthStatusChangedCallback notificationFn) { AddNotifyClientAuthStatusChangedOptionsInternal optionsInternal = new AddNotifyClientAuthStatusChangedOptionsInternal(); optionsInternal.Set(ref options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnClientAuthStatusChangedCallbackInternal(OnClientAuthStatusChangedCallbackInternalImplementation); Helper.AddCallback(out clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = Bindings.EOS_AntiCheatServer_AddNotifyClientAuthStatusChanged(InnerHandle, ref optionsInternal, clientDataAddress, notificationFnInternal); Helper.Dispose(ref optionsInternal); Helper.AssignNotificationIdToCallback(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(ref AddNotifyMessageToClientOptions options, object clientData, OnMessageToClientCallback notificationFn) { AddNotifyMessageToClientOptionsInternal optionsInternal = new AddNotifyMessageToClientOptionsInternal(); optionsInternal.Set(ref options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnMessageToClientCallbackInternal(OnMessageToClientCallbackInternalImplementation); Helper.AddCallback(out clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = Bindings.EOS_AntiCheatServer_AddNotifyMessageToClient(InnerHandle, ref optionsInternal, clientDataAddress, notificationFnInternal); Helper.Dispose(ref optionsInternal); Helper.AssignNotificationIdToCallback(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(ref BeginSessionOptions options) { BeginSessionOptionsInternal optionsInternal = new BeginSessionOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_BeginSession(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref EndSessionOptions options) { EndSessionOptionsInternal optionsInternal = new EndSessionOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_EndSession(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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. /// 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 /// public Result GetProtectMessageOutputLength(ref GetProtectMessageOutputLengthOptions options, out uint outBufferSizeBytes) { GetProtectMessageOutputLengthOptionsInternal optionsInternal = new GetProtectMessageOutputLengthOptionsInternal(); optionsInternal.Set(ref options); outBufferSizeBytes = Helper.GetDefault(); var funcResult = Bindings.EOS_AntiCheatServer_GetProtectMessageOutputLength(InnerHandle, ref optionsInternal, ref outBufferSizeBytes); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.LogEventOptions options) { AntiCheatCommon.LogEventOptionsInternal optionsInternal = new AntiCheatCommon.LogEventOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_LogEvent(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.LogGameRoundEndOptions options) { AntiCheatCommon.LogGameRoundEndOptionsInternal optionsInternal = new AntiCheatCommon.LogGameRoundEndOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_LogGameRoundEnd(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.LogGameRoundStartOptions options) { AntiCheatCommon.LogGameRoundStartOptionsInternal optionsInternal = new AntiCheatCommon.LogGameRoundStartOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_LogGameRoundStart(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.LogPlayerDespawnOptions options) { AntiCheatCommon.LogPlayerDespawnOptionsInternal optionsInternal = new AntiCheatCommon.LogPlayerDespawnOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerDespawn(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.LogPlayerReviveOptions options) { AntiCheatCommon.LogPlayerReviveOptionsInternal optionsInternal = new AntiCheatCommon.LogPlayerReviveOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerRevive(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.LogPlayerSpawnOptions options) { AntiCheatCommon.LogPlayerSpawnOptionsInternal optionsInternal = new AntiCheatCommon.LogPlayerSpawnOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerSpawn(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.LogPlayerTakeDamageOptions options) { AntiCheatCommon.LogPlayerTakeDamageOptionsInternal optionsInternal = new AntiCheatCommon.LogPlayerTakeDamageOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerTakeDamage(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.LogPlayerTickOptions options) { AntiCheatCommon.LogPlayerTickOptionsInternal optionsInternal = new AntiCheatCommon.LogPlayerTickOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerTick(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.LogPlayerUseAbilityOptions options) { AntiCheatCommon.LogPlayerUseAbilityOptionsInternal optionsInternal = new AntiCheatCommon.LogPlayerUseAbilityOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerUseAbility(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.LogPlayerUseWeaponOptions options) { AntiCheatCommon.LogPlayerUseWeaponOptionsInternal optionsInternal = new AntiCheatCommon.LogPlayerUseWeaponOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_LogPlayerUseWeapon(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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. /// On success, the 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(ref ProtectMessageOptions options, System.ArraySegment outBuffer, out uint outBytesWritten) { ProtectMessageOptionsInternal optionsInternal = new ProtectMessageOptionsInternal(); optionsInternal.Set(ref options); outBytesWritten = 0; System.IntPtr outBufferAddress = Helper.AddPinnedBuffer(outBuffer); var funcResult = Bindings.EOS_AntiCheatServer_ProtectMessage(InnerHandle, ref optionsInternal, outBufferAddress, ref outBytesWritten); Helper.Dispose(ref optionsInternal); Helper.Dispose(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(ref ReceiveMessageFromClientOptions options) { ReceiveMessageFromClientOptionsInternal optionsInternal = new ReceiveMessageFromClientOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_ReceiveMessageFromClient(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref RegisterClientOptions options) { RegisterClientOptionsInternal optionsInternal = new RegisterClientOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_RegisterClient(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.RegisterEventOptions options) { AntiCheatCommon.RegisterEventOptionsInternal optionsInternal = new AntiCheatCommon.RegisterEventOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_RegisterEvent(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); return funcResult; } /// /// Remove a previously bound handler. /// /// The previously bound notification ID public void RemoveNotifyClientActionRequired(ulong notificationId) { Bindings.EOS_AntiCheatServer_RemoveNotifyClientActionRequired(InnerHandle, notificationId); Helper.RemoveCallbackByNotificationId(notificationId); } /// /// Remove a previously bound handler. /// /// The previously bound notification ID public void RemoveNotifyClientAuthStatusChanged(ulong notificationId) { Bindings.EOS_AntiCheatServer_RemoveNotifyClientAuthStatusChanged(InnerHandle, notificationId); Helper.RemoveCallbackByNotificationId(notificationId); } /// /// Remove a previously bound handler. /// /// The previously bound notification ID public void RemoveNotifyMessageToClient(ulong notificationId) { Bindings.EOS_AntiCheatServer_RemoveNotifyMessageToClient(InnerHandle, notificationId); Helper.RemoveCallbackByNotificationId(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(ref AntiCheatCommon.SetClientDetailsOptions options) { AntiCheatCommon.SetClientDetailsOptionsInternal optionsInternal = new AntiCheatCommon.SetClientDetailsOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_SetClientDetails(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref SetClientNetworkStateOptions options) { SetClientNetworkStateOptionsInternal optionsInternal = new SetClientNetworkStateOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_SetClientNetworkState(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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(ref AntiCheatCommon.SetGameSessionIdOptions options) { AntiCheatCommon.SetGameSessionIdOptionsInternal optionsInternal = new AntiCheatCommon.SetGameSessionIdOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_SetGameSessionId(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); 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. /// On success, the number of bytes that were written to OutBuffer. /// /// - If the message was unprotected successfully /// - If input data was invalid /// public Result UnprotectMessage(ref UnprotectMessageOptions options, System.ArraySegment outBuffer, out uint outBytesWritten) { UnprotectMessageOptionsInternal optionsInternal = new UnprotectMessageOptionsInternal(); optionsInternal.Set(ref options); outBytesWritten = 0; System.IntPtr outBufferAddress = Helper.AddPinnedBuffer(outBuffer); var funcResult = Bindings.EOS_AntiCheatServer_UnprotectMessage(InnerHandle, ref optionsInternal, outBufferAddress, ref outBytesWritten); Helper.Dispose(ref optionsInternal); Helper.Dispose(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(ref UnregisterClientOptions options) { UnregisterClientOptionsInternal optionsInternal = new UnregisterClientOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_AntiCheatServer_UnregisterClient(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); return funcResult; } [MonoPInvokeCallback(typeof(OnClientActionRequiredCallbackInternal))] internal static void OnClientActionRequiredCallbackInternalImplementation(ref AntiCheatCommon.OnClientActionRequiredCallbackInfoInternal data) { OnClientActionRequiredCallback callback; AntiCheatCommon.OnClientActionRequiredCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo)) { callback(ref callbackInfo); } } [MonoPInvokeCallback(typeof(OnClientAuthStatusChangedCallbackInternal))] internal static void OnClientAuthStatusChangedCallbackInternalImplementation(ref AntiCheatCommon.OnClientAuthStatusChangedCallbackInfoInternal data) { OnClientAuthStatusChangedCallback callback; AntiCheatCommon.OnClientAuthStatusChangedCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo)) { callback(ref callbackInfo); } } [MonoPInvokeCallback(typeof(OnMessageToClientCallbackInternal))] internal static void OnMessageToClientCallbackInternalImplementation(ref AntiCheatCommon.OnMessageToClientCallbackInfoInternal data) { OnMessageToClientCallback callback; AntiCheatCommon.OnMessageToClientCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo)) { callback(ref callbackInfo); } } } }