如何访问Google Play游戏玩家ID [英] How to access Google Play Games Gamer ID

查看:497
本文介绍了如何访问Google Play游戏玩家ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,谷歌在Google Play游戏服务中添加了玩家ID的概念,该功能允许玩家设置不同于其Google+身份的游戏身份. http://officialandroid.blogspot.co .uk/2016/02/embrace-your-inner-gaming-hero-with.html

我的用例是,我有一个在线多人游戏,它使用自己的配对服务器.我不使用Google Play游戏的配对服务,因为我需要基于技能的配对服务,而GPGS目前不具备这种功能.

如果他们碰巧已经登录,我希望能够显示该玩家的Google Play游戏身份(只是名字).但是,我以前出于隐私原因选择不参加,因为我知道在快速匹配"中GPGS,Google选择隐瞒对手的身份,我认为我应该效法他们的领导.

现在,我认为添加游戏玩家ID的部分原因是为了避免出于隐私方面的考虑.所以我有以下问题:

  1. 是否可以通过编程方式获取本地玩家的Google Play Game Gamer ID?
  2. 有没有办法确保我得到的是玩家ID,而不是带有额外隐私问题的老式google +身份?
  3. 我是否认为新的Gamer ID的隐私更加宽松,并且Google和我的用户在互联网上与随机对手对抗时不会担心共享Gamer ID是否正确?

解决方案

您可以从 Games.getCurrentPlayerId( )或 然后使用 Player.getDisplayName().

  • 您可以在服务器端使用www.googleapis.com/games/v1/applications/<app_id>/verify/验证玩家的身份, 如博客文章中所述获得令牌.更新的 权限现在正在推出,所以我希望它无处不在 很快.

  • 是的,正是出于这个原因,新游戏玩家的身份独立于Google+.因此,您可以安全地使用游戏者的身份,而不会冒险牺牲玩家的隐私.

  • Recently google added the concept of a Gamer ID to Google Play Games services which allows a player to setup a gaming identity distinct from their google+ identity. http://officialandroid.blogspot.co.uk/2016/02/embrace-your-inner-gaming-hero-with.html

    My use case is that I have an online multiplayer game which uses my own matchmaking server. I don't use Google Play Game's matchmaking because I require skill-based matchmaking capabilities that are not currently available using GPGS.

    I'd like to be able to display the player's Google Play Games identity (just the name) if they happen to have signed in. However, I had previously elected not to for privacy reasons as I know that in Quick Matches with GPGS, google elects to conceal your opponent's identities, and I felt I should follow their lead.

    Now, I think that part of the reason that gamer IDs have been added is to avoid the need for such caution over privacy. So I have the following questions:

    1. Is there any way to programmatically get the Google Play Game Gamer ID of the local player?
    2. Is there a way to be sure that what I have got is a Gamer ID, and not the old-style google+ identity which carries extra privacy issues?
    3. Am I right in assuming that privacy over the new Gamer IDs is more relaxed and that google and my users will not be concerned about having gamer IDs shared when playing against random opponents on the internet?

    解决方案

    You can get some more information from http://android-developers.blogspot.com/2016/01/play-games-permissions-are-changing-in.html

    Quick answers to your questions:

    1. You can programmatically get the local player's ID, name and avatar as usual using Games.getCurrentPlayerId() or Games.getCurrentPlayer() then using Player.getDisplayName().

    2. You can verify the player's identity on the server side using www.googleapis.com/games/v1/applications/<app_id>/verify/ with a token obtained as described in the blog post. The updated permissions are rolling out now, so I'd expect it to be everywhere very soon.

    3. Yes, the new gamer identity is independent of Google+ for exactly this reason. So you can safely use the gamer identity without risking the privacy of the player.

    这篇关于如何访问Google Play游戏玩家ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆