Example #1
0
  private void shutdown() {
    game.setGameState(GameThread.STATE_STOPPED);

    try {
      /* Close the socket so the listener thread will stop blocking */
      socket.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
Example #2
0
  private void startup() {
    setName("Dedicated Server");
    running = true;

    graphics.core.Model.loadModels();

    try {
      socket = new ServerSocket(SERVER_PORT);
    } catch (IOException e) {
      System.out.println("Could not listen on port: " + SERVER_PORT);
      System.exit(-1);
    }

    loadMap("example_1");

    game = new GameMultiThread(actors);
    game.start();

    new ListenerThread(socket, this).start();
  }