 
 
 fetchCharacterFromURL = ((request, response) ->
-	request.uonline.fetched_character = lib.game.getCharacter.sync null, dbConnection, request.param('name')
+	request.uonline.fetched_character = lib.game.getCharacter.sync null, dbConnection, request.params.name
 ).asyncMiddleware()
 
 
 fetchMonsterFromURL = ((request, response) ->
-	chars = lib.game.getCharacter.sync null, dbConnection, request.param 'id'
+	chars = lib.game.getCharacter.sync null, dbConnection, request.params.id
 	if not chars?
 		throw new Error '404'
 	for i of chars

			'UPDATE armor '+
				'SET equipped = true '+
				'WHERE id = $1 AND owner = $2',
			[request.param('id'), request.uonline.user.character_id]
		response.redirect '/inventory/'


app.get '/action/switch_character/:id',
	mustBeAuthed,
	(request, response) ->
		lib.game.switchCharacter dbConnection, request.uonline.user.id, request.param('id')
		response.redirect 'back'



app.get '/ajax/isNickBusy/:nick',
	(request, response) ->
		response.json
			nick: request.params.nick
			isNickBusy: lib.user.userExists.sync null, dbConnection, request.params.nick


app.get '/ajax/cheatFixAll',
