question

rob avatar image
rob asked

Invite friends to your game

Is there a simple way to do this?

In this thread https://community.playfab.com/questions/661/208349687-Invite-friend-to-a-game-approach-.html from over a year ago there is this comment: "We'll have a generic message system in place later on". Does that exist yet? Polling for changes to shared data doesn't sound like a great solution. Realistically you'd have to poll at least every 10-20 seconds for it to be a decent user experience. Would that fall within usage limits?

Or would it be best to create separate 'messaging' servers that players are always connected to? Then if you want to invite your friend you connect to their messaging server and pass messages back and forth. That sounds like it would be adding to the server load so might be costly with lots of users.

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Correct, Shared Data isn't meant for this use case.

We prioritize our feature set based on a few factors, one of which is how many developers have asked us for any given feature. In the case of a generic message system, that has been steadily moving up the priority stack, and we expect to be adding it later this year. I'm afraid I can't really be more specific than that just yet though, as this work hasn't been scheduled. But we are definitely treating it as a priority for our next major planning round.

However, since what you're looking to do is to get friends playing together, if you mean getting players into hosted games (custom game servers) together, there is another way to approach this. When you call GetFriendsList from the client, the FriendInfo returned contains a CurrentMatchmakerLobbyId for each friend - that is the specific Lobby ID for the game session where that player is currently playing. You could use that to look up the game info, and so join it.

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.

rob avatar image rob commented ·

Thanks for the info. I was actually considering the second option already, showing a list of games that your friends are in, but I didn't realise that was built in so that's useful to know.

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.