1

How can I go about hiding an opponent's score from a user in a TurnBasedMatch?

To elaborate a little further, I have created a UI that displays all the players in the match. It displays their pictures, their names, and their scores. For every player that is not "you" I would like to set their scores as 'hidden'. So for example, user A, who is signed into the Google Game Services, will see user B's score as "hidden" but will be able to see her/his own score. Likewise, user B, who is also signed into the Google Game services on a separate device, will see user A's score as 'hidden' but will be able to see his/her own score. Once the match is over all scores will become visible to all players involved.

Any suggestions on ways to implement this? Is it possible to get an ID of the current user logged in and compare it to all the participant IDs of the match (thus marking every 'non-equal' ID as "hidden")?

Thanks.

Note: The scores are saved as part of the data of the match and are accessed via TurnBasedMatch.getData();

SydStorm
  • 68
  • 7
  • possible duplicate of [How to get the Android device's primary e-mail address](http://stackoverflow.com/questions/2112965/how-to-get-the-android-devices-primary-e-mail-address) – selbie Jun 29 '14 at 17:02
  • Follow the instruction on the link above to get the user's email address. Then hash that value into an integer "ID" (or just use the email as the ID). – selbie Jun 29 '14 at 17:04

0 Answers0