Android - OpenFeint - 允许更差的分数选项不起作用
我今天一直在实施 OpenFeint,一切都很顺利,直到我注意到我认为是一个错误。
我有一个排行榜设置,其中选中了“允许更差的分数”选项 - 因此用户上传的任何分数每次都应添加新分数。
目前,当我提交分数时,无论分数如何,用户分数始终会替换为新值,而不是创建新分数。
我在自己的代码以及他们提供的示例应用程序中尝试过这一点 - 两者都具有相同的结果,无论如何用户都只有一个分数。
我只是想确保我没有遗漏任何明显的东西 - 同时我已向他们的支持台提交了一张票并等待回复。
哦,这也不是一个“汇总”排行榜 - 我确实看到其他人也有类似的问题,他们就是这种情况。
代码:
long scoreValue = 1234; // or whatever score
Score s = new Score(scoreValue, null); // Second parameter is null to indicate that custom display text is not used.
Leaderboard l = new Leaderboard(getString(R.string.leaderboard_id));
s.submitTo(l, new Score.SubmitToCB() {
@Override public void onSuccess(boolean newHighScore) {
GameModeBase.this.setResult(Activity.RESULT_OK);
}
@Override public void onFailure(String exceptionMessage) {
Toast.makeText(GameModeBase.this, "Error (" + exceptionMessage + ") posting score.", Toast.LENGTH_SHORT).show();
GameModeBase.this.setResult(Activity.RESULT_CANCELED);
}
});
谢谢, 瑞奇
I've been implementing OpenFeint today and everything was going well until I noticed what I think is a bug.
I have a leaderboard setup with the option "Allow worse scores" checked - so any score the user uploads should add a new score each time.
Currently when I submit a score, regardless of the score, the users score is always replaced with the new value instead of creating a new score.
I've tried this in my own code and also the sample app they provide - both with the same results, the user just having one score regardless.
I just want to make sure I'm not missing anything obvious - in the mean time I have submitted a ticket to their support desk and awaiting a reply.
Oh, and it's not an 'aggregate' leaderboard either - I did see someone else having a similar problem and this was the case for them.
Code:
long scoreValue = 1234; // or whatever score
Score s = new Score(scoreValue, null); // Second parameter is null to indicate that custom display text is not used.
Leaderboard l = new Leaderboard(getString(R.string.leaderboard_id));
s.submitTo(l, new Score.SubmitToCB() {
@Override public void onSuccess(boolean newHighScore) {
GameModeBase.this.setResult(Activity.RESULT_OK);
}
@Override public void onFailure(String exceptionMessage) {
Toast.makeText(GameModeBase.this, "Error (" + exceptionMessage + ") posting score.", Toast.LENGTH_SHORT).show();
GameModeBase.this.setResult(Activity.RESULT_CANCELED);
}
});
Thanks,
Ricky
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
还有另一个名为 Swarm 的 SDK,与 OpenFeint 类似。 Swarm 拥有排行榜,允许开发者在每个排行榜上为每个用户存储最多 25 个分数。这将使您能够允许不一定是用户最高分数的分数。我意识到这不是一个很好的解决方案,但它仍然可以让您实现您正在寻找的目标。
There's another SDK called Swarm that's similar to OpenFeint. Swarm has leaderboards that allows developers to store up to 25 scores per user per leaderboard. This would enable you to allow scores that aren't necessarily the user's top score. I realize this isn't a great solution, but it might still allow you to accomplish what you're looking for.
好吧,我决定选择 Scoreloop - 纯粹是因为它的受欢迎程度。 Swarm 看起来是一个不错的选择,但它目前处于测试阶段,这让我有点担心。
对于任何想知道的人,OpenFeint 支持还没有回复我,在提到他们的支持不是最好的之前,我已经阅读了几篇文章。他们的网站昨天也充满了问题,所以我决定反对他们。遗憾的是,事情进展得相当顺利。
更新:我收到了回复,看来这是我的误解,也许他们的文档中存在一些差异:
所以,看起来你在排行榜上只有一个分数 - 这是有道理的。
除此之外,我仍然选择 Scoreloop,我可以确认这对于每个用户一个分数的行为是相同的,但它提供了更多的功能,并且似乎比 OpenFeint 为我做的响应要快得多。
Well I've decided to go for Scoreloop - purely on the popularity of it. Swarm looks a good option but it's currently in beta and that worries me a little.
For anyone wondering, OpenFeint support haven't got back to me and I've read several posts before mentioning their support isn't the best. Their website was littered with issues yesterday too so I've decided against them. Pity really, it was going quite well.
Update: I got a reply and it seems it's a misunderstanding on my part and perhaps some discrepancies in their documentation:
So, it looks like you only ever have one score in the leaderboard - makes sense.
Further to this, I'm still opting for Scoreloop and I can confirm this behaves the same regarding one score per user but it offers a lot more functionality and does seem to respond much quicker than OpenFeint did for me.