question

martin-2 avatar image
martin-2 asked

Lobby Member Alt-F4 Does Not Trigger OnLobbyMemberRemoved Event

Hello,

I am using Unity and the PlayFab Unity SDK.

Implementing lobbies currently, and as I've been handling players leaving and joining, I've hit an issue. If a player leaves unconventionally (a power cut, pressing Alt-F4, internet suddenly dies, etc) without calling Lobby.Leave, I am unsure what event I should be handling to inform the rest of the lobby they have left. OnLobbyMemberRemoved is never called, and so I am unsure the best practice for handling this situation, and informing the other members of the lobby that this particular member is no longer in the lobby.

Martin

unity3d
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

·
Gosen Gao avatar image
Gosen Gao answered

When a lobby member disconnects, he is still a member, so the OnLobbyMemberRemoved event is not raised. However, the event PlayFabMultiplayer.OnLobbyUpdated - PlayFab | Microsoft Learn is raised, which can indicate which player's connection status has changed. Then you can use GetMemberConnectionStatus - PlayFab | Microsoft Learn to confirm his current connection status.

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.

martin-2 avatar image martin-2 commented ·

Excellent, thank you. I shall look into this right now :)

0 Likes 0 ·
martin-2 avatar image martin-2 commented ·

Worked a treat. Thank you

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.