Using PlayFabMultiplayerManager (Unity) for PlayFabParty -- ran into some unexpected behavior:
- Seems that sending an empty IEnumerable (e.g. a List with count 0) sends to all. Initially I expected it to just abandon the send -- sending to no peers.
- Also, seems that we can send data to a remote-peer through SendDataMessageToAllPlayers (or using the above way) *before* we get the OnRemotePlayerJoined call for that remote-peer. I expected not to be able to do this.
Psuedo-code on an already-joined player that shows both behaviors:
var welcomedPlayers = new List<PlayFabPlayer>(); private void Update(){ //sends to all players when welcomedPlayers list is Count 0 SendDataMessage(someUpdateData, welcomedPlayers, DeliveryOption.Guaranteed); } //triggered by PlayFabMultiplayerManager's OnRemotePlayerJoined... private void OnRemotePlayerJoined(object sender, PlayFabPlayer player){ SendDataMessage(welcomeData, player, DeliveryOption.Guaranteed); welcomedPlayers.Add(player); }
Causing the resulting output on the newly-joined peer:
got someUpdateData got someUpdateData got welcomeData got someUpdateData
Each of these have a simple solution, but I thought it might be useful to mention them -- both for potentially leading to changes in PlayFabMultiplayerManager and also to help anyone else that might come across the behavior
--Ross