Beispiel #1
0
  private void setIrcMessageSender() {
    short commandDelayTime = Short.parseShort(Configuration.get("aibo.command_delay_time"));
    short maxCommandsPerTime = Short.parseShort(Configuration.get("aibo.max_commands_per_time"));

    this.ircNetwork.getMessageSender().setCommandDelayTime(commandDelayTime);
    this.ircNetwork.getMessageSender().setMaxCommandsPerTime(maxCommandsPerTime);
  }
Beispiel #2
0
 private void setUpDatabase() {
   DatabaseProvider.setDatabaseProvider(Configuration.get("aibo.database.provider"));
   DatabaseProvider.setCredentials(
       Configuration.get("aibo.database.host"),
       Configuration.get("aibo.database.username"),
       Configuration.get("aibo.database.password"),
       Configuration.get("aibo.database.name"));
 }
Beispiel #3
0
  private void setUpDataServer() {
    if (Configuration.getBoolean("data_server")) {
      try {
        int listenPort = Integer.parseInt(Configuration.get("data_server.listen_port"));
        String listenAddress = Configuration.get("data_server.listen_ip");
        boolean isDebug = Configuration.getBoolean("network.debug");

        new Thread(new DataServer(listenAddress, listenPort, this.taskManager, isDebug)).start();
      } catch (NumberFormatException e) {
        e.printStackTrace();
      }
    }
  }
Beispiel #4
0
  public AIBO() {
    AIBO.startDateTime = new GregorianCalendar();

    this.setUpDatabase();

    this.ircNetwork =
        new IrcNetwork(
            Configuration.get("IrcConnection.host").split(" "),
            Integer.parseInt(Configuration.get("IrcConnection.port")),
            this);

    this.setIrcMessageSender();

    this.taskManager = new TaskManager(this.ircNetwork.getMessageSender());

    this.setUpDataServer();

    this.printAPIVersion();
  }