Friend Backend Reference #

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

Data classes #

Friend class #

propertydescription
socialIdUnique social identifier for the player (game agnostic)
displayNamePragmaDisplayName object containing the player’s name and discriminator
playerIdA user’s identifier within a specific game
playerIdByGameShardMap of player’s playerIds by game shard
presencePresence for the player in a specific game
presencesByGameShardPresences for the player across games
providerAccountsByProviderIdUser’s IdProviderAccounts, which contain account information from identity providers. For specifics on the IdProviderAccount data class, see the Account Plugin topic.

Friend Overview class #

An overview of the Friend without sensitive information.

propertydescription
socialIdUnique social identifier for the player (game agnostic)
displayNamePragmaDisplayName object containing the player’s name and discriminator
playerIdA user’s identifier within a specific game
playerIdByGameShardMap of player’s playerIds by game shard

Configuration #

FriendsServiceConfig #

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

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.

The following configuration values are related to Friends features:

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 oldest pending sent invite in their list will be deleted. A “sent invite removed” event is triggered for the inviter, and a “received invite removed” event is triggered for the invitee.

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 INVITEE_RECEIVED_INVITES_FULL error.

Default: 20

See Presence Reference for information on other configuration values.

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

Errors #

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