Sunday, December 14, 2008

Users and cron jobs

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. :)

Wednesday, December 10, 2008

"Hello World" of Nebula Conflicts goes live

We proudly present our first version of "Nebula Conflicts". You cannot imagine how difficult it is to find a name for a SSBG (Space Strategy Browser Game), which is not already in use. ;)

The code is available in our subversion repository, with anonymous read access. This version uses Django, which is the default templating engine in GAE to create the webpages. Other Python based template engines are also supported, e.g. ClearSilver and Quixote. We will use Django because it is the default and many tutorials can be found. Information on how to use Django in GAE can be found here.

We're always eager to get feedback on what can be improved. So leave a comment, if you feel something ought to be different.