@Override public void handleInput(Document data, PacketSender packetSender) { AuthLoginResult authLoginResult = data.getObject("result", AuthLoginResult.class); handleResult(authLoginResult); }
@Override public void handleInput(Document data, PacketSender packetSender) { Auth auth = data.getObject("auth", new TypeToken<Auth>() { }.getType()); handleAuth(auth, auth.getType(), auth.getAuthData(), packetSender); }
this.channel = bootstrap.connect(connectableAddress.getHostName(), connectableAddress.getPort()).sync().channel().writeAndFlush(new PacketOutAuth(auth)).syncUninterruptibly().channel();
client.getChannel().writeAndFlush(new PacketOutAuthResult(new AuthLoginResult(true))).syncUninterruptibly(); channel.pipeline().addLast( new CloudNetClient(cn, channel) } else client.getChannel().writeAndFlush(new PacketOutAuthResult(new AuthLoginResult(false))).syncUninterruptibly(); CloudNet.getLogger().info("Authentication failed [" + (wrapperKey != null ? "Invalid WrapperKey or Wrapper is already connected!" : "WrapperKey not found, please copy a wrapper key to this instance") + "]"); client.getChannel().writeAndFlush(new PacketOutAuthResult(new AuthLoginResult(false))).syncUninterruptibly();