From 50d5c941f42aa4606ea5871b7cbb56f64f23bcde Mon Sep 17 00:00:00 2001 From: zaxar163 Date: Sat, 28 Sep 2019 20:05:03 +0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=9D=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=85=D0=B0=D0=BD=D0=B4=D0=BB=D0=B5=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B2=20LauncherNettyServer,=20=D1=83=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B5?= =?UTF-8?q?=D0=B3=D0=BE=20API.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launchserver/socket/LauncherNettyServer.java | 12 ++++++------ .../gravit/launchserver/socket/WebSocketService.java | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/LauncherNettyServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/LauncherNettyServer.java index e95fa544..e0906254 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/LauncherNettyServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/LauncherNettyServer.java @@ -56,15 +56,15 @@ public void initChannel(SocketChannel ch) { ChannelPipeline pipeline = ch.pipeline(); NettyConnectContext context = new NettyConnectContext(); //p.addLast(new LoggingHandler(LogLevel.INFO)); - pipeline.addLast(new HttpServerCodec()); - pipeline.addLast(new HttpObjectAggregator(65536)); + pipeline.addLast("httpc", new HttpServerCodec()); + pipeline.addLast("httpca",new HttpObjectAggregator(65536)); if (server.config.netty.ipForwarding) - pipeline.addLast(new NettyIpForwardHandler(context)); - pipeline.addLast(new WebSocketServerCompressionHandler()); - pipeline.addLast(new WebSocketServerProtocolHandler(WEBSOCKET_PATH, null, true)); + pipeline.addLast("forward", new NettyIpForwardHandler(context)); + pipeline.addLast("decomp", new WebSocketServerCompressionHandler()); + pipeline.addLast("decoder", new WebSocketServerProtocolHandler(WEBSOCKET_PATH, null, true)); if (server.config.netty.fileServerEnabled) pipeline.addLast(new FileServerHandler(server.updatesDir, true, config.showHiddenFiles)); - pipeline.addLast(new WebSocketFrameHandler(context, server, service)); + pipeline.addLast("final", new WebSocketFrameHandler(context, server, service)); pipelineHook.hook(context, ch); } }); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java index ec7c74f6..6749d352 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java @@ -37,7 +37,6 @@ public class WebSocketService { public final ChannelGroup channels; public static ProviderMap providers = new ProviderMap<>(); - public final BiHookSet packetHook = new BiHookSet<>(); public static class WebSocketRequestContext { public WebSocketServerResponse response; @@ -65,7 +64,6 @@ public WebSocketService(ChannelGroup channels, LaunchServer server) { private final Gson gson; public void process(ChannelHandlerContext ctx, TextWebSocketFrame frame, Client client, String ip) { - if (packetHook.hook(frame, ctx)) return; String request = frame.text(); WebSocketServerResponse response = gson.fromJson(request, WebSocketServerResponse.class); process(ctx, response, client, ip);