如何使用scores api获得多个分数?
我正在测试 facebook 的分数 api。
到目前为止,我可以设置分数并检索它。
要设置分数,我通过 POST 方法使用 "/[your id]/scores"
为了检索,我通过 GET 方法使用相同的 api
当我检索用户的分数时,返回对象中只有一个分数。
有没有办法跟踪用户的所有分数?
I'm testing facebook's scores api.
So far, i can set a score and retrieve it.
To set a score, I use "/[your id]/scores"
through POST method
To retrieve, I use the same api through GET method
When I retrieve user's score, I only have one score in the return object.
Is there a way to keep track of all the scores of a user?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据规范,据我所知迄今为止,不可能存储多条分数记录。
如果您想要多个高分和/或更高级的评分系统,您必须将其存储在您自己的服务器上。
According to the specifications, and as far as I know to this date, it is not possible to store more than one score record.
You will have to store it on your own server if you want multiple high scores and/or a more advanced scoring system.
您可以做的一种解决方法是将多个分数编码为具有固定长度的单个整数:
例如
100010020 可以读作:
1 - 整数占位符
0001 - 得分 #1
0020 - 得分 #2
然后在您的应用程序中执行拆分。当然,当您上传分数时,您必须以相同的方式提交两个分数,并且排序仅适用于分数 #1。
One workaround you could do is to codify your multiple scores into a single integer with fixed lengths:
e.g.
100010020 could be read as:
1 - placeholder for integer
0001 - score #1
0020 - score #2
Then perform the splitting in your application. Of course, when you upload the scores you have to submit both scores in the same manner and the sorting will only work for Score #1.