Search in sources :

Example 1 with RconServer

use of net.glowstone.net.rcon.RconServer in project Glowstone by GlowstoneMC.

the class GlowServer method bind.

private void bind() {
    if (Epoll.isAvailable()) {
        logger.info("Native epoll transport is enabled.");
    }
    CountDownLatch latch = new CountDownLatch(3);
    networkServer = new GameServer(this, latch);
    networkServer.bind(getBindAddress(Key.SERVER_PORT));
    if (config.getBoolean(Key.QUERY_ENABLED)) {
        queryServer = new QueryServer(this, latch, config.getBoolean(Key.QUERY_PLUGINS));
        queryServer.bind(getBindAddress(Key.QUERY_PORT));
    } else {
        latch.countDown();
    }
    if (config.getBoolean(Key.RCON_ENABLED)) {
        rconServer = new RconServer(this, latch, config.getString(Key.RCON_PASSWORD));
        rconServer.bind(getBindAddress(Key.RCON_PORT));
    } else {
        latch.countDown();
    }
    try {
        latch.await();
    } catch (InterruptedException e) {
        logger.log(Level.SEVERE, "Bind interrupted! ", e);
        System.exit(1);
    }
}
Also used : QueryServer(net.glowstone.net.query.QueryServer) RconServer(net.glowstone.net.rcon.RconServer) CountDownLatch(java.util.concurrent.CountDownLatch) GameServer(net.glowstone.net.GameServer)

Aggregations

CountDownLatch (java.util.concurrent.CountDownLatch)1 GameServer (net.glowstone.net.GameServer)1 QueryServer (net.glowstone.net.query.QueryServer)1 RconServer (net.glowstone.net.rcon.RconServer)1