0
\$\begingroup\$

I am creating a real time multiplayer game in unity 3d using Google Play Game Services. In my function where I deal with the positioning of players based on information that is sent from other players, I get a sender id. The sender id is a long string of characters that does not match any participation ids. My participation ids are just strings such as "Player 1234." I keep the participation ids in an array so I can reference them and compare them to the sender of the information that I am receiving so I know which player it is from.

If the sender id and participation id are two different things, how do I make the connection between the two?

Here is a link to the tutorial I have been following for Google play services in unity: https://www.raywenderlich.com/87042/creating-cross-platform-multi-player-game-unity-part-2

\$\endgroup\$
  • \$\begingroup\$ You might want to link some docs, for those of us who have some inklings about what the problem could be but know absolutely jack and squat about Google Play Game Services. I can't even find out what a "participation id" is by (ironically) Googling it. \$\endgroup\$ – Sean Middleditch Mar 4 '16 at 3:17
  • \$\begingroup\$ @SeanMiddleditch Haha no problem.I posted a link to the tutorial I have been following. \$\endgroup\$ – saboehnke Mar 4 '16 at 3:23
  • \$\begingroup\$ Hmm, that tutorial indicates that OnRealTimeMessageReceived's senderId is supposed to be equal to the particpants' participantIDs. It also implies that your participant ids should be much more random-looking than "Player 1234." There's likely something specific to your code that differs from the tutorial in a key way. \$\endgroup\$ – Sean Middleditch Mar 4 '16 at 3:32
  • \$\begingroup\$ @SeanMiddleditch Ah you were right. I completely forgot that I had a method that got the username for each participant and that was what I was getting. \$\endgroup\$ – saboehnke Mar 4 '16 at 19:31
0
\$\begingroup\$

The senderId is the player's participationId. I had been using the username that Google Play Services gives for a player on accident.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.