【问题标题】:Cloud Saving from a web page in Google Play Services从 Google Play 服务中的网页进行云保存
【发布时间】:2018-01-15 19:44:04
【问题描述】:

是否可以从网页(我想通过 REST)在 google play 服务中创建和加载云存档?我似乎只能找到用于 C++/Android 代码的已保存游戏的文档。

【问题讨论】:

标签: javascript rest google-play-services google-play-games


【解决方案1】:

您可以查看Get Started with Play Games Services for Web

Google Play 游戏服务的 REST API 允许您发布 REST 从您的网页游戏中设置和检索游戏服务数据的调用。你 还可以使用管理 API 进行 REST 调用来重置游戏 服务数据并执行其他管理功能。

注意: Links 示例代码也在页面中提供。为了让游戏正常运行,您需要在 Google Play 开发者控制台中设置您自己的版本。

【讨论】:

  • 恐怕没有部分回答我的问题,我先看了那里。
【解决方案2】:

所有这些方法都需要authentication and authorisation

获取saved game from the REST API call

https://www.googleapis.com/games/v1/snapshots/{ID of save}

获取list of saved games

https://www.googleapis.com/games/v1/players/{me | ID of player}/snapshots

保存游戏比较麻烦,因为您必须使用drives API 来创建文件:

https://www.googleapis.com/upload/drive/v2/files

【讨论】:

  • 答案是一半。你知道是否有使用驱动器 API 创建保存文件的指南吗?我把它们放在哪里?你做过吗,或者见过其他人做过吗?
  • @ChrisJefferson 有一个可运行的 JS quickstart example 可用于驱动器文件。
猜你喜欢
  • 2015-08-22
  • 1970-01-01
  • 2020-09-08
  • 1970-01-01
  • 2019-04-25
  • 1970-01-01
  • 2019-02-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多