Hi, I'm implementing a networked Unity game using PlayFabParty through the PlayFabMultiplayerManager -- peer-to-peer with one acting as the host.
The question I have is: how do newly-joined peers know who the host peer is? And how can this be done in a way that doesn't leave it open to a non-host peer maliciously claiming to be host?
Is there a recommended way to handle this within PlayFabParty or PlayFab?
A few paths I suspect might be worthwhile checking out(?):
- Right now in Unity I'm using the provided PlayFabMultiplayerManager -- which creates one network and, as each peer joins, every peer on that network is made aware of every other peer on that network. I need to do more reading about this but possibly there's a way to create multiple networks within each contest (a round of gameplay) so that each peer in that contest is only able to communicate gameData directly with the host?
- The other route would involve something like the host writing publicly-readable data containing the matchId to PlayFab somewhere -- and then, when there are multiple peers claiming to be the host to a newly-joined peer, the new-peer can compare DateModified metadata for each of the claimants' files to determine who has the *true* claim -- in the case of my game it'd probably be whoever has the oldest DateModified time. This is under the assumption of course, that whoever creates the initial network is also the host and that they would wait for confirmation of their file having been written to PlayFab before inviting additional peers.
- Perhaps Entity Groups is a path forward?
Possibly I'm missing something obvious.
Thanks,
--Ross