• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

get custom entities associated to a player at login.

Scheduled Pinned Locked Moved Cloud Code
entitycloud code scriptcustom entities
3 Posts 1 Posters 377 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gibuspi
    wrote on last edited by
    #1

    Hi,
    a player custom entity is not returned event when
    "Return User Entities during Authenticate and ReadPlayerState methods" is enabled in app settings

    the methods ReadEntity in custom entity api require and entityId.

    how do we read a player custom data (custom entities) ? at login for example ?
    thank

    G 1 Reply Last reply
    0
  • G Offline
    G Offline
    gibuspi
    replied to gibuspi on last edited by
    #2

    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
        }
      }
    }
    
    1 Reply Last reply
    0
  • G Offline
    G Offline
    gibuspi
    wrote on last edited by
    #3

    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
        }
      }
    }
    
    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users