mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-09 17:19:47 +03:00
[FIX] Названия хандлеров в LauncherNettyServer, удаление лишнего API.
This commit is contained in:
parent
6af7283b60
commit
50d5c941f4
2 changed files with 6 additions and 8 deletions
|
@ -56,15 +56,15 @@ public void initChannel(SocketChannel ch) {
|
||||||
ChannelPipeline pipeline = ch.pipeline();
|
ChannelPipeline pipeline = ch.pipeline();
|
||||||
NettyConnectContext context = new NettyConnectContext();
|
NettyConnectContext context = new NettyConnectContext();
|
||||||
//p.addLast(new LoggingHandler(LogLevel.INFO));
|
//p.addLast(new LoggingHandler(LogLevel.INFO));
|
||||||
pipeline.addLast(new HttpServerCodec());
|
pipeline.addLast("httpc", new HttpServerCodec());
|
||||||
pipeline.addLast(new HttpObjectAggregator(65536));
|
pipeline.addLast("httpca",new HttpObjectAggregator(65536));
|
||||||
if (server.config.netty.ipForwarding)
|
if (server.config.netty.ipForwarding)
|
||||||
pipeline.addLast(new NettyIpForwardHandler(context));
|
pipeline.addLast("forward", new NettyIpForwardHandler(context));
|
||||||
pipeline.addLast(new WebSocketServerCompressionHandler());
|
pipeline.addLast("decomp", new WebSocketServerCompressionHandler());
|
||||||
pipeline.addLast(new WebSocketServerProtocolHandler(WEBSOCKET_PATH, null, true));
|
pipeline.addLast("decoder", new WebSocketServerProtocolHandler(WEBSOCKET_PATH, null, true));
|
||||||
if (server.config.netty.fileServerEnabled)
|
if (server.config.netty.fileServerEnabled)
|
||||||
pipeline.addLast(new FileServerHandler(server.updatesDir, true, config.showHiddenFiles));
|
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);
|
pipelineHook.hook(context, ch);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
public class WebSocketService {
|
public class WebSocketService {
|
||||||
public final ChannelGroup channels;
|
public final ChannelGroup channels;
|
||||||
public static ProviderMap<WebSocketServerResponse> providers = new ProviderMap<>();
|
public static ProviderMap<WebSocketServerResponse> providers = new ProviderMap<>();
|
||||||
public final BiHookSet<TextWebSocketFrame, ChannelHandlerContext> packetHook = new BiHookSet<>();
|
|
||||||
public static class WebSocketRequestContext
|
public static class WebSocketRequestContext
|
||||||
{
|
{
|
||||||
public WebSocketServerResponse response;
|
public WebSocketServerResponse response;
|
||||||
|
@ -65,7 +64,6 @@ public WebSocketService(ChannelGroup channels, LaunchServer server) {
|
||||||
private final Gson gson;
|
private final Gson gson;
|
||||||
|
|
||||||
public void process(ChannelHandlerContext ctx, TextWebSocketFrame frame, Client client, String ip) {
|
public void process(ChannelHandlerContext ctx, TextWebSocketFrame frame, Client client, String ip) {
|
||||||
if (packetHook.hook(frame, ctx)) return;
|
|
||||||
String request = frame.text();
|
String request = frame.text();
|
||||||
WebSocketServerResponse response = gson.fromJson(request, WebSocketServerResponse.class);
|
WebSocketServerResponse response = gson.fromJson(request, WebSocketServerResponse.class);
|
||||||
process(ctx, response, client, ip);
|
process(ctx, response, client, ip);
|
||||||
|
|
Loading…
Reference in a new issue