Package net.sourceforge.queried

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


    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

    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

      ArrayList<PlayerInfo> sorted = new ArrayList<PlayerInfo>();
      int playerCount = buf[5] & 255;
      int off = 6;
      for (int i = 0; i < playerCount; ++i) {
        PlayerInfo playerInfo = new PlayerInfo();
        StringBuffer playerName = new StringBuffer(20);
        while (buf[off] != 0) {
          playerName.append((char) (buf[off++] & 255));
        }
        off++;
        playerInfo.setName(playerName.toString().trim());
        playerInfo.setKills((buf[off] & 255) | ((buf[off + 1] & 255) << 8) |
                ((buf[off + 2] & 255) << 16) | ((buf[off + 3] & 255) << 24));
        sorted.add(playerInfo);
        off += 8;
      }
      Collections.sort(sorted, new KillsComparator());
View Full Code Here

      }
      offsetHolder[0]++;

      // loop through the players
      while (offsetHolder[0] < queryResult.length()) {
        PlayerInfo player = new PlayerInfo();

        getInt(queryResult, offsetHolder); // ignore player id
        player.setName(getString(queryResult, offsetHolder)); // player name
        getInt(queryResult, offsetHolder); // ignore player ping
        player.setScore(getInt(queryResult, offsetHolder)); // player score
        getInt(queryResult, offsetHolder); // ignore player stats id

        playerInfo.add(player);
      }
    } catch (StringIndexOutOfBoundsException e) {
View Full Code Here

    String stripped = recStr.substring(start, end);
    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();
      // leader
      int leader = Integer.parseInt(pieces[i++]);
      // goal
      int goal = Integer.parseInt(pieces[i++]);
      player.setScore(leader + goal);
      // honor
      i++;
      // name
      player.setName(pieces[i++]);
      // ping
      i++;
      // roe
      i++;
      // kia
      player.setDeaths(Integer.parseInt(pieces[i++]));
      // enemy
      player.setKills(Integer.parseInt(pieces[i]));
      playerInfo.add(player);
    }
    Collections.sort(playerInfo, new ScoreComparator());

    return playerInfo;
View Full Code Here

TOP

Related Classes of net.sourceforge.queried.PlayerInfo

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.