Gerenciamento de usuários

Learn about advanced setups from our how-tos.

Como trabalhar com atributos de usuário

You can use attributes to manage additional information about the users of your application. The user attribute is a key-value pair. The SDK supports the following types of attributes:

  • User-editable attributes. The values for this type of attributes are entered by a user or specified according to the in-game logics on the client side. For example: the name and character stats, game difficulty level, etc.
  • Read-only attributes. The values for this type of attributes are entered and edited on the server side of your application. We recommend you use them for configuration of game character stats or user parameters that shouldn’t be changed a lot. For example: use them for the chance to get a bonus, game character key parameters, user categories, etc.

To manage user attributes, use the following SDK methods:

  • UpdateUserAttributes — updates locally cached list of user-editable attributes.
  • UpdateUserReadOnlyAttributes — updates locally cached list of read-only attributes.
  • ModifyUserAttributes — creates or edits a list of user attributes, changes are made on the server side.
  • RemoveUserAttributes — removes user attributes with the specified IDs, changes are made on the server side.

When working with read-only attributes, you can use a server token or a Publisher Account token for authorization.

To get the Publisher Account token:

  1. Enter your Publisher Account.
  2. Go to the cookie files viewpage via the developers’ tools in your browser.
  3. Copy the value from the pa-v4-token parameter and paste it to the Authorization header.

Este artigo foi útil?
Obrigado!
Podemos melhorar alguma coisa? Mensagem
Que pena ouvir isso
Explique porque este artigo não foi útil para você. Mensagem
Obrigado pelo seu feedback!
Avaliaremos sua mensagem e a usaremos para melhorar sua experiência.
Ocultar

Como trabalhar com conta de usuário em seu aplicativo

Users can configure the following data from a user account:

  • public profile data:
    • avatar
    • nickname

  • personal user data:
    • name and surname
    • birthdate
    • gender
    • phone number
    • email
Observação
To set some additional user parameters or set the parameters of a game character, use the instruction on how to work with user attributes. You can add the friend list management functionality in the user account if the friend system is implemented in the application.

You can manage the user account via the API calls. The Login & Account System plug-in has the following methods implemented:

  • UpdateUserDetails — updates locally cached user data.

Observação
The user can set their birthdate only once. The entered value can’t be changed in the future.
  • ModifyUserDetails — changes the specified user data.
  • UpdateUserEmail — updates the locally cached user email.
  • UpdateUserPhoneNumber — updates the locally cached user phone number.
  • ModifyUserPhoneNumber — changes the user’s phone number.
  • RemoveUserPhoneNumber — deletes the user’s phone number.
  • ModifyUserProfilePicture — changes the user’s avatar.
  • RemoveProfilePicture — deletes the user’s avatar.
Este artigo foi útil?
Obrigado!
Podemos melhorar alguma coisa? Mensagem
Que pena ouvir isso
Explique porque este artigo não foi útil para você. Mensagem
Obrigado pelo seu feedback!
Avaliaremos sua mensagem e a usaremos para melhorar sua experiência.
Ocultar

Como trabalhar com um sistema amigo em seu aplicativo

The friend system allows your users to find each other and set up social connections. The SDK supports the following functionality:

  • search by nickname
  • get the list of friends from social networks
  • manage the friend list, send invitations, add and remove friends, block users, etc.
  • manage personal data via the user account

To implement the friend system, you should have the user account functionality in your application. Methods of working with this system use the following parameters from the user account:

  • user ID
  • avatar
  • nickname

Users should specify the nickname to ensure the friend system works correctly. Implement the following nickname specification logics:

  • Use the name that was used for registration via login and password as a nickname.
  • Implement the nickname request during social authentication or platform accounts.

Métodos SDK

The Login & Account System plug-in has the following methods of working with the friend system:

  • UpdateFriends — updates the locally cached user friends data.

  • ModifyFriends — updates the status of the user’s social connections. The social connections status is affected by the following actions:
    • send or cancel a friend request
    • accept or decline a friend request
    • delete the user from the friend list
    • block or unblock the user
  • UpdateSocialFriends — updates the locally cached data of user’s friends from a social network.
  • GetUserProfile — gets data from the user’s public profile.
  • SearchUsersByNickname — searches for the user by nickname.
  • LinkSocialNetworkToUserAccount — links the user account and a social network that the player uses for authentication.
  • UpdateLinkedSocialNetworks — updates the user’s social networks data.

Implementando um sistema de amigos para redes sociais

To let users interact with friends from social networks in your application, configure the storage of friend data on the Xsolla side:

  1. Go to your Publisher Account.
  2. Click Open in the Login block and go to Login projects.
  3. Click Open and set up in the Login project block.
  4. Go to General settings > Authentication.
  5. Set the Store friends from social networks toggle to On.
  6. Save changes.

To make friends from the social network available to the player in the application, implement the following logic in your application:

  1. Link a social network to a player’s account using the LinkSocialNetworkToUserAccount method.
  2. Update your friends list using the UpdateUsersFriends method.
  3. Get a list of friends from a linked social network using the UpdateSocialFriends method.

Este artigo foi útil?
Obrigado!
Podemos melhorar alguma coisa? Mensagem
Que pena ouvir isso
Explique porque este artigo não foi útil para você. Mensagem
Obrigado pelo seu feedback!
Avaliaremos sua mensagem e a usaremos para melhorar sua experiência.
Ocultar
Última atualização: 10 de Outubro de 2023

Encontrou um erro de texto ou digitação? Selecione o texto e pressione Ctrl+Enter.

Relatar um problema
Nós sempre avaliamos nossos conteúdos. Seu feedback nos ajuda a melhorá-los.
Forneça um e-mail para que possamos responder
Obrigado pelo seu feedback!