Personas

Personas#

The concept of a persona is a part of the Social suite of functionality implemented by AXR. It defines a user’s personal data and profile, for the more social aspects of game interaction.

For the purposes of “Chess”, it acts as a means storing and retrieving user data for leaderboards.

To utilize a persona, first a persona must be created. To that end a reference to the PersonaService is used:

PersonaService personaService = _serviceFactory.GetService<PersonaService>();

Once that is established the persona object can be populated in a similar manner to a Ticket or Session object. In “Chess” this is done in the AXRLogin function:

1persona = new Persona()
2{
3   Name = _user.Name,
4   Description = "Chess Player",
5   UserUid = _user.Uid,
6};

Like a Ticket or Session a call to the PersonaService creates a copy of the persona on the server:

persona = await personaService.Create(persona);

Lastly in “Chess” the persona Uid is stored for use in Leaderboards:

1_personaId = persona.Uid.ToString();
2PlayerPrefs.SetString(PERSONA_ID, _personaId);