Exemple #1
0
  public static void main(String[] args) {
    Runtime.getRuntime()
        .addShutdownHook(
            new Thread() {
              public void run() {
                DarkOrbit.closeServers();
              }
            });
    System.out.println("#========================= #");
    System.out.println("# DarkOrbit v" + VERSION + "\t #");
    System.out.println("# Creadopor:Elieaz Neor1326#");
    System.out.println("# [email protected]           #");
    System.out.println("#========================= #");
    System.out.println("Cargando configuracion:");
    cargarConfiguracion();
    isInit = true;
    System.out.println("Cargado con exito!");
    System.out.println("Conexion con la Base de datos...");
    if (SQLManager.setUpConnexion()) System.out.println("Conectado!");
    else {
      System.out.println("Conexion invalida");
      DarkOrbit.closeServers();
      System.exit(0);
    }

    System.out.println("Creando DarkOrbit...");
    long startTime = System.currentTimeMillis();
    // Start Policy Server
    System.out.println("Creando Policy Server...");
    policyServer = new PolicyServer(_this);
    World.createWorld();
    long endTime = System.currentTimeMillis();
    long differenceTime = (endTime - startTime) / 1000;
    System.out.println("Creado con exito ! en : " + differenceTime + " s");
    isRunning = true;
    String Ip = "";
    try {
      Ip = InetAddress.getLocalHost().getHostAddress();
    } catch (Exception e) {
      System.out.println(e.getMessage());
      try {
        Thread.sleep(10000);
      } catch (InterruptedException e1) {
      }
      System.exit(1);
    }
    Ip = IP;
    gameServer = new GameServer(Ip);
    System.out.println("Servidor del juego lanzado en el puerto " + CONFIG_GAME_PORT);
    chatServer = new ChatServer(Ip);
    System.out.println("Servidor del chat lanzado en el puerto " + CONFIG_CHAT_PORT);
    logServer = new SOSLoggingServer(Ip);
    System.out.println("Servidor de Logs lanzado en el puerto " + CONFIG_LOG_PORT);
    if (CONFIG_USE_IP)
      System.out.println("IP del servidor " + IP + " encriptada: " + GAMESERVER_IP);

    System.out.println("Esperando conexiones...");
    System.out.println("Visit http://mycom69.tk");
  }