Beispiel #1
0
 /**
  * This method is used to display debugging messages with formatted output.
  *
  * @param msg the debug message to display
  */
 public void debug(String msg) {
   if (options.getBoolean("bc.server.debug")) {
     for (String line : msg.split("\n")) {
       System.out.printf("[server:debug] %s\n", line);
     }
   }
 }
Beispiel #2
0
  /**
   * Initializes a new server.
   *
   * @param options the configuration to use
   * @param mode the mode to run the server in
   * @param proxies the proxies to send messages to
   */
  public Server(Config options, Mode mode, Proxy... proxies) {
    this.matches = new ArrayDeque<>();
    this.finished = new ArrayDeque<>();

    this.mode = mode;

    this.proxyWriter = new ProxyWriter(proxies, options.getBoolean("bc.server.debug"));

    this.options = options;
    this.state = State.NOT_READY;
  }