Peer Removed not flagging

Include the following details (edit as applicable):

  • Issue category: Multiplayer
  • Device type & OS version: Android / iOS /
  • Host machine & OS version: Mac / Windows
  • Issue Environment : Unity Remote / Unity Mock / On Device / Dev Portal
  • Xcode version:
  • ARDK version: 2.0
  • Unity version: 2021.3.5f

Description of the issue:
Peer Removed event from IMultipeerNetworking is not flagging when a peer leaves the network via IMultipeerNetworking.Leave() and IMultipeerNetworking.Dispose(). Am I missing something, I swear in previous projects this is what flagged the Peer Removed event.

Hi Scott,

The event IMultipeerNetworking.PeerRemoved(PeerRemovedArgs argos) will be raised whenever a peer leaves the session. Peers that join and leave a session before the local client joins will not be surfaced.

For more information see our Understanding Networking and LLAPI documentation then scroll down to the Peer section.

In this scenario all peers are joined and connected before I have any peer leave multipeerNetworking, so all clients should be receiving the PeerRemoved call shouldnt they?

The use case being I’m created a lobby system, and if a user leaves networking by calling networking.Leave() I want the lobby to be able to react to the peer removed event and automatically remove them from the lobby.

Is it possible that if AR is not started or not localized that the peer removed wont flag as the local client would be considered not fully joined?

Yes, that’s correct the PeerRemoved should be called. Try running it with the AR session configured and running. Please let me know if this solved the issue.

So upon more testing ive for that it is working 75% of the time for receiving the peer left message, but there is confusing behaviour when it doesnt work its only when my iPhone joins the Ipads session as peer and leaves, the Host iPad consistently doesnt receive the left message.

So to summarize my findings:

  • iPhone (Host) / iPad(Peer) - Peer leaves, host receives message
  • iPhone (Host) / iPad(Peer) - Host leaves, peer receives message
  • iPhone (Peer) / iPad(Host) - Host leaves, peer receives message
  • iPhone (Peer) / iPad(Host) - Peer leaves, host DOES NOT receive message

No idea why this would be the case but it does seem to be quite consistent, ive run each combination about 10 times.

Edit: iPhone12 Pro and iPad Air 5

Unfortunately, ARDK does not support iPad devices. See Runtime Requirements here.

Aye, I did see that I just found that it has worked with everything so far so I was using it since its my only other iOS device. But that being said you think thats the cause? If so cool, im happy to just know why it doesnt work in that one situation so I know im not doing something wrong on the coding end.

There’s a good chance it could be. However, we aren’t able to confirm because the iPad is not a supported device.

1 Like