Package org.elip.stewiemaze.shared.entities

Examples of org.elip.stewiemaze.shared.entities.Player


  }
 
  public static void validatePlayer(String nickname) {
    nickname = removeSpaces(nickname);
    PersistenceManager pm = PMF.get().getPersistenceManager();
    Player player = getPlayer(nickname);
    player.setActivated("true");
    pm.makePersistent(player);
    pm.close();
  }
View Full Code Here


    List<Player> attachedPlayers = (List<Player>)query.execute();
    List<Player> players = detachList(pm, attachedPlayers);
    if (players != null) { 
      String[] result = new String[players.size()];
      for (int i = 0 ; i < result.length ; i++) {
        Player player = players.get(i);
        if (player.getFacebookUser() != null && player.getFacebookUser().equals("true")) {
          String facebookPhotoElement = "<a href='http://facebook.com/" + player.getUserId() + "' target='_blank'><img src='http://graph.facebook.com/" + player.getUserId() + "/picture'" + "height='50' width='50'/></a>";
          result[i] = (i+1) + ") " + player.getNickname() + " : " + player.getHighscore() + "<br>" + facebookPhotoElement;
        }
        else {
          result[i] = (i+1) + ") " + player.getNickname() + " : " + player.getHighscore();
        }
      }
      pm.close();
      return result;
    }
View Full Code Here

  }

  @SuppressWarnings("unused")
  public static void postScoreToWall(String username, String score) {
   
    Player player = DatastoreHelper.getPlayer(username);
   
    String accessToken = player.getAccessToken();
   
    FacebookClient facebookClient = new DefaultFacebookClient(accessToken);
    FacebookType postScoreToWallResponse = facebookClient.publish("me/feed", FacebookType.class,
        Parameter.with("message", "just scored " + score + " on stewiemaze"));
   
View Full Code Here

TOP

Related Classes of org.elip.stewiemaze.shared.entities.Player

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.