question

Mahnoor Naeem avatar image
Mahnoor Naeem asked

How to get actorlist from photon room.

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.

Mahnoor Naeem avatar image Mahnoor Naeem commented ·

I need playfab IDs of all players in a room. I have integrated photon with playfab. Can you please tell as soon as possible?

0 Likes 0 ·

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

According to your description, I assume that you’ve finished this tutorial: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/photon/quickstart. You need each room’s PlayFab IDs, the first thing you need to do is to set PlayFabID as UserID by setting AuthenticationValues.UserId before Clients connect to photon server. After this operation, the “UserId” in ActorList will be the “PlayFabID”. When you need to get the PlayFabIDs, call Photon.Hive.Plugin.SerializableGameState.ActorList API to get the Actorlist which contains a list of all actors inside the room, parse each PlayFabID into an array, then you get all the PlayFabIds in each room.

By the way, Shared Group Data might worth a try. In each room event handler, update the PlayFabIDs into Shared Group Data for each player in the room to access. Here is the doc you may want to refer: https://docs.microsoft.com/en-us/gaming/playfab/features/social/groups/using-shared-group-data

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.

Mahnoor Naeem avatar image Mahnoor Naeem commented ·

You saved my life :) Thankyou. :) And Yes I will try shared group data too then will let you know.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Mahnoor Naeem commented ·

glad it helped:)

1 Like 1 ·

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.