 app.post '/action/attack',
 	mustBeAuthed,
 	(request, response) ->
-		lib.game.goAttack.sync null, dbConnection, request.uonline.user.character_id
+		lib.game.goAttack.sync null, request.uonline.tx, request.uonline.user.character_id
 		response.redirect 303, '/game/'
 
 
 app.post '/action/escape',
 	mustBeAuthed,
 	(request, response) ->
-		lib.game.goEscape.sync null, dbConnection, request.uonline.user.character_id
+		lib.game.goEscape.sync null, request.uonline.tx, request.uonline.user.character_id
 		response.redirect 303, '/game/'
 
 

	mustNotBeAuthed,
	setInstance('login'),
	(request, response) ->
		if lib.user.accessGranted.sync null, dbConnection, request.body.username, request.body.password
			sessid = lib.user.createSession.sync null, dbConnection, request.body.username
			response.cookie 'sessid', sessid
			response.redirect 303, '/'
		else

	setInstance('new_character'),
	(request, response) ->
		nameIsValid = lib.validation.characterNameIsValid(request.body.character_name)
		alreadyExists = lib.character.characterExists.sync(null, request.uonline.tx, request.body.character_name)

		if nameIsValid and not alreadyExists
			charid = lib.character.createCharacter.sync(
