question

Reid Taylor avatar image
Reid Taylor asked

Inviting PlayFab friend to squad

Hello, I am working on squads and I want a player to be able to invite their friend to a squad and then be able to do all other actions like enter game, kick from squad, etc... I am using photon so I would need some kind of function on a player that gets called when they get an invite to a squad. Also when the leader presses play I would need the squad member to join that room.

I think my main question is this: is there a way to use the Cloud script to call function on a player? any other ideas on how to accomplish this appreciated. Thanks!

photonFriends
10 |1200

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

JayZuo avatar image
JayZuo answered

>> is there a way to use the Cloud script to call function on a player?

Yes, we can call Server APIs in Cloud Script and most Server APIs can specify the player with setting PlayFabId.

However, as I understand it, what you actually need is a way to notify the player when some other players preform actions on him (e.g. the player is invited by his friend). If so, currently, there is no built-in support for this. As PlayFab APIs are Restful APIs, there is no way to send data to clients without a request.

If your game is running on Android/iOS devices, you can take advantage of Push Notifications to notify the player. Or, you may accomplish this with some other technologies like SignalR.

10 |1200

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

Noah Reardon avatar image
Noah Reardon answered

What about having the party leader search for a session with multiple open slots, then when they connect, pass a protocol token to reserve the other slots until the friends have joined the session? I don't know how to tell the other player which session to connect to though. It seems like Photon would need to support the ability to be searching for a session while in a lobby so the party leader can send the other players the session ID.

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.