int selectedGameServerPort = selectedGameServer.getHostAndPort().getPort();
// The bytes of the port must be reversed
buffer = buffer.order(ByteOrder.BIG_ENDIAN);
buffer.writeShort(selectedGameServerPort);
buffer = buffer.order(ByteOrder.LITTLE_ENDIAN);
// the GS should pass its public IP when it registers itself to the LS
byte[] ipBytes = selectedGameServer.getHostAndPort().getAddress().getAddress();
LOGGER.info("The Game Server's IP: {}.{}.{}.{}", new Object[] { ipBytes[0] & 0xFF, ipBytes[1] & 0xFF, ipBytes[2] & 0xFF, ipBytes[3] & 0xFF });