// Copyright Epic Games, Inc. All Rights Reserved. // This file is automatically generated. Changes to this file may be overwritten. namespace Epic.OnlineServices.Stats { public sealed partial class StatsInterface : Handle { public StatsInterface() { } public StatsInterface(System.IntPtr innerHandle) : base(innerHandle) { } /// /// The most recent version of the struct. /// public const int CopystatbyindexApiLatest = 1; /// /// The most recent version of the struct. /// public const int CopystatbynameApiLatest = 1; /// /// DEPRECATED! Use instead. /// public const int GetstatcountApiLatest = GetstatscountApiLatest; /// /// The most recent version of the API. /// public const int GetstatscountApiLatest = 1; /// /// The most recent version of the struct. /// public const int IngestdataApiLatest = 1; /// /// The most recent version of the struct. /// public const int IngeststatApiLatest = 3; /// /// Maximum number of stats that can be ingested in a single operation. /// public const int MaxIngestStats = 3000; /// /// Maximum number of stats that can be queried in a single operation. /// public const int MaxQueryStats = 1000; /// /// The most recent version of the struct. /// public const int QuerystatsApiLatest = 3; /// /// The most recent version of the struct. /// public const int StatApiLatest = 1; /// /// Timestamp value representing an undefined StartTime or EndTime for /// public const int TimeUndefined = -1; /// /// Fetches a stat from a given index. Use when finished with the data. /// /// /// Structure containing the Product User ID and index being accessed /// The stat data for the given index, if it exists and is valid /// /// if the information is available and passed out in OutStat /// if you pass a null pointer for the out parameter /// if the stat is not found /// public Result CopyStatByIndex(ref CopyStatByIndexOptions options, out Stat? outStat) { CopyStatByIndexOptionsInternal optionsInternal = new CopyStatByIndexOptionsInternal(); optionsInternal.Set(ref options); var outStatAddress = System.IntPtr.Zero; var funcResult = Bindings.EOS_Stats_CopyStatByIndex(InnerHandle, ref optionsInternal, ref outStatAddress); Helper.Dispose(ref optionsInternal); Helper.Get(outStatAddress, out outStat); if (outStat != null) { Bindings.EOS_Stats_Stat_Release(outStatAddress); } return funcResult; } /// /// Fetches a stat from cached stats by name. Use when finished with the data. /// /// /// Structure containing the Product User ID and name being accessed /// The stat data for the given name, if it exists and is valid /// /// if the information is available and passed out in OutStat /// if you pass a null pointer for the out parameter /// if the stat is not found /// public Result CopyStatByName(ref CopyStatByNameOptions options, out Stat? outStat) { CopyStatByNameOptionsInternal optionsInternal = new CopyStatByNameOptionsInternal(); optionsInternal.Set(ref options); var outStatAddress = System.IntPtr.Zero; var funcResult = Bindings.EOS_Stats_CopyStatByName(InnerHandle, ref optionsInternal, ref outStatAddress); Helper.Dispose(ref optionsInternal); Helper.Get(outStatAddress, out outStat); if (outStat != null) { Bindings.EOS_Stats_Stat_Release(outStatAddress); } return funcResult; } /// /// Fetch the number of stats that are cached locally. /// /// /// The Options associated with retrieving the stat count /// /// Number of stats or 0 if there is an error /// public uint GetStatsCount(ref GetStatCountOptions options) { GetStatCountOptionsInternal optionsInternal = new GetStatCountOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_Stats_GetStatsCount(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); return funcResult; } /// /// Ingest a stat by the amount specified in Options. /// When the operation is complete and the delegate is triggered the stat will be uploaded to the backend to be processed. /// The stat may not be updated immediately and an achievement using the stat may take a while to be unlocked once the stat has been uploaded. /// /// Structure containing information about the stat we're ingesting. /// Arbitrary data that is passed back to you in the CompletionDelegate. /// This function is called when the ingest stat operation completes. /// /// if the operation completes successfully /// if any of the options are incorrect /// if target user ID is missing or incorrect /// public void IngestStat(ref IngestStatOptions options, object clientData, OnIngestStatCompleteCallback completionDelegate) { IngestStatOptionsInternal optionsInternal = new IngestStatOptionsInternal(); optionsInternal.Set(ref options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnIngestStatCompleteCallbackInternal(OnIngestStatCompleteCallbackInternalImplementation); Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_Stats_IngestStat(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal); Helper.Dispose(ref optionsInternal); } /// /// Query for a list of stats for a specific player. /// /// Structure containing information about the player whose stats we're retrieving. /// Arbitrary data that is passed back to you in the CompletionDelegate /// This function is called when the query player stats operation completes. /// /// if the operation completes successfully /// if any of the options are incorrect /// if target user ID is missing or incorrect /// public void QueryStats(ref QueryStatsOptions options, object clientData, OnQueryStatsCompleteCallback completionDelegate) { QueryStatsOptionsInternal optionsInternal = new QueryStatsOptionsInternal(); optionsInternal.Set(ref options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnQueryStatsCompleteCallbackInternal(OnQueryStatsCompleteCallbackInternalImplementation); Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_Stats_QueryStats(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal); Helper.Dispose(ref optionsInternal); } [MonoPInvokeCallback(typeof(OnIngestStatCompleteCallbackInternal))] internal static void OnIngestStatCompleteCallbackInternalImplementation(ref IngestStatCompleteCallbackInfoInternal data) { OnIngestStatCompleteCallback callback; IngestStatCompleteCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo)) { callback(ref callbackInfo); } } [MonoPInvokeCallback(typeof(OnQueryStatsCompleteCallbackInternal))] internal static void OnQueryStatsCompleteCallbackInternalImplementation(ref OnQueryStatsCompleteCallbackInfoInternal data) { OnQueryStatsCompleteCallback callback; OnQueryStatsCompleteCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo)) { callback(ref callbackInfo); } } } }