// 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); } } } }