mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +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();
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue