Retaining Player Details

Introduction

Once you match players together you will have reference to other player's Ids and account variables to use in Cloud code. One of the things you can do is easy access of player data. This will enable you to load player specific options, settings and personal data the moment the match is made.

Accessing Player Data

To access player data from a list of opponents in a match:

    {
     "@class": ".MatchDetailsResponse",
     "matchId": "565dc32ce4b0905d7600a5a0",
     "opponents": [
      {
       "achievements": [
        "Cloud_Achievement",
        "Fastest_First"
       ],
       "online": true,
       "id": "563b423ce4b0f85acff00a61",
       "displayName": "Dummy2"
      },
      {
       "achievements": [
        "Cloud_Achievement"
       ],
       "online": false,
       "id": "563b4243e4b0f85acff00a69",
       "displayName": "Dummy3"
      },
      {
       "achievements": [
        "Cloud_Achievement"
       ],
       "online": false,
       "id": "563b4249e4b0f85acff00a71",
       "displayName": "Dummy4"
      }
     ],
     "playerId": "563b4235e4b0f85acff00a22",
     "scriptData": null
    }
Did this page help you? Please enter your feedback below. For questions about using this part of the platform, please contact support here