question

sking avatar image
sking asked

Is there anyway to get the EntityID and EntityType or EntityKey from a client who joined the server?

My server needs to retrieve some objects associated with a collection of players (playfab entities). I can have the players send their EntityKey to the server, but it would be more nice if the server could manage this itself.

Is this possible?

2 comments
10 |1200

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

sking avatar image sking commented ·

I'm asking in reference to the Playfab Multiplayer API btw

0 Likes 0 ·
sking avatar image sking commented ·

I just discovered that GetMatchResult contains entitykeys which is great. But now I need to associate them with a connecting player. So far all I can tell is that I can use GetInitialPlayers to get some kind of ID. But what ID is this exactly? Is it their EntityID? The docs don't really go into detail what these string are exactly. Any help would be greatly appreciated since the docs aren't the best.

Cheers

0 Likes 0 ·

1 Answer

·
Made Wang avatar image
Made Wang answered

[Edited] As this section -- information passed to the game server said, if you have integrated PlayFab Multiplayer Servers with PlayFab MatchMaking, the members in the current match would be automatically added to the InitialPlayers list that pre-defined in the GSDK, you can use the GetInitialPlayers() method of GSDK to read this list in the corresponding server.

Besides, please also refer to this thread - Getting player title data from server - Playfab Community to learn more about initial player Ids. The initial player Id contain the title player account Id of members in the current match. Specifically, the format of the initial player Id could be something like this.

"title_player_account![PlayerTitleEntityId]"

For your case, you can extract the [PlayerTitleEntityId] from the string of initial player Id and use it as the Player Entity Id directly.

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.