get custom entities associated to a player at login.
-
Hi,
a player custom entity is not returned event when
"Return User Entities during Authenticate and ReadPlayerState methods" is enabled in app settingsthe methods ReadEntity in custom entity api require and entityId.
how do we read a player custom data (custom entities) ? at login for example ?
thank -
ok, when defining a custon entity you create a field owner , that you set as an index later in the dasboard.
{ "owner": "", "id": "", "code": "", "gunType": "basic", "ammo": 10, "lifes": 3 }
when creating a custon entity , you set the field owner with th current player profileId
then you can retrieve it with a call to GetEntityPage{ "entityType": "playerData", "context": { "pagination": { "rowsPerPage": 50, "pageNumber": 1 }, "searchCriteria": { "data.owner": "[current player profileId]" }, "sortCriteria": { "createdAt": 1 } } }
-
Edit . you can get all custom entities for the current user with the query
{ "entityType": "[entitytype]", "ownerId": "[profileId]", "context": { "pagination": { "rowsPerPage": 50, "pageNumber": 1 }, "searchCriteria": { // other search criteria here }, "sortCriteria": { "createdAt": 1 } } }