Social Backend Reference #

This section provides references for classes and configuration values defined in the Pragma Engine backend. For specifics on the using the Pragma API for Friend and Presence tasks, see Social API Reference.

Plugins #

The Presence Plugin provides a location for developers to implement custom presence functionality, such as handling the rich presence ext. The Presence Tasks topic shows example usage of the Presence Plugin methods, along with the SDKs that invoke them.

Classes #

classdescription
FriendRepresents a player’s Friend, including social ID, display name, player ID, presences, and provider accounts.
FriendOverviewA limited version of a Friend object, including social ID, display name, and player ID.
PresenceRepresents a player’s basic and rich presences across games
PresenceApi.kt backend classEntrypoint to the Presence service from other backend services or plugins.

Configuration #

FriendServiceConfig #

The FriendsServiceConfig configuration block provides a place to define default values for the Friend and Presence services.

configdescription
maxFriendsListSizeMaximum number of friends an individual player can maintain

Default: 400
maxPendingSentInvitesMaximum number of pending (unresponded to) sent invites an inviter can maintain before oldest pending invites are removed to make room for newer invites. If a player attempts to send a friend invite when their pending sent invite list is full, the inviter will receive a “SentInvitesFull” error.

Default: 20
maxPendingReceivedInvitesMaximum number of pending (unresponded to) received invites a player can maintain before subsequent invites are automatically rejected. If a player attempts to send a friend invite to a player whose received invites list is full, the inviter will receive an Friend_InviteeReceivedInvitesFull error.

Default: 20
enablePresenceUpdatesEnable or disable ability to update presence statuses. If false, a player’s basic and rich presences cannot be updated. The Presence API’s GetPresence method is still available and will return presence values (if any) at the time enablePresenceUpdates was set to false.

Default: true
Note about GDPR compliance: Setting your maxTimeBetweenAccessMillis to a value over 30 days (2592000000 milliseconds) may result in GDPR noncompliance, as user data may exist in the cache until maxTimeBetweenAccessMillis is reached.

friendListCacheConfig #

The friendListCacheConfig configuration block within the FriendsServiceConfig block defines values for caching behavior for the friend service database.

configdescription
maxTimeBetweenAccessMillisIf an entry has not been accessed in this amount of time, it is a candidate for removal in the next eviction sweep. See note above about GDPR compliance.

Default: 72000000
sizeBeforeExpirationEnforcedMaximum size of the friendListCache, after which eviction sweeping will start removing entries

Default: 50000
sweepIntervalMillisInterval, in milliseconds, between sweep calls for the friendListCache

Default: 900000

identityCacheConfig #

The identityCacheConfig configuration block within the FriendsServiceConfig block defines values for caching player identity data retrieved from the account service.

configdescription
maxTimeBetweenAccessMillisIf an entry has not been accessed in this amount of time, it is a candidate for removal in the next eviction sweep. See note above about GDPR compliance.

Default: 1800000
sizeBeforeExpirationEnforcedMaximum size of the identityCache, after which eviction sweeping will start removing entries

Default: 500000
sweepIntervalMillisInterval, in milliseconds, between sweep calls for the identityCache

Default: 90000

Extension data #

The following table lists the ext payloads relevant to presence information.

extdescriptionexample data
ExtRichPresencePlayerRequestCustom presence values set/updated by the player clientcustom away message
ExtRichPresenceBackendRequestCustom presence values set/updated by the game servercurrent score

Errors #

  • FriendService_InternalError
  • Friend_InviteNotFound
  • Friend_FriendNotFound
  • Friend_InviteeAlreadyFriend
  • Friend_FriendListFull
  • Friend_InviteeReceivedInvitesFull
  • Friend_FriendUpdateFailed
  • Friend_BlockedByInvitee
  • Friend_InviteeIsBlocked
  • Friend_InviteeDisabledInvites
  • Friend_SelfOperationNotAllowed
  • Friend_SentInvitesFull
  • Friend_SocialIdentityNotFound
  • Friend_GameIdentityNotFound
  • Presence_GameIdentityNotFound
  • Presence_PresenceNotFound