Package host.anzo.eossdk.eos.sdk
Class EOS_Presence_Interface
java.lang.Object
com.sun.jna.PointerType
host.anzo.eossdk.eos.sdk.EOS_Presence_Interface
- All Implemented Interfaces:
com.sun.jna.NativeMapped
public class EOS_Presence_Interface
extends com.sun.jna.PointerType
The Presence methods enable you to query and read other player's presence information, or modify your own.
QueryPresence must be called once per login, per remote user, before data will be available. It is currently only possible to query presence for users that are on your friends list, all other queries will return no results.
- Since:
- 8/22/2023
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNotifyJoinGameAccepted(EOS_Presence_AddNotifyJoinGameAcceptedOptions options, com.sun.jna.Pointer clientData, EOS_Presence_OnJoinGameAcceptedCallback notificationFn) Register to receive notifications when a user accepts a join game option via the social overlay.
Must callremoveNotifyJoinGameAccepted(EOS_NotificationId)to remove the notificationaddNotifyOnPresenceChanged(EOS_Presence_AddNotifyOnPresenceChangedOptions options, com.sun.jna.Pointer clientData, EOS_Presence_OnPresenceChangedCallback notificationHandler) Register to receive notifications when presence changes.Get a user's cached presence object.createPresenceModification(EOS_Presence_CreatePresenceModificationOptions options, EOS_PresenceModification outPresenceModificationHandle) Creates a presence modification handle.Gets a join info custom game-data string for a specific user.booleanCheck if we already have presence for a uservoidqueryPresence(EOS_Presence_QueryPresenceOptions options, com.sun.jna.Pointer clientData, EOS_Presence_OnQueryPresenceCompleteCallback completionDelegate) Query a user's presence.voidUnregister from receiving notifications when a user accepts a join game option via the social overlay.voidremoveNotifyOnPresenceChanged(EOS_NotificationId notificationId) Unregister a previously bound notification handler from receiving presence update notificationsvoidsetPresence(EOS_Presence_SetPresenceOptions options, com.sun.jna.Pointer clientData, EOS_Presence_SetPresenceCompleteCallback completionDelegate) Sets your new presence with the data applied to a PresenceModificationHandle.Methods inherited from class com.sun.jna.PointerType
equals, fromNative, getPointer, hashCode, nativeType, setPointer, toNative, toString
-
Constructor Details
-
EOS_Presence_Interface
public EOS_Presence_Interface(com.sun.jna.Pointer address) -
EOS_Presence_Interface
public EOS_Presence_Interface()
-
-
Method Details
-
queryPresence
public void queryPresence(EOS_Presence_QueryPresenceOptions options, com.sun.jna.Pointer clientData, EOS_Presence_OnQueryPresenceCompleteCallback completionDelegate) Query a user's presence. This must complete successfully before CopyPresence will have valid results. If HasPresence returns true for a remote user, this does not need to be called.- Parameters:
options- Object containing properties related to who is querying presence and for what userclientData- Optional pointer to help track this request, that is returned in the completion callbackcompletionDelegate- Pointer to a function that handles receiving the completion information
-
hasPresence
Check if we already have presence for a user- Parameters:
options- Object containing properties related to who is requesting presence and for what user- Returns:
- EOS_TRUE if we have presence for the requested user, or EOS_FALSE if the request was invalid or we do not have cached data
-
copyPresence
Get a user's cached presence object. If successful, this data must be released by calling EOS_Presence_Info_Release- Parameters:
options- Object containing properties related to who is requesting presence and for what user- Returns:
- A pointer to a pointer of Presence Info. If the returned result is success, this will be set to data that must be later released, otherwise this will be set to NULL
- Throws:
EOSException- See Also:
-
createPresenceModification
public EOS_EResult createPresenceModification(EOS_Presence_CreatePresenceModificationOptions options, EOS_PresenceModification outPresenceModificationHandle) Creates a presence modification handle. This handle can used to add multiple changes to your presence that can be applied with EOS_Presence_SetPresence. The resulting handle must be released by calling EOS_PresenceModification_Release once it has been passed to EOS_Presence_SetPresence.- Parameters:
options- Object containing properties related to the user modifying their presenceoutPresenceModificationHandle- Pointer to a Presence Modification Handle to be set if successful- Returns:
EOS_EResult.EOS_Successif we successfully created the Presence Modification Handle pointed at in OutPresenceModificationHandle, or an error result if the input data was invalid- See Also:
-
EOS_PresenceModification.release()setPresence(EOS_Presence_SetPresenceOptions, Pointer, EOS_Presence_SetPresenceCompleteCallback)EOS_PresenceModification.setStatus(EOS_PresenceModification_SetStatusOptions)EOS_PresenceModification.setRawRichText(EOS_PresenceModification_SetRawRichTextOptions)EOS_PresenceModification.setData(EOS_PresenceModification_SetDataOptions)EOS_PresenceModification.deleteData(EOS_PresenceModification_DeleteDataOptions)
-
setPresence
public void setPresence(EOS_Presence_SetPresenceOptions options, com.sun.jna.Pointer clientData, EOS_Presence_SetPresenceCompleteCallback completionDelegate) Sets your new presence with the data applied to a PresenceModificationHandle. The PresenceModificationHandle can be released safely after calling this function.- Parameters:
options- Object containing a PresenceModificationHandle and associated user dataclientData- Optional pointer to help track this request, that is returned in the completion callbackcompletionDelegate- Pointer to a function that handles receiving the completion information- See Also:
-
addNotifyOnPresenceChanged
public EOS_NotificationId addNotifyOnPresenceChanged(EOS_Presence_AddNotifyOnPresenceChangedOptions options, com.sun.jna.Pointer clientData, EOS_Presence_OnPresenceChangedCallback notificationHandler) Register to receive notifications when presence changes. If the returned NotificationId is valid, you must call RemoveNotifyOnPresenceChanged when you no longer wish to have your NotificationHandler called- Parameters:
clientData- Data the is returned to when NotificationHandler is invokednotificationHandler- The callback to be fired when a presence change occurs- Returns:
- Notification ID representing the registered callback if successful, an invalid NotificationId if not
- See Also:
-
removeNotifyOnPresenceChanged
Unregister a previously bound notification handler from receiving presence update notifications- Parameters:
notificationId- The Notification ID representing the registered callback
-
addNotifyJoinGameAccepted
public EOS_NotificationId addNotifyJoinGameAccepted(EOS_Presence_AddNotifyJoinGameAcceptedOptions options, com.sun.jna.Pointer clientData, EOS_Presence_OnJoinGameAcceptedCallback notificationFn) Register to receive notifications when a user accepts a join game option via the social overlay.
Must callremoveNotifyJoinGameAccepted(EOS_NotificationId)to remove the notification- Parameters:
options- Structure containing information about the request.clientData- Arbitrary data that is passed back to you in the CompletionDelegate.notificationFn- A callback that is fired when a notification is received.- Returns:
- handle representing the registered callback
-
removeNotifyJoinGameAccepted
Unregister from receiving notifications when a user accepts a join game option via the social overlay.- Parameters:
inId- Handle representing the registered callback
-
getJoinInfo
Gets a join info custom game-data string for a specific user. This is a helper function for reading the presence data related to how a user can be joined. Its meaning is entirely application dependent.This value will be valid only after a QueryPresence call has successfully completed.
- Parameters:
options- Object containing an associated user- Returns:
- join info custom game-data string for a specific user
- Throws:
EOSInvalidParametersException- if you pass a null pointer for the out parameterEOSNotFoundException- if there is user or the location string was not foundEOSLimitExceededException- The OutBuffer is not large enough to receive the location string. InOutBufferLength contains the required minimum length to perform the operation successfullyEOSException- See Also:
-