social / pragma.account / AccountService /

AccountService #

class AccountService(pragmaNode: PragmaNode, instanceId: UUID, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, playerGroupProxy: PlayerGroupProxy = PlayerGroupProxy(), accountTagProxy: AccountTagProxy = AccountTagProxyImpl(), accountRegistrar: AccountRegistrar = AccountRegistrar(), gameShards: GameShards = GameShards(), limitedAccessEventScheduler: LimitedAccessEventScheduler = LimitedAccessEventSchedulerImpl(), limitedAccessEvents: LimitedAccessEvents = LimitedAccessEvents()) : DistributedService, ConfigHandler<AccountServiceConfig>

AccountService is responsible for account creation and authentication and managing account data and account groupings.

References

Constructors #

AccountService

internal fun AccountService(pragmaNode: PragmaNode, instanceId: UUID, routingUtils: RoutingUtils = RoutingUtils.defaultInstance, playerGroupProxy: PlayerGroupProxy = PlayerGroupProxy(), accountTagProxy: AccountTagProxy = AccountTagProxyImpl(), accountRegistrar: AccountRegistrar = AccountRegistrar(), gameShards: GameShards = GameShards(), limitedAccessEventScheduler: LimitedAccessEventScheduler = LimitedAccessEventSchedulerImpl(), limitedAccessEvents: LimitedAccessEvents = LimitedAccessEvents())

Functions #

NameSummary

addAccountsToPlayerGroupOperatorV1

suspend fun addAccountsToPlayerGroupOperatorV1(operatorSession: OperatorSession, request: AccountRpc.AddAccountsToPlayerGroupOperatorV1Request): AccountRpc.AddAccountsToPlayerGroupOperatorV1Response

Adds a list of Pragma Accounts by Pragma Social Ids to a PlayerGroup.

addAccountTagsOperatorV1

suspend fun addAccountTagsOperatorV1(operatorSession: OperatorSession, request: AccountRpc.AddAccountTagsOperatorV1Request): AccountRpc.AddAccountTagsOperatorV1Response

Adds AccountTags for a list of users by Pragma Social Ids.

addAccountTagsPartnerV1

suspend fun addAccountTagsPartnerV1(partnerSession: PartnerSession, request: AccountRpc.AddAccountTagsPartnerV1Request): AccountRpc.AddAccountTagsPartnerV1Response

Adds AccountTags for a list of users by Pragma Social Ids.

addAccountTagsServiceV1

suspend fun addAccountTagsServiceV1(serviceSession: ServiceSession, request: AccountRpc.AddAccountTagsServiceV1Request): AccountRpc.AddAccountTagsServiceV1Response

Adds AccountTags for a list of users by Pragma Social Ids.

addAccountToPlayerGroupOperatorV1

suspend fun addAccountToPlayerGroupOperatorV1(operatorSession: OperatorSession, request: AccountRpc.AddAccountToPlayerGroupOperatorV1Request): AccountRpc.AddAccountToPlayerGroupOperatorV1Response

Adds a single Pragma Account by Pragma Social Id to a PlayerGroup.

authenticateOrCreateV2

suspend fun authenticateOrCreateV2(session: ServiceSession, request: AccountRpc.AuthenticateOrCreateV2Request): AccountRpc.AuthenticateOrCreateV2Response

Authenticates a user against an IdentityProvider, creates a Pragma Account (if it does not exist), and returns SessionTokens used for gateway authentication.

bulkActionOperatorV1

suspend fun bulkActionOperatorV1(operatorSession: OperatorSession, request: AccountRpc.BulkActionOperatorV1Request): AccountRpc.BulkActionOperatorV1Response

Filters players based on the PlayerSearchFilter and executes an action based on the BulkActionDelegator.

createAccountWithUnsafeProviderV2

suspend fun createAccountWithUnsafeProviderV2(operatorSession: OperatorSession, request: AccountRpc.CreateAccountWithUnsafeProviderV2Request): AccountRpc.CreateAccountWithUnsafeProviderV2Response

Updates the UnsafeIdentityDaoNodeService with accounts that can be used for authentication. It optionally can also authenticate those accounts.

createPartnerTokenV1

suspend fun createPartnerTokenV1(session: OperatorSession, request: AccountRpc.CreatePartnerTokenV1Request): AccountRpc.CreatePartnerTokenV1Response

Creates tokens used by third party services for authentication.

createPlayerGroupOperatorV1

suspend fun createPlayerGroupOperatorV1(operatorSession: OperatorSession, request: AccountRpc.CreatePlayerGroupOperatorV1Request): AccountRpc.CreatePlayerGroupOperatorV1Response

Creates a new PlayerGroup.

discordRedirectV1

suspend fun discordRedirectV1(serviceSession: ServiceSession, request: AccountRpc.DiscordRedirectV1Request): AccountRpc.DiscordRedirectV1Response

Gets the Discord access token using Discord OAuth2.

editPlayerGroupOperatorV1

suspend fun editPlayerGroupOperatorV1(operatorSession: OperatorSession, request: AccountRpc.EditPlayerGroupOperatorV1Request): AccountRpc.EditPlayerGroupOperatorV1Response

Edits the name and description and returns a PlayerGroup.

getAccountSuspensionHistoryOperatorV1

suspend fun getAccountSuspensionHistoryOperatorV1(operatorSession: OperatorSession, request: AccountRpc.GetAccountSuspensionHistoryOperatorV1Request): AccountRpc.GetAccountSuspensionHistoryOperatorV1Response

Gets all AccountSuspensionHistoryEntrys of a given Account.

getAccountSuspensionStatusOperatorV1

suspend fun getAccountSuspensionStatusOperatorV1(operatorSession: OperatorSession, request: AccountRpc.GetAccountSuspensionStatusOperatorV1Request): AccountRpc.GetAccountSuspensionStatusOperatorV1Response

Gets the current suspension status of a given Account.

getAccountTagsPartnerV1

suspend fun getAccountTagsPartnerV1(partnerSession: PartnerSession, request: AccountRpc.GetAccountTagsPartnerV1Request): AccountRpc.GetAccountTagsPartnerV1Response

Gets all the AccountTags for a list of users by Pragma Social Ids.

getAccountTagsServiceV1

suspend fun getAccountTagsServiceV1(serviceSession: ServiceSession, request: AccountRpc.GetAccountTagsServiceV1Request): AccountRpc.GetAccountTagsServiceV1Response

Gets all the AccountTags for a list of users by Pragma Social Ids.

getDisplayNameForPlayerIdPartnerV2

suspend fun getDisplayNameForPlayerIdPartnerV2(session: PartnerSession, request: AccountRpc.GetDisplayNameForPlayerIdPartnerV2Request): AccountRpc.GetDisplayNameForPlayerIdPartnerV2Response

Returns the Pragma Full Display Name by a given Pragma Player Id.

getDisplayNameForPragmaPlayerIdV1

suspend fun getDisplayNameForPragmaPlayerIdV1(session: PlayerSession, request: AccountRpc.GetDisplayNameForPragmaPlayerIdV1Request): AccountRpc.GetDisplayNameForPragmaPlayerIdV1Response

Returns the Pragma Full Display Name by a given Pragma Player Id.

getPlayerCountBySearchFilterOperatorV1

suspend fun getPlayerCountBySearchFilterOperatorV1(operatorSession: OperatorSession, request: AccountRpc.GetPlayerCountBySearchFilterOperatorV1Request): AccountRpc.GetPlayerCountBySearchFilterOperatorV1Response

Searches for accounts that match the PlayerSearchFilter and returns the number of matches.

getPragmaAccountOverviewsOperatorV1

suspend fun getPragmaAccountOverviewsOperatorV1(operatorSession: OperatorSession, request: AccountRpc.GetPragmaAccountOverviewsOperatorV1Request): AccountRpc.GetPragmaAccountOverviewsOperatorV1Response

Filters players based on the PlayerSearchFilter and returns a list of PragmaAccountOverviews of matched players.

getPragmaAccountOverviewsPartnerV1

suspend fun getPragmaAccountOverviewsPartnerV1(partnerSession: PartnerSession, request: AccountRpc.GetPragmaAccountOverviewsPartnerV1Request): AccountRpc.GetPragmaAccountOverviewsPartnerV1Response

Filters players based on the PlayerSearchFilter and returns a list of PragmaAccountOverviews of matched players.

getPragmaPlayerIdForDisplayNameV1

suspend fun getPragmaPlayerIdForDisplayNameV1(session: PlayerSession, request: AccountRpc.GetPragmaPlayerIdForDisplayNameV1Request): AccountRpc.GetPragmaPlayerIdForDisplayNameV1Response

Returns the Pragma Player Id by a given Pragma Full Display Name.

getPragmaPlayerIdsForProviderIdsV2

suspend fun getPragmaPlayerIdsForProviderIdsV2(playerSession: PlayerSession, request: AccountRpc.GetPragmaPlayerIdsForProviderIdsV2Request): AccountRpc.GetPragmaPlayerIdsForProviderIdsV2Response

Searches all the PlayerIdentities scoped to Identity Provider accounts for a given game shard.

getPragmaPlayerOverviewsOperatorV1

suspend fun getPragmaPlayerOverviewsOperatorV1(operatorSession: OperatorSession, request: AccountRpc.GetPragmaPlayerOverviewsOperatorV1Request): AccountRpc.GetPragmaPlayerOverviewsOperatorV1Response

Filters players based on the PlayerSearchFilter and returns a list of PragmaPlayerOverviews of matched players.

linkIdentityProviderAccountPartnerV1

suspend fun linkIdentityProviderAccountPartnerV1(partnerSession: PartnerSession, request: AccountRpc.LinkIdentityProviderAccountPartnerV1Request): AccountRpc.LinkIdentityProviderAccountPartnerV1Response

Associates a new Identity Provider with an existing Pragma account while returning valid authentication tokens.

linkIdentityProviderAccountServiceV1

suspend fun linkIdentityProviderAccountServiceV1(serviceSession: ServiceSession, request: AccountRpc.LinkIdentityProviderAccountServiceV1Request): AccountRpc.LinkIdentityProviderAccountServiceV1Response

Associates a new Identity Provider with an existing Pragma account while returning valid authentication tokens.

linkIdentityProviderAccountV2

suspend fun linkIdentityProviderAccountV2(session: PlayerSession, request: AccountRpc.LinkIdentityProviderAccountV2Request): AccountRpc.LinkIdentityProviderAccountV2Response

Associates a new Identity Provider with an existing Pragma account.

loadTestBulkCreateAccountsOperatorV1

suspend fun loadTestBulkCreateAccountsOperatorV1(operatorSession: OperatorSession, request: AccountRpc.LoadTestBulkCreateAccountsOperatorV1Request): AccountRpc.LoadTestBulkCreateAccountsOperatorV1Response

Creates multiple Players, AccountTags, and PlayerGroups. Used for testing and load testing.

playstationRedirectV1

suspend fun playstationRedirectV1(serviceSession: ServiceSession, request: AccountRpc.PlaystationRedirectV1Request): AccountRpc.PlaystationRedirectV1Response

Gets the Playstation access token using Playstation OAuth2.

refreshTokensV1

suspend fun refreshTokensV1(session: PlayerSession, request: AccountRpc.RefreshTokensV1Request): AccountRpc.RefreshTokensV1Response

Refreshes authentication tokens by accepting older but not expired tokens, checking whether the user still has authentication privileges, and issuing new tokens.

removeAccountFromPlayerGroupOperatorV1

suspend fun removeAccountFromPlayerGroupOperatorV1(operatorSession: OperatorSession, request: AccountRpc.RemoveAccountFromPlayerGroupOperatorV1Request): AccountRpc.RemoveAccountFromPlayerGroupOperatorV1Response

Remove a single Pragma Account by Pragma Social Id from a PlayerGroup.

removeAccountTagsOperatorV1

suspend fun removeAccountTagsOperatorV1(operatorSession: OperatorSession, request: AccountRpc.RemoveAccountTagsOperatorV1Request): AccountRpc.RemoveAccountTagsOperatorV1Response

Removes AccountTags for a list of users by Pragma Social Ids.

removeAccountTagsPartnerV1

suspend fun removeAccountTagsPartnerV1(partnerSession: PartnerSession, request: AccountRpc.RemoveAccountTagsPartnerV1Request): AccountRpc.RemoveAccountTagsPartnerV1Response

Removes AccountTags for a list of users by Pragma Social Ids.

removeAccountTagsServiceV1

suspend fun removeAccountTagsServiceV1(serviceSession: ServiceSession, request: AccountRpc.RemoveAccountTagsServiceV1Request): AccountRpc.RemoveAccountTagsServiceV1Response

Removes AccountTags for a list of users by Pragma Social Ids.

removePlayerGroupOperatorV1

suspend fun removePlayerGroupOperatorV1(operatorSession: OperatorSession, request: AccountRpc.RemovePlayerGroupOperatorV1Request): AccountRpc.RemovePlayerGroupOperatorV1Response

Removes a PlayerGroup and any account to PlayerGroup associations.

suspendAccountOperatorV1

suspend fun suspendAccountOperatorV1(operatorSession: OperatorSession, request: AccountRpc.SuspendAccountOperatorV1Request): AccountRpc.SuspendAccountOperatorV1Response

Adds a suspend type AccountSuspensionHistoryEntry for a given Account.

twitchRedirectV1

suspend fun twitchRedirectV1(serviceSession: ServiceSession, request: AccountRpc.TwitchRedirectV1Request): AccountRpc.TwitchRedirectV1Response

Gets the Twitch access token using Twitch OAuth2.

unsuspendAccountOperatorV1

suspend fun unsuspendAccountOperatorV1(operatorSession: OperatorSession, request: AccountRpc.UnsuspendAccountOperatorV1Request): AccountRpc.UnsuspendAccountOperatorV1Response

Adds an unsuspend type AccountSuspensionHistoryEntry for a given Account.

updateAccountSuspensionHistoryOperatorV1

suspend fun updateAccountSuspensionHistoryOperatorV1(operatorSession: OperatorSession, request: AccountRpc.UpdateAccountSuspensionHistoryOperatorV1Request): AccountRpc.UpdateAccountSuspensionHistoryOperatorV1Response

Updates a specified AccountSuspensionHistoryEntry.

updateDisplayNameOperatorV1

suspend fun updateDisplayNameOperatorV1(operatorSession: OperatorSession, request: AccountRpc.UpdateDisplayNameOperatorV1Request): AccountRpc.UpdateDisplayNameOperatorV1Response

Updates the display name of an account by a Pragma Social Id.

updateDisplayNameServiceV1

suspend fun updateDisplayNameServiceV1(serviceSession: ServiceSession, request: AccountRpc.UpdateDisplayNameServiceV1Request): AccountRpc.UpdateDisplayNameServiceV1Response

Updates the display name of an account by a Pragma Social Id.

updateEmailV1

@ExperimentalCoroutinesApi

suspend fun updateEmailV1(playerSession: PlayerSession, request: AccountRpc.UpdateEmailV1Request): AccountRpc.UpdateEmailV1Response

Adds or updates a user’s email. If the user already has no email or an unverified email, it will add or update the unverified email. If the user has a verified email, the verified email will not be overwritten until the user has verified the new email using AccountService.verifyEmailV1.

verifyEmailV1

suspend fun verifyEmailV1(serviceSession: ServiceSession, request: AccountRpc.VerifyEmailV1Request): AccountRpc.VerifyEmailV1Response

Verifies an email token and updates the users verified email. If the user had a preexisting, verified email, the old verified email will be deleted in favor the email in the email token.

viewActiveIdProvidersOperatorV1

suspend fun viewActiveIdProvidersOperatorV1(operatorSession: OperatorSession, request: AccountRpc.ViewActiveIdProvidersOperatorV1Request): AccountRpc.ViewActiveIdProvidersOperatorV1Response

Gets all the active IdentityProviders.

viewPlayerGroupOperatorV1

suspend fun viewPlayerGroupOperatorV1(operatorSession: OperatorSession, request: AccountRpc.ViewPlayerGroupOperatorV1Request): AccountRpc.ViewPlayerGroupOperatorV1Response

Gets the PlayerGroup and a list of PragmaAccountOverviews limited to a page index and size.

viewPlayerGroupsBySocialIdOperatorV1

suspend fun viewPlayerGroupsBySocialIdOperatorV1(operatorSession: OperatorSession, request: AccountRpc.ViewPlayerGroupsBySocialIdOperatorV1Request): AccountRpc.ViewPlayerGroupsBySocialIdOperatorV1Response

Gets the PlayerGroups of a given Player.

viewPlayerGroupsOperatorV1

suspend fun viewPlayerGroupsOperatorV1(operatorSession: OperatorSession, request: AccountRpc.ViewPlayerGroupsOperatorV1Request): AccountRpc.ViewPlayerGroupsOperatorV1Response

Gets all the PlayerGroups.

viewSocialIdentitiesV1

suspend fun viewSocialIdentitiesV1(operatorSession: OperatorSession, request: AccountRpc.ViewSocialIdentitiesV1Request): AccountRpc.ViewSocialIdentitiesV1Response

Returns a sublist of SocialIdentity.

viewSocialIdentityPartnerV2

suspend fun viewSocialIdentityPartnerV2(partnerSession: PartnerSession, request: AccountRpc.ViewSocialIdentityPartnerV2Request): AccountRpc.ViewSocialIdentityPartnerV2Response

Returns a SocialIdentityWithPersonal for a given Pragma Social Id.

viewSocialIdentityServiceV1

suspend fun viewSocialIdentityServiceV1(serviceSession: ServiceSession, request: AccountRpc.ViewSocialIdentityServiceV1Request): AccountRpc.ViewSocialIdentityServiceV1Response

Returns a SocialIdentity for a given Pragma Social Id.

viewSocialIdentityV1

suspend fun viewSocialIdentityV1(operatorSession: OperatorSession, request: AccountRpc.ViewSocialIdentityV1Request): AccountRpc.ViewSocialIdentityV1Response

Returns a SocialIdentity for a given Pragma Social Id.

viewTagsOperatorV1

suspend fun viewTagsOperatorV1(operatorSession: OperatorSession, request: AccountRpc.ViewTagsOperatorV1Request): AccountRpc.ViewTagsOperatorV1Response

Gets all the AccountTags

viewTagsPartnerV1

suspend fun viewTagsPartnerV1(partnerSession: PartnerSession, request: AccountRpc.ViewTagsPartnerV1Request): AccountRpc.ViewTagsPartnerV1Response

Gets all the AccountTags