File tree Expand file tree Collapse file tree
spigot/src/main/java/org/geysermc/floodgate/inject/spigot Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,16 +110,19 @@ public void injectClient(ChannelFuture future) {
110110 future .channel ().pipeline ().addFirst ("floodgate-init" , new ChannelInboundHandlerAdapter () {
111111 @ Override
112112 public void channelRead (ChannelHandlerContext ctx , Object msg ) throws Exception {
113- super .channelRead (ctx , msg );
114-
115113 Channel channel = (Channel ) msg ;
116- channel .pipeline ().addLast (new ChannelInitializer <Channel >() {
114+ // add first worked as well
115+ channel .pipeline ().addLast ("floodgate-injector" , new ChannelInboundHandlerAdapter () {
117116 @ Override
118- protected void initChannel (Channel channel ) {
119- injectAddonsCall (channel , false );
120- addInjectedClient (channel );
117+ public void channelActive (ChannelHandlerContext childCtx ) throws Exception {
118+ injectAddonsCall (childCtx .channel (), false );
119+ addInjectedClient (childCtx .channel ());
120+ childCtx .pipeline ().remove (this );
121+ super .channelActive (childCtx );
121122 }
122123 });
124+
125+ super .channelRead (ctx , msg );
123126 }
124127 });
125128 }
You can’t perform that action at this time.
0 commit comments