示例#1
0
  @Override
  public void visitGameNotification(GameNotification n) {
    synchronized (matches) {
      if (!matches.isEmpty()) {
        return;
      }
    }

    try {
      GameInfo info = n.getInfo();

      int matchCount = info.getMaps().length;
      int matchNumber = 0;
      for (String map : info.getMaps()) {
        if (map.endsWith(".xml")) map = map.substring(0, map.indexOf('.'));
        Match match = new Match(info, map, options, matchNumber++, matchCount);
        debug("queuing match " + match);
        matches.add(match);
      }
    } catch (Exception e) {
      e.printStackTrace();
      fail("couldn't start the match: " + e.getMessage());
    }
  }