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