[FIX] Названия хандлеров в LauncherNettyServer, удаление лишнего API.

This commit is contained in:
zaxar163 2019-09-28 20:05:03 +03:00
parent 6af7283b60
commit 50d5c941f4
2 changed files with 6 additions and 8 deletions

View file

@ -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);
}
});

View file

@ -37,7 +37,6 @@
public class WebSocketService {
public final ChannelGroup channels;
public static ProviderMap<WebSocketServerResponse> providers = new ProviderMap<>();
public final BiHookSet<TextWebSocketFrame, ChannelHandlerContext> 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);