[appengine-java] How to produce a synchronized timestamp?

2011-02-05 Thread Ivan
Hi there,

What is the best way to produce a timestamp that is synchronized (more
or less, couple of seconds clock skew don't matter) among all running
instances of an app?

The problem I need to solve is the following:

In a mobile game, a user can use a certain boon, that is valid for 12
hours. I store a timestamp that reflect creation time + validity
period. This is then persisted to the datastore. Of course then I need
to check if this boon has expired by comparing current timestamp and
the creation timestamp + validity. So far I've been using simply
new Date(), but then I realized that this could very well differ if
the clocks are not synced. Any thoughts?

Cheers,
Ivan

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: How to produce a synchronized timestamp?

2011-02-05 Thread Peter Ondruška
I would be interested on Google's answer whether instances' clock are 
guaranteed to be in sync.. I would hope so.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Problem Authenticating against App Engine

2011-02-05 Thread Fabrizio Accatino
Perhaps your authentication token was expired.

In the android app, call .invalidateAuthToken(account.type, authToken)
on AccountManager class.
This releases the current authentication token. Then call again getAuthToken
to obtain a new and fresh authentication token.

A note: AFAIK Android uses ClientLogin and not OAuth.
http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html


   Fabrizio


On Fri, Feb 4, 2011 at 11:57 PM, Sky skysoftwaredes...@googlemail.comwrote:

 Hi all,

 I am using the oauth authentication process to authenticate Android to
 App Engine described in Nick's blog:

 http://blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app

 This worked fine until today. Today the authentication on app engine
 fails - boolean authenticated = userServiceManager.isUserLoggedIn();
 returns always false.

 Is anyone out there using the same authentication process and has the
 same problem?
 Are there any changes concerning the URL the cookie is fetched?
 HttpGet http_get = new HttpGet(https://yourapp.appspot.com/_ah/login?
 continue=http://localhost/auth=https://yourapp.appspot.com/_ah/login?continue=http://localhost/auth=
 + tokens[0]);


 thanks!

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-java@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.