Skip to content

Instantly share code, notes, and snippets.

@jtwb
Created August 10, 2010 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtwb/516678 to your computer and use it in GitHub Desktop.
Save jtwb/516678 to your computer and use it in GitHub Desktop.
handle: function(request, response) {
var self = this,
context = new requestcontext.RequestContext({request:request}),
isNewPlayerCommand,
implResponse;
isNewPlayerCommand = self.impl.isNewPlayerCommand(context);
if (!isNewPlayerCommand) {
if (!self.authenticator.isValid(context)) {
log.message('... Ignored, authenticator disabled', 'error');
// TODO disabled for now
// self.accessDenied(context, response);
// return;
}
}
// if we're good, commit change to world
implResponse = self.impl.handle(context);
if (isNewPlayerCommand) {
var credentials = self.authenticator.createUser(context);
implResponse = core.extend(implResponse, credentials);
}
self.ok(implResponse);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment