Hi,
we are integrating the Friends service in our Unity game but we are facing some problems that we are not sure how to solve:
Is there a notification for when a game session invite times out? Right now we are handling that through the SessionV2GameSessionMemberChanged event, looking at the invited member, but that doesn’t feel right. What’s your recommendation here?
Is there a notification for when a game session invite is accepted? Same as #1, right now we think it can be handled through SessionV2GameSessionMemberChanged, but it doesn’t feel like the cleanest solution (maybe it is). What’s your recommendation here?
When playing with friends, what we are planning to do is to invite them to our game session, and from there start matchmaking requesting a matchmaking ticket, but we are not 100% sure if this is the correct way to do this. Should we use parties instead of game sessions? Should we launch matchmaking first somehow and then create the party?
For questions 1 and 2, you’re on the right track! Joined members will only receive SessionV2GameSessionMemberChanged events to check if a user joined or timed out, while invitees will receive both timeout and join events.
Regarding question 3, matchmaking requires a Party to keep teammates together in the same match. For instance, if I want to play with a friend on the same team, we’d need to create a Party before starting matchmaking. You can find more details on Party here.
If you can share more about your specific use case, we’d be happy to recommend an optimized flow for your setup.
Thanks for the response.
Regarding the party, is there a way to cancel an outgoing invitation from the Unity SDK? There’s an example in the documentation but only for OSS. If there is not a method to do that, how should we proceed in case the inviter wants to cancel the invitation?
Another question in regards to parties: is there a way to delete a party? We need something like that in case two players are together inside the same party but one of them wants to leave. If one leaves, we don’t want to be on a party anymore. How do you recommend to proceed?
@Damar in addition to above questions I wanted to ask:
Regarding the parties documentation, and specifically Joining a party, the documentation says:
Players that are invited to a party can accept the invitation and join the party. Party invitees will receive a notification that they’ve joined the party and current party members will also receive a notification that someone is joining the party.
But we subscribe to the SessionV2UserJoinedParty notification event and the user who invited is not receiving the notification, only the invitee that just accepted the request. Is this expected behavior? If it is, then how are we supposed to know when the invitee joins the party?
Regarding the party, is there a way to cancel an outgoing invitation from the Unity SDK
At the moment, the Unity SDK doesn’t include this API, but we’ll be releasing it in the next update.
Is there a way to delete party?
A party automatically deletes itself if there are no members. To leave a party, you can call the LeaveParty function. Once all members leave, the party will no longer exist.
We need something like that in case two players are together inside the same party but one of them wants to leave. If one leaves, we don’t want to be on a party anymore. How do you recommend to proceed?
You can subscribe to the OnPartyMembersChanged event. If the party member list contains only you after the change, you can proceed to leave the party. However, I’m curious—why would you want to disband the party when only one member is left? Typically, we recommend keeping the user in a solo party, as this makes it easier to invite others later without having to recreate the party.
But we subscribe to the SessionV2UserJoinedParty notification event and the user who invited is not receiving the notification, only the invitee that just accepted the request. Is this expected behavior? If it is, then how are we supposed to know when the invitee joins the party?
Yes, this is the expected behavior. For users already in the party, you can track changes in the party members by subscribing to the SessionV2PartyMemberChanged event. This will notify you whenever a new member joins or leaves the party.
Let me know if you have any further questions or need clarification!
Release notes :
Add new feature to let the party leader cancel party invitation. Only the party leader can perform this action. When the invitation is cancelled, the other party members and the party leader will receive a notification.