@Inject(method = "processHandshake", at = @At(value = "HEAD"), cancellable = true) private void onProcessHandshake(C00Handshake packetIn, CallbackInfo ci) { if (packetIn.getRequestedState().equals(EnumConnectionState.LOGIN)) { final String[] split = packetIn.ip.split("\00"); if (split.length >= 3) { packetIn.ip = split[0]; ((IMixinNetworkManager_Bungee) this.networkManager).setRemoteAddress(new InetSocketAddress(split[1], ((InetSocketAddress) this.networkManager.getRemoteAddress()).getPort())); ((IMixinNetworkManager_Bungee) this.networkManager).setSpoofedUUID(UUIDTypeAdapter.fromString(split[2])); if (split.length == 4) { ((IMixinNetworkManager_Bungee) this.networkManager).setSpoofedProfile(GSON.fromJson(split[3], Property[].class)); } } else { final ChatComponentText chatcomponenttext = new ChatComponentText("If you wish to use IP forwarding, please enable it in your BungeeCord config as well!"); this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext)); this.networkManager.closeChannel(chatcomponenttext); } } }
public void closeConnection(String reason) { try { logger.info("Disconnecting " + this.getConnectionInfo() + ": " + reason); ChatComponentText chatcomponenttext = new ChatComponentText(reason); this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext)); this.networkManager.closeChannel(chatcomponenttext); } catch (Exception exception) { logger.error((String)"Error whilst disconnecting player", (Throwable)exception); } }
/** * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention * must pass a versioncheck or receive a disconnect otherwise */ public void processHandshake(C00Handshake packetIn) { switch (packetIn.getRequestedState()) { case LOGIN: this.networkManager.setConnectionState(EnumConnectionState.LOGIN); if (packetIn.getProtocolVersion() > 47) { ChatComponentText chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.8.8"); this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext)); this.networkManager.closeChannel(chatcomponenttext); } else if (packetIn.getProtocolVersion() < 47) { ChatComponentText chatcomponenttext1 = new ChatComponentText("Outdated client! Please use 1.8.8"); this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext1)); this.networkManager.closeChannel(chatcomponenttext1); } else { this.networkManager.setNetHandler(new NetHandlerLoginServer(this.server, this.networkManager)); } break; case STATUS: this.networkManager.setConnectionState(EnumConnectionState.STATUS); this.networkManager.setNetHandler(new NetHandlerStatusServer(this.server, this.networkManager)); break; default: throw new UnsupportedOperationException("Invalid intention " + packetIn.getRequestedState()); } }
public void func_147322_a(String p_147322_1_) { try { logger.info("Disconnecting " + this.func_147317_d() + ": " + p_147322_1_); ChatComponentText var2 = new ChatComponentText(p_147322_1_); this.field_147333_a.scheduleOutboundPacket(new S00PacketDisconnect(var2), new GenericFutureListener[0]); this.field_147333_a.closeChannel(var2); } catch (Exception var3) { logger.error("Error whilst disconnecting player", var3); } }
/** * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention * must pass a versioncheck or receive a disconnect otherwise */ public void processHandshake(C00Handshake p_147383_1_) { switch (NetHandlerHandshakeTCP.SwitchEnumConnectionState.field_151291_a[p_147383_1_.func_149594_c().ordinal()]) { case 1: this.field_147386_b.setConnectionState(EnumConnectionState.LOGIN); ChatComponentText var2; if (p_147383_1_.func_149595_d() > 4) { var2 = new ChatComponentText("Outdated server! I\'m still on 1.7.2"); this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(var2), new GenericFutureListener[0]); this.field_147386_b.closeChannel(var2); } else if (p_147383_1_.func_149595_d() < 4) { var2 = new ChatComponentText("Outdated client! Please use 1.7.2"); this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(var2), new GenericFutureListener[0]); this.field_147386_b.closeChannel(var2); } else { this.field_147386_b.setNetHandler(new NetHandlerLoginServer(this.field_147387_a, this.field_147386_b)); } break; case 2: this.field_147386_b.setConnectionState(EnumConnectionState.STATUS); this.field_147386_b.setNetHandler(new NetHandlerStatusServer(this.field_147387_a, this.field_147386_b)); break; default: throw new UnsupportedOperationException("Invalid intention " + p_147383_1_.func_149594_c()); } }
public void func_147322_a(String p_147322_1_) { try { logger.info("Disconnecting " + this.func_147317_d() + ": " + p_147322_1_); ChatComponentText chatcomponenttext = new ChatComponentText(p_147322_1_); this.field_147333_a.scheduleOutboundPacket(new S00PacketDisconnect(chatcomponenttext), new GenericFutureListener[0]); this.field_147333_a.closeChannel(chatcomponenttext); } catch (Exception exception) { logger.error("Error whilst disconnecting player", exception); } }
@Override protected void channelRead0(ChannelHandlerContext ctx, C00Handshake packet) throws Exception { if(!NettyChannelInitializer.serverStarting){ ctx.fireChannelRead(packet); ctx.pipeline().remove(this); }else{ ctx.writeAndFlush(new S00PacketDisconnect(new ChatComponentText("Server is still starting! Please wait before connecting!"))).addListener(ChannelFutureListener.CLOSE); } }
public void handleDisconnect(S00PacketDisconnect packetIn) { this.networkManager.closeChannel(packetIn.func_149603_c()); }
public void handleDisconnect(S00PacketDisconnect p_147388_1_) { this.field_147393_d.closeChannel(p_147388_1_.func_149603_c()); }
void handleDisconnect(S00PacketDisconnect packetIn);
void handleDisconnect(S00PacketDisconnect var1);
void handleDisconnect(S00PacketDisconnect p_147388_1_);