2

So here I am trying to convert my single player game into multiplayer game.

I am able to work the part where the user can login to the game using Playfab via Username. I am able to create a friend screen and in that I can, say add PlayerB as his friend in the UI , Playfab friend list and the photon friend list via these commands by invoking various events and callbacks as such.

 var request = new AddFriendRequest { FriendTitleDisplayName = name };
 PlayFabClientAPI.AddFriend(request, onFriendAddedSuccess, onFailure); 

PhotonNetwork.FindFriends(friendDisplayNames);

Also I am able to delete the friends as will.

But the problem is PlayFab follows a follow kind of system wherein which if Player A adds Player B as his friend, Player A's friend list is updated but PlayerB friend list is not updated.

What is really want here is this :

When Player A adds Player B name, then a notification should reach Player B with an invite(both push notification and a message in the friends screen). Only if Player B accepts the invite , Player A and Player B will be friends with each other .

But I searched online for this but there doesn't seems to be great tutorials for this(i.e., sending notification to another friend via playfab). There was a suggestion to use cloud scripting. But there the cloud scripting interface under "Automation" of the playfab has changed and have really hard time figuring it out because many tutorials out there are using the old interface under cloud scripting of Playfab.

Now I am really questioning whether am I on the right track of using PlayFab and Photon for this or should I have used something else like Mirror or whatever it is.

So briefly summarizing how do I send a friend request from Player A to Player B in multiplayer games in Unity

0 Answers0