accessToken = accessToken.split("&")[0];
/* get the user of this token */
String username = FacebookHelper.getUsername(accessToken);
Player player = DatastoreHelper.getPlayer(username);
if (player != null) {
DatastoreHelper.updateAccessToken(username, accessToken);
logger.fine("posting score " + player.getHighscore() + " for user " + player.getNickname());
FacebookHelper.postScoreToWall(username, player.getHighscore() + "");
try {
logger.fine("publishing score " + player.getHighscore() + " for user " + player.getNickname());
FacebookHelper.publishScore(player.getHighscore() + "", player.getUserId());
}
catch (RuntimeException e) {
logger.fine("Caught runtime exception while publishing score" + e);
}
}