}
final Game game = target.getGame();
if (null == game) {
return error(ErrorCode.INVALID_GAME);
}
final Player player = game.getPlayerForUser(target);
if (null == player) {
return error(ErrorCode.INVALID_GAME);
}
final Map<ReturnableData, Object> data = new HashMap<ReturnableData, Object>();
if (user.isAdmin() && args.length == 2) {
// for now only admins can change scores. could possibly extend this to let the host do it,
// provided it's for a player in the same game and it does a gamewide announcement.
try {
final int offset = Integer.parseInt(args[1]);
player.increaseScore(offset);
game.notifyPlayerInfoChange(player);
} catch (final NumberFormatException e) {
return error(ErrorCode.BAD_REQUEST);
}
}