social / pragma.friend / FriendService /

FriendService #

class FriendService(pragmaNode: PragmaNode, instanceId: UUID, identityCache: IdentityCache = IdentityCache(), friendManager: FriendManager = FriendManager(), friendCache: FriendCache = FriendCache(), friendClient: FriendClient = FriendClient(), friendSectionsBuilder: FriendSectionsBuilder = FriendSectionsBuilder(), presenceCache: PresenceCache = PresenceCache()) : DistributedService, ConfigHandler<FriendServiceConfig>

FriendService allows players to manage their friends.

Friends are bidirectional, if Player A is Player B’s friend, then Player B is Player A’s friend.

This service can be used to view, update and remove friend lists, send friend invitations, and receive friend invitations.

Constructors #

FriendService

internal fun FriendService(pragmaNode: PragmaNode, instanceId: UUID, identityCache: IdentityCache = IdentityCache(), friendManager: FriendManager = FriendManager(), friendCache: FriendCache = FriendCache(), friendClient: FriendClient = FriendClient(), friendSectionsBuilder: FriendSectionsBuilder = FriendSectionsBuilder(), presenceCache: PresenceCache = PresenceCache())

Functions #

NameSummary

blockV1

suspend fun blockV1(session: PlayerSession, request: FriendRpc.BlockV1Request): FriendRpc.BlockV1Response

Prevents a player from receiving invites from the blocked player. Friendship status and pending friend invites between the two players will be removed.

deleteFriendDataServiceV1

suspend fun deleteFriendDataServiceV1(session: ServiceSession, request: FriendRpc.DeleteFriendDataServiceV1Request): FriendRpc.DeleteFriendDataServiceV1Response

Service to service call for deleting all friend data for a player. Invoked in DataRights delete flows.

forceSyncPresenceV1

suspend fun forceSyncPresenceV1(session: PlayerSession, request: FriendRpc.ForceSyncPresenceV1Request): FriendRpc.ForceSyncPresenceV1Response

Gets a player’s presences.

friendListUpdateServiceV1

suspend fun friendListUpdateServiceV1(session: ServiceSession, request: FriendRpc.FriendListUpdateServiceV1Request): FriendRpc.FriendListUpdateServiceV1Response

Service to service call for updating the state of a friend list.

getCacheInfoOperatorV1

suspend fun getCacheInfoOperatorV1(session: OperatorSession, request: FriendRpc.GetCacheInfoOperatorV1Request): FriendRpc.GetCacheInfoOperatorV1Response

Queries cached friend data by player id.

getFriendListAndRegisterOnlineV1

suspend fun getFriendListAndRegisterOnlineV1(session: PlayerSession, request: FriendRpc.GetFriendListAndRegisterOnlineV1Request): FriendRpc.GetFriendListAndRegisterOnlineV1Response

Returns a list of friends, sent invites, and received invites for a player.

getPersonalDataSectionsServiceV1

suspend fun getPersonalDataSectionsServiceV1(session: ServiceSession, request: FriendRpc.GetPersonalDataSectionsServiceV1Request): FriendRpc.GetPersonalDataSectionsServiceV1Response

Service to service call to retrieve all friend data records for a player. Invoked in DataRights flows.

getPresencesAndRegisterOnlineServiceV1

suspend fun getPresencesAndRegisterOnlineServiceV1(session: ServiceSession, request: FriendRpc.GetPresencesAndRegisterOnlineServiceV1Request): FriendRpc.GetPresencesAndRegisterOnlineServiceV1Response

Service to service rpc call for fetching a list of presences. Used to populate presences when a user logs in

getPresenceV1

suspend fun getPresenceV1(session: PlayerSession, request: FriendRpc.GetPresenceV1Request): FriendRpc.GetPresenceV1Response

Gets a player’s presences.

integrationTestDeleteFriendDataV1

suspend fun integrationTestDeleteFriendDataV1(session: PlayerSession, request: FriendRpc.IntegrationTestDeleteFriendDataV1Request): FriendRpc.IntegrationTestDeleteFriendDataV1Response

An integration-test RPC Request to delete all friend data for a player.

removeFriendV1

suspend fun removeFriendV1(session: PlayerSession, request: FriendRpc.RemoveFriendV1Request): FriendRpc.RemoveFriendV1Response

Removes a friend from a player’s friend list. Removes the requesting player from the specified player’s friend list.

respondToFriendInviteV1

suspend fun respondToFriendInviteV1(session: PlayerSession, request: FriendRpc.RespondToFriendInviteV1Request): FriendRpc.RespondToFriendInviteV1Response

Responds to a friend invite from the specified player.

sendFriendInviteBySocialIdV1

suspend fun sendFriendInviteBySocialIdV1(session: PlayerSession, request: FriendRpc.SendFriendInviteBySocialIdV1Request): FriendRpc.SendFriendInviteBySocialIdV1Response

Sends a friend invite to the specified player.

sendFriendInviteV1

suspend fun sendFriendInviteV1(session: PlayerSession, request: FriendRpc.SendFriendInviteV1Request): FriendRpc.SendFriendInviteV1Response

Sends a friend invite to the specified player.

setAcceptIncomingFriendInvitesV1

suspend fun setAcceptIncomingFriendInvitesV1(session: PlayerSession, request: FriendRpc.SetAcceptIncomingFriendInvitesV1Request): FriendRpc.SetAcceptIncomingFriendInvitesV1Response

Lets a player change whether they can accept incoming friend invites anymore. If the setting is false, when other players attempt to send a friend request, they will receive a FriendResultStatus.BlockedByInvitee.

setPresencePartnerV1

suspend fun setPresencePartnerV1(session: PartnerSession, request: FriendRpc.SetPresencePartnerV1Request): FriendRpc.SetPresencePartnerV1Response

Sets a player’s presence on a game shard from a plugin, custom service, or game server.

setPresenceV1

suspend fun setPresenceV1(session: PlayerSession, request: FriendRpc.SetPresenceV1Request): FriendRpc.SetPresenceV1Response

Sets a player’s presence on a game shard from a player client.

unblockV1

suspend fun unblockV1(session: PlayerSession, request: FriendRpc.UnblockV1Request): FriendRpc.UnblockV1Response

Prevents a player from receiving invites from the blocked player. Friendship status and pending friend invites between the two players will be removed.