在插入SimpleDB的时间戳

在插入SimpleDB的时间戳

本文介绍了在插入SimpleDB的时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个游戏,将使用SimpleDB的游戏数据存储和我希望能够超时一些数据库条目的iPhone。

I am working on a game on the iPhone that will use SimpleDB for game data storage and I'd like to be able to timeout some database entries.

我想我还会有一些cron作业,着眼于每个条目的时间戳,如果它的增量大于X I会超时,该条目(改变变种在它,所以它再次可供选择通过用户)。

I figure i'll have some cron job that looks at the timestamp of each entry and if it's delta is greater than X i'll time out that entry(change a var in it so it is once again available for selection by users).

我的问题是我不知道如何来统一时间戳。我该怎么做,如果一个用户都有自己的系统时钟搞砸了,并通过几个小时甚至几天的了吗?我想是从SimpleDB的服务器上获得系统的时候,我插入,但我相信我读到的SimpleDB不提供任何形式的时间戳。

My issue is i don't know how to unify the timestamps. What do i do if a user has their system clock screwed up and it's off by a couple hours or even days? What i'd like is to get the system time from the SimpleDB servers when i insert, but i believe i read that SimpleDB doesn't provide any sort of timestamp.

我目前唯一的想法是让所有的客户端得到一些随机在线来源时间戳在启动时,然后根据确定关闭该时间时间戳和系统的蜱,但我真的preFER保持这个内部到我的计划和AWS服务器,我不能保证什么第三方时间戳源将提供和时间。

My only current thought is to have all clients get a timestamp from some random online source at start up and then determine timestamps based off that time and system ticks, but i'd really prefer keeping this internal to my program and the AWS servers as i can't guarantee what the 3rd party timestamp source would be provide and when.

任何人都可以提出一个解决这个问题,或者提醒我这是由AWS服务器维护的访问时间戳?我仍然在设计阶段,所以我没有做太多的工作与AWS的消息,确实他们的响应数据包可能包含时间的地方?

Can anyone suggest a solution to this issue or perhaps alert me to an accessible timestamp that is maintained by the AWS servers? I'm still in the design phase so i haven't done much work with the AWS messages, do their response packets maybe contain the time somewhere?

谢谢!-Skyler

Thanks!-Skyler

推荐答案

我的建议是有一个中间Web服务(可能是坐在一个EC2实例)处理你的iPhone应用程序和SimpleDB的之间的所有通信。

My recommendation would be to have an intermediate webservice (probably sitting on an EC2 instance) handle all the communication between your iPhone app and SimpleDB.

这解决了您的immeadiate的问题,因为现在的中间Web服务器可以添加一个一致的时间戳。

This solves your immeadiate question because now the intermediate web server can add a consistent timestamp.

但是......更重要的是这解决了哪些与您AWS密钥的安全性问题(现在他们住你控制的服务器上)。你真的不想让他们嵌入到你的iPhone应用程序...: - )

But... more importantly this solves the security problem of what to with you AWS keys (now they are living on a server you control). You really don't want to have them embedded in your iPhone app... :-)

这篇关于在插入SimpleDB的时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 10:18