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);
}
}
Aggregations