question

ALTER Florent avatar image
ALTER Florent asked

PayloadJSON not correctly parsed

Hello !

I'm currently using PlayFab::PlayFabEventsAPI::WriteEvents to batch events. But recently I noticed on the backend that the PayloadJSON field is not correctly parsed.

I'm pretty sure my previous events were correctly converted the PayloadJSON field to a Payload field with the JSON hierarchy correctly parsed in it but I can't verify because these events can't be reached by me anymore ( 7 days limit ).

Here's the JSON sent :

{
    "Events":[
    {
        "Entity":{
            "Id":"B1C7D2C6C551D849",
            "Type":"title_player_account"},
            "EventNamespace":"com.playfab.events.ark.MYNAMESPACE",
            "Name":"START_MAP",
            "OriginalId":null,
            "OriginalTimestamp":"2019-06-19T06:42:22.000Z",
            "Payload":null,
            "PayloadJSON":"{\"correlation\":{\"content_version\":\"258\",\"game_version\":\"1.582.0.2\",\"map_name\":\"A/MAP/NAME\",\"map_session_id\":\"6130fd62a2264ee48b6c8f5f3301729e\",\"platform\":\"win-x64\",\"player_role\":1},\"data\":{\"players\":[{\"is_local_player\":true,\"player_role\":1}],\"powers\":[],\"trinkets\":[],\"weapons\":[{\"name\":\"MY/WEAPON\"}]}}"
    }]
}

And here's the data i've got on the dashboard :

{
  "EntityId": "B1C7D2C6C551D849",
  "EntityLineage": {
  "MasterPlayerAccountId": "DE6FDC2A6441AB2E",
  "NamespaceId": "F2AF3D62F59FC87F",
  "TitleId": "FD7C6",
  "TitlePlayerAccountId": "B1C7D2C6C551D849"
  },
  "EntityType": "title_player_account",
  "EventId": "f8831b7b6e9a48f982cad8de8c3a2c9f",
  "EventName": "START_MAP",
  "EventNamespace": "com.playfab.events.MYNAMESPACE",
  "OriginalTimestamp": "2019-06-19T06:42:22.000Z",
  "PayloadJSON": "{\"correlation\":{\"content_version\":\"258\",\"game_version\":\"1.582.0.2\",\"map_name\":\"A/MAP/NAME\",\"map_session_id\":\"6221aeec10284fc9b2b36237b391c125\",\"platform\":\"win-x64\",\"player_role\":1},\"data\":{\"players\":[{\"is_local_player\":true,\"player_role\":1}],\"powers\":[],\"trinkets\":[],\"weapons\":[{\"name\":\"MY/WEAPON\"}]}}",
  "PlayFabEnvironment": {
  "Application": "mainserver",
  "Cloud": "main",
  "Commit": "053d439",
  "Vertical": "master"
  },
  "SourceType": "API",
  "Timestamp": "2019-06-18T14:26:46.6280856Z"
}

I also try to use the Payload field directly instead of PayloadJSON but I ended to the same result.

The SDK we use is not up to date but the release notes doesn't seem to imply a modification on this feature ( https://api.playfab.com/releaseNotes/#190610 )

Current SDK used : XPlatCppSdk-3.8.190410

Did I miss something ?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image
Sarah Zhang answered

Thanks for your report. We have tested and reproduced it. We will inform product team to investigate it.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mark Bryant avatar image
Mark Bryant answered

Is there an update on this @Sarah Zhang? I'm also seing this behaviour, this C# code:

var writeEventsRequest = new WriteEventsRequest
{
    Events = new List<EventContents>
    {
        new EventContents
        {
            EventNamespace = "com.playfab.events.default",
            Name = "dummy",
            Payload = new
            {
                Alpha = "Beta",
            },
        },
    },
};

await PlayFabEventsAPI.WriteEventsAsync(writeEventsRequest);

Results in this event:

{
  "Timestamp": "2020-05-28T12:36:02.5486569Z",
  "EventNamespace": "com.playfab.events.default",
  "EntityType": "title_player_account",
  "SourceType": "API",
  "EventName": "dummy",
  "EntityId": "XXX",
  "EventId": "d392a359d9e445b3a310b0c90ee6234f",
  "PayloadJSON": "{\"Alpha\":\"Beta\"}"
}
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.