Today, we implemented some basics: User creation and ticks. The results can be found here.
After login (using Google's user authentication), we require that a nick name is chosen. From Google we only get the email-adress of the current user as an authentication token - obviously not perfect to address the user.
While making sure that an already used nick cannot be chosen, we found out that RequestHandler.redirect(url) does not really redirect the current call. Rather, it sets the "Location" header of the HTTP response and then returns.
Additionally, we implemented the ubiquitous "tick". Every five minutes resources are recalculated, ships are moved and so on. Since we cannot use the cron job from GAEUtilities, as noted in a previous post, we implemented our own lazy cron scheduler. During each request we first update the current tick from the start date of the round and the current time.
Then, for each cron job we determine, if one or more ticks have passed since the last time we executed it. If so, we run the job and provide the number of times it ought to have been called by now. Having processed all cron jobs, the actual user request is processed.
Using this implementation, we now have available a primitive resource distributer. For each tick, credits and metal are increased by one.
Next time, the Control Center will be awakened. :)
Get Off My Lawn
15 years ago