question

Jade Bourque avatar image
Jade Bourque asked

Get Character Data inconsistently returning nothing

Very strange issue that I only noticed recently, unfortunately I can't give an exact date on when this started happening.

Context: When a client clicks on another player character, the selected character's username is used to find their PlayFabId using ClientGetAccountInfo, and once the PlayFabId is found, ClientGetCharacterData is called to populate a window with the selected character's information.

I had this working fine and dandy for months with zero issues, but suddenly, ClientGetCharacterData has occasionally been returning no data for some c.counts


Example:

User A, B then C connect to the server
  • A can retrieve B and C's character data successfully
  • B can retrieve C's data, but A's data returns empty
  • C can retrieve B's data, but A's data returns empty

So no client other than A can get A's data

I have tried connecting with different characters on A, B and C, It seems all of A's characters' data cannot be fetched, while all of B and C's characters' data can.

Clearly something is different about A's account, but I can't figure it out.

I also ran a pre-alpha test recently with a group of friends, nobody's character data was being successfully returned except mine.

I should mention, neither ClientGetAccountInfo nor ClientGetCharacterData are returning errors. They're both using the correct IDs. ClientGetCharacterData simply sometimes returns nothing for some accounts.

Does anyone have any what's going on here?

Character Data
10 |1200

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

Made Wang avatar image
Made Wang answered

In my tests this API works fine. The Character Data updated through the API is private by default and cannot be accessed by other players. Please check whether the permission of the Character Data of user A is public. If the problem still exists, please provide the Title Id, PlayFab Id and Character Id for us to further troubleshoot.

1 comment
10 |1200

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

Jade Bourque avatar image Jade Bourque commented ·

Hey Made,

So, you're correct, changing the character's data to public allowed me to fetch the information perfectly fine. However, some of my clients' characters' data is set to private and can still be fetched by other users.

My title is 4882C.

For example, none of player A3D23A4AA6B14407 's characters' data was being returned until I set a few fields on their character 2F1900D14766C3B to public.

However, it seems all of player 43BBDE44ED394F3F 's characters' data can be fetched despite all fields being set to private. I thought this was due to the account being older, but I can also fetch all of 585646D65C0D510C 's characters' data just fine even though their fields are set to private as well. A few days prior, I could not access any of 585646D65C0D510C 's character data.

I assume there has to be something simple I'm missing here, but on the off chance that this is not, in fact, an intended function, I figured I'd share.

0 Likes 0 ·
Made Wang avatar image
Made Wang answered

If PlayFabId is not set when calling GetCharacterData, the character data under the player's own account will be accessed by default, and both public data and private data will be returned. Also, if you call GetCharacterData on the server side, both public data and private data will also be returned. Please exclude these two cases first.

You can use Postman to do some tests, accessing character data from the client and server respectively will return the following results.

Also, can I do some tests in your Title? For example, I'll create an account to try to access the private character data that you said can be accessed.

//Player A accesses the character data of player B.
{
    "code": 200,
    "status": "OK",
    "data": {
        "CharacterId": "B67F8B4A3441471",
        "Data": {
            "Test1": {
                "Value": "111",
                "LastUpdated": "2022-08-04T07:46:45.385Z",
                "Permission": "Public"
            },
            "Test3": {
                "Value": "333",
                "LastUpdated": "2022-08-04T07:46:45.385Z",
                "Permission": "Public"
            }
        },
        "DataVersion": 7
    }
}

//The server accesses the character data of player B.
{
    "code": 200,
    "status": "OK",
    "data": {
        "PlayFabId": "EDE8D48BF6E43FED",
        "DataVersion": 7,
        "Data": {
            "Test1": {
                "Value": "111",
                "LastUpdated": "2022-08-04T07:46:45.385Z",
                "Permission": "Public"
            },
            "Test2": {
                "Value": "222",
                "LastUpdated": "2022-08-04T07:46:45.385Z",
                "Permission": "Private"
            },
            "Test3": {
                "Value": "333",
                "LastUpdated": "2022-08-04T07:46:45.385Z",
                "Permission": "Public"
            }
        },
        "CharacterId": "B67F8B4A3441471"
    }
}
1 comment
10 |1200

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

Jade Bourque avatar image Jade Bourque commented ·

Sorry for the delay, the last few days have been very busy so I didn't have time to sit down and troubleshoot things.

It seems the issue has resolved itself? I wish I had grabbed some screenshots, I swear I was still receiving some private data from some users but after trying postman and seeing that the issue wasn't occurring there, I went into my project this morning to try to see if this was an issue with the unreal plugin.. alas, as I should be, I'm no longer receiving any private data from any users I was before.

As crazy as I feel, I must have been misreading something and not actually fetching up-to-date information from PlayFab, and instead fetching information to fall back to that was stored on my dedicated server. That being said, I'm pretty sure I checked the unreal output logs to confirm I was actually receiving data from the API requests, and I was. Unfortunately I don't have any screenshots to convince myself of that though, haha!

If I notice it happening again I will definitely share here with some screenshots, until then, I'm convinced I was being silly and misreading things.

0 Likes 0 ·

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.