【问题标题】:Get Authed Players Last Score Google Game API - NodeJS获取 Authed Players Last Score Google 游戏 API - NodeJS
【发布时间】:2017-02-15 16:22:30
【问题描述】:

我需要显示使用的特定 Google Play Game API 游戏的最后得分

这么说吧,我想获得使用 NodeJS 的“Rush Fight”认证用户的最后分数。

如何实现这个......

【问题讨论】:

    标签: javascript node.js google-api google-play google-play-services


    【解决方案1】:

    您可以参考Leaderboards 的概念。当您创建排行榜时,Google Play 游戏服务会为您管理该排行榜的大部分内容。

    典型的流程是这样的:

    1. 在游戏结束时(或在您确定的适当时刻),游戏会将玩家的分数提交给您为游戏创建的一个或多个排行榜。
    2. Google Play 游戏服务会检查此分数是否优于玩家当前的每日、每周或所有时间分数的排行榜条目。如果是,Google Play 游戏服务会使用新分数更新相应的排行榜。
    3. Google Play 游戏服务将分数报告发送回游戏客户端。该报告告诉客户这是一个新的每日、每周还是历史最高分。如果不是,Google Play 游戏服务会告诉客户该玩家当前的每日、每周或历史最高分是多少。
    4. 要检索玩家的排行榜结果,您可以请求时间范围(每天、每周或所有时间),并指定用户是否希望查看社交或公共排行榜。 Games 服务执行所有必要的过滤,然后将结果发送回客户端。
    5. 如果要报告的分数很多,游戏服务只会发回最高排行榜分数的数据。您还可以检索最高得分或与玩家得分相邻的得分的原始得分数据。

    这个tutorial 也可能有帮助。它是一个 Node.js 模块,用于从 Google Play 商店中抓取应用程序数据。您可以使用方法app 来检索应用程序的完整详细信息。

    例子:

    var gplay = require('google-play-scraper');
    
    gplay.app({appId: 'com.dxco.pandavszombies'})
      .then(console.log, console.log);
    

    结果:

    {
      appId: 'com.dxco.pandavszombies',
      title: 'Panda vs Zombie: Elvis rage',
      summary: 'Help Rocky the Panda warrior to fight zombie games and save the Panda kind.',
      url: 'https://play.google.com/store/apps/details?id=com.dxco.pandavszombies&hl=en',
      icon: 'https://lh6.ggpht.com/5mI27oolnooL__S3ns9qAf_6TsFNExMtUAwTKz6prWCxEmVkmZZZwe3lI-ZLbMawEJh3=w300',
      minInstalls: 10000,
      maxInstalls: 50000,
      score: 4.9,
    .....
    }
    

    希望这会有所帮助!

    【讨论】:

    • 如何通过他的 Google Plus(play) Authenticated Id 获得特定玩家今天的高分!我想在那天获得“Rush Fight”游戏他/她的高分!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-29
    • 2023-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-14
    • 1970-01-01
    相关资源
    最近更新 更多