在游戏中心验证本地用户时滞后 [英] Lag when authenticating local user on Game Center

查看:152
本文介绍了在游戏中心验证本地用户时滞后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的cocos2d游戏,我在我的AppDelegate的 applicationDidFinishLaunching 方法中验证本地用户。然而,每当认证完成,它会导致我的游戏中,当欢迎回来,X消息滑下来和备份短暂的滞后。问题是,我无法控制此认证完成时 - 显然持续时间高度依赖于设备的数据连接。

For my cocos2d game, I authenticate the local user in the applicationDidFinishLaunching method of my AppDelegate. However, whenever the authentication is complete, it will cause a short lag in my game when the little "Welcome back, X" message slides down and back up. The problem is I have no control over when this authentication is complete – obviously the duration is highly dependent on the data connection of the device.

有时,当我在菜单场景中时,消息(和不可避免的伴随滞后)出现,这是有点可接受的,因为我的菜单更多少静电。更多的时候,它发生后,当游戏已经开始。因为我的游戏是一个无尽的卷轴,消息总是导致玩家的移动滞后,甚至导致玩家死了有时(半秒的滞后是足够的: - /)。

Sometimes the message (and the un-avoidable accompanying lag) appears as soon as when I am in the menu scene, which is somewhat acceptable, since my menu is more or less static. More often than not, it happens later, when the game has already started. Because my game is an endless scroller, the message always causes a lag in the movement of the player, even causing the player to die sometimes (half a second of lag is enough :-/).

我如何规避这个问题?我以前有一个加载场景,在我的菜单场景之前加载一些我的资产,并且因为加载需要一段时间,总有很好的机会认证完成在加载现场,但当然我不能

How might I circumvent this? I used to have a loading scene right before my menu scene to load some of my assets, and because the loading takes a while, there was always a good chance that the authentication is completed at the loading scene, but of course I can't guarantee that it will be true!

推荐答案

Game Center可以让游戏冻结一点,因为它的启动,如果你的连接不是' t伟大。我怀疑加载GameCenter在不同的线程将是一个好主意(或甚至有一个效果),但你可以做一个工作周围的问题,你所拥有的是给游戏一个3-2-1倒计时在它开始滚动/移动之前。会给游戏中心和时间更多的时间为玩家建立他的焦点,开始认真的在游戏中直接可能不是一些玩家的喜好。
我希望这有帮助。

Game Center can make the game freeze for a little as its starts if your connection isn't great. I doubt that loading GameCenter on a different thread would be a good idea (or even have an effect on that) but what you could do as a work around of the issue you are having is to give the game a 3-2-1 countdown before it starts scrolling/moving. would give a little more time for game center and time for the player to build his focus, starting serious in a game straight away might not be to the liking of some players. I hope this helps.

这篇关于在游戏中心验证本地用户时滞后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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