I just can\'t figure out how this works. What I am trying to do is let two players play a game if a third player joins it can instantly join the game, if the fourth and last pla
Which device should actually call the addPlayersToMatch method? And how can you restrict it to one device executing that method?
You could solve this problem by having the devices "draw straws". Each device generates a random number, then sends it to the others. The device with the largest number is the leader, and it is the one that must call addPlayersToMatch. If two devices pick the same number, throw out the numbers and start over.