Examples of PlayerInfo


Examples of net.sourceforge.queried.PlayerInfo

      for (int x = 1; x < plyrs.length; x++) {
        String plyr = plyrs[x];
        String score = plyr.substring(0, plyr.indexOf(" "));
        String name = plyr.substring(plyr.lastIndexOf(" "));

        PlayerInfo player = new PlayerInfo();
        player.setKills(Integer.valueOf(score).intValue());
        player.setName(name);
        playerInfo.add(player);
      }
      Collections.sort(playerInfo, new ScoreComparator());
    }
View Full Code Here

Examples of net.sourceforge.queried.PlayerInfo

    Pattern playerPattern = Pattern.compile("(.)(.)\\x00(.{2})\\x00\\x00([\\w\\s/\\x19-\\x2f\\x51-\\x5e\\x7d\\x7b@!:~_]+)\\x00?([\\w\\s/\\x19-\\x2f\\x51-\\x5e\\x7d\\x7b@!:~_]+|\\x00?)");
    Matcher m = playerPattern.matcher(plyrs);

    while (m.find()) {
      PlayerInfo player = new PlayerInfo();

      byte[] rawPing = m.group(2).getBytes();
      if (rawPing.length > 1) {
        player.setPing(PosInt(rawPing[0]) + PosInt(rawPing[1]));
      } else if (rawPing.length > 0) {
        player.setPing(PosInt(rawPing[0]));
      } else {
        player.setPing(0);
      }
      byte[] rawRate = m.group(3).getBytes();
      if (rawRate.length > 1) {
        player.setRate(PosInt(rawRate[0]) + PosInt(rawRate[1]));
      } else if (rawRate.length > 0) {
        player.setRate(PosInt(rawRate[0]));
      } else {
        player.setRate(15000); // that's probably what it is anyway :-(
      }

      player.setName("\"" + m.group(4) + "\"");

      if (m.group(5).hashCode() != 0) {
        player.setClan("\"" + m.group(5) + "\"");
      } else {
        player.setClan("");
      }

      playerInfo.add(player);
      // testing
      // System.out.println(m.group(4) + " : " + m.group(5).hashCode());
View Full Code Here

Examples of net.sourceforge.queried.PlayerInfo

    if (recStr != null && recStr.length() > 0) {
      String[] plyrs = recStr.split("deaths_");
      for (int x = 1; x < plyrs.length; x++) {
        String plyrLine = "\\deaths_" + plyrs[x];

        PlayerInfo player = new PlayerInfo();
        player.setDeaths(Integer.valueOf(Util.getPart(plyrLine, "deaths_" + (x - 1))).intValue());
        player.setKills(Integer.valueOf(Util.getPart(plyrLine, "kills_" + (x - 1))).intValue());
        player.setName(Util.getPart(plyrLine, "playername_" + (x - 1)));
        player.setScore(Integer.valueOf(Util.getPart(plyrLine, "score_" + (x - 1))).intValue());
        playerInfo.add(player);
      }
      Collections.sort(playerInfo, new ScoreComparator());
    }
    return playerInfo;
View Full Code Here

Examples of net.sourceforge.queried.PlayerInfo

      for (String plyr : plyrs) {
        String score = plyr.substring(0, plyr.indexOf(" ")).trim();
        String whatsit = plyr.substring(plyr.indexOf(" "), plyr.lastIndexOf(" ")).trim();
        String name = plyr.substring(plyr.indexOf("\"") + 1, plyr.lastIndexOf("\"")).trim();
        PlayerInfo player = new PlayerInfo();

        player.setKills(Integer.valueOf(score).intValue());
        player.setName(name);
        player.setScore(Integer.valueOf(whatsit).intValue());
        playerInfo.add(player);

      }
      Collections.sort(playerInfo, new ScoreComparator());
View Full Code Here

Examples of net.sourceforge.queried.PlayerInfo

    String[] skills = assembleParts(recStr, "skill_");

    try {
      for (int i = 0; i < players.length; i++) {
        PlayerInfo player = new PlayerInfo();
        // name
        player.setName(players[i]);
        // score
        player.setScore(Integer.valueOf(scores[i]).intValue());
        // deaths
        player.setDeaths(Integer.valueOf(deaths[i]).intValue());
        // kills
        player.setKills(Integer.valueOf(skills[i]).intValue());
        playerInfo.add(player);
      }
    } catch (ArrayIndexOutOfBoundsException aiex) {
      // was time to break out - end of getting correct info
    } catch (NumberFormatException nfex) {
View Full Code Here

Examples of net.sourceforge.queried.PlayerInfo

    if (recStr != null && recStr.length() > 0) {
      String[] plyrs = recStr.split("player_");
      for (int x = 1; x < plyrs.length; x++) {
        String plyrLine = "\\player_" + plyrs[x];

        PlayerInfo player = new PlayerInfo();
        player.setName(Util.getPart(plyrLine, "player_" + (x - 1)));
        player.setKills(Integer.valueOf(Util.getPart(plyrLine, "frags_" + (x - 1))).intValue());
        playerInfo.add(player);
      }
      Collections.sort(playerInfo, new ScoreComparator());
    }
    return playerInfo;
View Full Code Here

Examples of net.sourceforge.queried.PlayerInfo

      for (int x = 1; x < plyrs.length; x++) {
        String plyr = plyrs[x];
        String score = plyr.substring(0, plyr.indexOf(" "));
        String name = plyr.substring(plyr.lastIndexOf(" "));

        PlayerInfo player = new PlayerInfo();
        player.setKills(Integer.valueOf(score).intValue());
        player.setName(name);
        playerInfo.add(player);
      }
      Collections.sort(playerInfo, new ScoreComparator());
    }
View Full Code Here

Examples of net.sourceforge.queried.PlayerInfo

    ArrayList<PlayerInfo> playerInfo = new ArrayList<PlayerInfo>();
    String[] pieces = stripped.split(chr + "");
    for (int i = 0; i < pieces.length; i++) {
//            System.out.println("piece["+ i +"]: "+ pieces[i]);
      PlayerInfo player = new PlayerInfo();
      // name
      player.setName(pieces[i++]);
      // score
      player.setScore(Integer.valueOf(pieces[i++]).intValue());
      // deaths
      player.setDeaths(Integer.valueOf(pieces[i++]).intValue());
      // team
      i++;
      // ping
      i++;
      // kills
      player.setKills(Integer.valueOf(pieces[i]).intValue());
      playerInfo.add(player);
    }
    Collections.sort(playerInfo, new ScoreComparator());

    return playerInfo;
View Full Code Here

Examples of net.yura.lobby.model.PlayerInfo

    boolean edit=false;

    for (int c=0;c<list.size();c++) {

      PlayerInfo playerInfo = (PlayerInfo)list.get(c);

      panel.add(new JLabel(playerInfo.getLabel()));

      if (playerInfo.getCanEdit()) {

        panel.add(new JTextField(playerInfo.getInfo()));
        edit = true;
      }
      else {
        panel.add(new JLabel(playerInfo.getInfo()));
       
      }


    }
View Full Code Here

Examples of net.yura.lobby.model.PlayerInfo

      List list = new Vector();


      for (int c=0;c<playerInfoObjects.size();c++) {

        PlayerInfo playerInfo = (PlayerInfo)playerInfoObjects.get(c);

        if (playerInfo.getCanEdit()) {

          Component component = panel.getComponent(((c+1)*2)-1);

          if (component instanceof JTextComponent) {

            playerInfo.setInfo( ((JTextComponent)component).getText() );

          }
          // SO FAR THIS IS THE ONLY TYPE WE KNOW ABOUT

          list.add(playerInfo);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.