Package host.anzo.eossdk.eos.sdk
Class EOS_Stats_Interface
java.lang.Object
com.sun.jna.PointerType
host.anzo.eossdk.eos.sdk.EOS_Stats_Interface
- All Implemented Interfaces:
com.sun.jna.NativeMapped
public class EOS_Stats_Interface
extends com.sun.jna.PointerType
The Stats Interface manages user stats like number of items collected, fastest completion time for a level, number of wins/losses, number of times that a user has performed a certain action, and so on.
You can use stats to determine when to unlock achievements and how to use rank users in leaderboards.
All Stats Interface calls take a handle of type EOS_HStats as the first parameter.
This handle can be retrieved from an EOS_HPlatform handle by using the EOS_Platform_GetStatsInterface function.
- Since:
- 8/31/2023
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFetches a stat from a given index.Fetches a stat from cached stats by name.intFetch the number of stats that are cached locally.voidingestStat(EOS_Stats_IngestStatOptions options, com.sun.jna.Pointer clientData, EOS_Stats_OnIngestStatCompleteCallback completionDelegate) Ingest a stat by the amount specified in Options.voidqueryStats(EOS_Stats_QueryStatsOptions options, com.sun.jna.Pointer clientData, EOS_Stats_OnQueryStatsCompleteCallback completionDelegate) Query for a list of stats for a specific player.Methods inherited from class com.sun.jna.PointerType
equals, fromNative, getPointer, hashCode, nativeType, setPointer, toNative, toString
-
Constructor Details
-
EOS_Stats_Interface
public EOS_Stats_Interface(com.sun.jna.Pointer address) -
EOS_Stats_Interface
public EOS_Stats_Interface()
-
-
Method Details
-
ingestStat
public void ingestStat(EOS_Stats_IngestStatOptions options, com.sun.jna.Pointer clientData, EOS_Stats_OnIngestStatCompleteCallback completionDelegate) 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.- Parameters:
options- Structure containing information about the stat we're ingesting.clientData- Arbitrary data that is passed back to you in the completionDelegate.completionDelegate- This function is called when the ingest stat operation completes.
-
queryStats
public void queryStats(EOS_Stats_QueryStatsOptions options, com.sun.jna.Pointer clientData, EOS_Stats_OnQueryStatsCompleteCallback completionDelegate) Query for a list of stats for a specific player.- Parameters:
options- Structure containing information about the player whose stats we're retrieving.clientData- Arbitrary data that is passed back to you in the completionDelegatecompletionDelegate- This function is called when the query player stats operation completes.
-
getStatsCount
Fetch the number of stats that are cached locally.- Parameters:
options- The Options associated with retrieving the stat count- Returns:
- Number of stats or 0 if there is an error
- See Also:
-
copyStatByIndex
Fetches a stat from a given index. Use EOS_Stats_Stat_Release when finished with the data.- Parameters:
options- Structure containing the Product User ID and index being accessed- Returns:
- The stat data for the given index, if it exists and is valid
- Throws:
EOSInvalidParametersException- if you pass a null pointer for the out parameterEOSNotFoundException- if the stat is not foundEOSException- See Also:
-
copyStatByName
Fetches a stat from cached stats by name. Use EOS_Stats_Stat_Release when finished with the data.- Parameters:
options- Structure containing the Product User ID and name being accessed- Returns:
- The stat data for the given name, if it exists and is valid
- Throws:
EOSInvalidParametersException- if you pass a null pointer for the out parameterEOSNotFoundException- if the stat is not foundEOSException- See Also:
-