package net.glowstone.net.rcon;

import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import java.net.InetSocketAddress;
import java.util.concurrent.CountDownLatch;
import net.glowstone.GlowServer;
import net.glowstone.net.GlowSocketServer;

/**
 * Implementation of a server for the remote console protocol.
 *
 * @see <a href="http://wiki.vg/Rcon">Protocol Specifications</a>
 */
public class RconServer extends GlowSocketServer {

    public RconServer(GlowServer server, CountDownLatch latch, String password) {
        super(server, latch);
        bootstrap.childHandler(new ChannelInitializer<SocketChannel>() {
            @Override
            public void initChannel(SocketChannel ch) throws Exception {
                ch.pipeline()
                    .addLast(new RconFramingHandler())
                    .addLast(new RconHandler(RconServer.this, password));
            }
        });
    }

    /**
     * Bind the server on the specified address.
     *
     * @param address The address.
     * @return Netty channel future for bind operation.
     */
    public ChannelFuture bind(InetSocketAddress address) {
        GlowServer.logger.info("Binding rcon to " + address + "...");
        return super.bind(address);
    }

    @Override
    public void onBindSuccess(InetSocketAddress address) {
        GlowServer.logger.info("Successfully bound rcon to " + address + '.');
        super.onBindSuccess(address);
    }

    @Override
    public void onBindFailure(InetSocketAddress address, Throwable t) {
        GlowServer.logger.warning("Failed to bind rcon to " + address + '.');
    }

    /**
     * Shut the Rcon server down.
     */
    public void shutdown() {
        workerGroup.shutdownGracefully();
        bossGroup.shutdownGracefully();
    }
}

@@ -503,16 +503,286 @@
 rver %7B%0A%0A
+    /**%0A     * Creates an instance.%0A     *%0A     * @param server the associated GlowServer%0A     * @param latch The countdown latch used during server startup to wait for network server%0A     *         binding.%0A     * @param password the remote operator's password%0A     */%0A
     publ
@@ -851,24 +851,24 @@
 password) %7B%0A
-
         supe
@@ -1400,32 +1400,46 @@
 ration.%0A     */%0A
+    @Override%0A
     public Chann
@@ -2004,24 +2004,24 @@
 r down.%0A
-
      */%0A
     publ
@@ -2004,32 +2004,46 @@
 r down.%0A     */%0A
+    @Override%0A
     public void 

Fix CheckStyle issues in net/rcon/RconServer.java (#702)