/** * Adds a channel that listens locally */ public SocketAddress addLocalEndpoint() { ChannelFuture channelfuture; synchronized (this.endpoints) { channelfuture = ((ServerBootstrap)((ServerBootstrap)(new ServerBootstrap()).channel(LocalServerChannel.class)).childHandler(new ChannelInitializer<Channel>() { protected void initChannel(Channel p_initChannel_1_) throws Exception { NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.SERVERBOUND); networkmanager.setNetHandler(new NetHandlerHandshakeMemory(NetworkSystem.this.mcServer, networkmanager)); NetworkSystem.this.networkManagers.add(networkmanager); p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); } }).group((EventLoopGroup)eventLoops.getValue()).localAddress(LocalAddress.ANY)).bind().syncUninterruptibly(); this.endpoints.add(channelfuture); } return channelfuture.channel().localAddress(); }
/** * Adds a channel that listens locally */ public SocketAddress addLocalEndpoint() { ChannelFuture channelfuture; synchronized (this.endpoints) { channelfuture = ((ServerBootstrap)((ServerBootstrap)(new ServerBootstrap()).channel(LocalServerChannel.class)).childHandler(new ChannelInitializer<Channel>() { protected void initChannel(Channel p_initChannel_1_) throws Exception { NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.SERVERBOUND); networkmanager.setNetHandler(new NetHandlerHandshakeMemory(NetworkSystem.this.mcServer, networkmanager)); NetworkSystem.this.networkManagers.add(networkmanager); p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); } }).group((EventLoopGroup)SERVER_NIO_EVENTLOOP.getValue()).localAddress(LocalAddress.ANY)).bind().syncUninterruptibly(); this.endpoints.add(channelfuture); } return channelfuture.channel().localAddress(); }
/** * Adds a channel that listens locally */ @SideOnly(Side.CLIENT) public SocketAddress addLocalEndpoint() { ChannelFuture channelfuture; synchronized (this.endpoints) { channelfuture = ((ServerBootstrap)((ServerBootstrap)(new ServerBootstrap()).channel(LocalServerChannel.class)).childHandler(new ChannelInitializer<Channel>() { protected void initChannel(Channel p_initChannel_1_) throws Exception { NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.SERVERBOUND); networkmanager.setNetHandler(new NetHandlerHandshakeMemory(NetworkSystem.this.mcServer, networkmanager)); NetworkSystem.this.networkManagers.add(networkmanager); p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); } }).group((EventLoopGroup)SERVER_NIO_EVENTLOOP.getValue()).localAddress(LocalAddress.ANY)).bind().syncUninterruptibly(); this.endpoints.add(channelfuture); } return channelfuture.channel().localAddress(); }
@SideOnly(Side.CLIENT) public SocketAddress addLocalEndpoint() { List list = this.endpoints; ChannelFuture channelfuture; synchronized (this.endpoints) { channelfuture = ((ServerBootstrap)((ServerBootstrap)(new ServerBootstrap()).channel(LocalServerChannel.class)).childHandler(new ChannelInitializer() { private static final String __OBFID = "CL_00001449"; protected void initChannel(Channel p_initChannel_1_) { NetworkManager networkmanager = new NetworkManager(false); networkmanager.setNetHandler(new NetHandlerHandshakeMemory(NetworkSystem.this.mcServer, networkmanager)); NetworkSystem.this.networkManagers.add(networkmanager); p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager); } }).group(eventLoops).localAddress(LocalAddress.ANY)).bind().syncUninterruptibly(); this.endpoints.add(channelfuture); } return channelfuture.channel().localAddress(); }