From a38853180b3bf4c1f41ad81e192086c78b3b261c Mon Sep 17 00:00:00 2001 From: zaxar163 Date: Sun, 29 Sep 2019 09:26:04 +0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=94=D1=83=D0=BF=D0=BB=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=D1=82=D1=8B=20=D0=BA=D0=BE=D0=B4=D0=B0=20=D0=B2=20Client?= =?UTF-8?q?Launcher,=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=85=D0=B0=D0=BD=D0=B4=D0=BB=D0=B5=D1=80=D0=BE=D0=B2=20=D0=B2?= =?UTF-8?q?=20LauncherNettyServer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launchserver/socket/LauncherNettyServer.java | 14 +++++++------- .../pro/gravit/launcher/client/ClientLauncher.java | 14 +++----------- modules | 2 +- 3 files changed, 11 insertions(+), 19 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 e0906254..2e9163af 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("httpc", new HttpServerCodec()); - pipeline.addLast("httpca",new HttpObjectAggregator(65536)); + pipeline.addLast("http-codec", new HttpServerCodec()); + pipeline.addLast("http-codec-compressor",new HttpObjectAggregator(65536)); if (server.config.netty.ipForwarding) - pipeline.addLast("forward", new NettyIpForwardHandler(context)); - pipeline.addLast("decomp", new WebSocketServerCompressionHandler()); - pipeline.addLast("decoder", new WebSocketServerProtocolHandler(WEBSOCKET_PATH, null, true)); + pipeline.addLast("forward-http", new NettyIpForwardHandler(context)); + pipeline.addLast("websock-comp", new WebSocketServerCompressionHandler()); + pipeline.addLast("websock-codec", new WebSocketServerProtocolHandler(WEBSOCKET_PATH, null, true)); if (server.config.netty.fileServerEnabled) - pipeline.addLast(new FileServerHandler(server.updatesDir, true, config.showHiddenFiles)); - pipeline.addLast("final", new WebSocketFrameHandler(context, server, service)); + pipeline.addLast("fileserver", new FileServerHandler(server.updatesDir, true, config.showHiddenFiles)); + pipeline.addLast("launchserver", new WebSocketFrameHandler(context, server, service)); pipelineHook.hook(context, ch); } }); diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java index b0f4ba40..97433e2a 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -595,15 +595,11 @@ public static interface ParamsAPI { public static ParamsAPI container = new ParamsAPI() { @Override public ParamContainer read() throws Exception { - ParamContainer p = new ParamContainer(); + ParamContainer p; try (Socket socket = IOHelper.newSocket()) { socket.connect(new InetSocketAddress(SOCKET_HOST, SOCKET_PORT)); try (HInput input = new HInput(socket.getInputStream())) { - p.params = new Params(input); - p.profile = Launcher.gsonManager.gson.fromJson(input.readString(0), ClientProfile.class); - p.assetHDir = new HashedDir(input); - p.clientHDir = new HashedDir(input); - ClientHookManager.paramsInputHook.hook(input); + p = new ParamContainer(input); } } return p; @@ -630,11 +626,7 @@ public void write(ParamContainer p) throws Exception { return; } try (HOutput output = new HOutput(client.getOutputStream())) { - p.params.write(output); - output.writeString(Launcher.gsonManager.gson.toJson(p.profile), 0); - p.assetHDir.write(output); - p.clientHDir.write(output); - ClientHookManager.paramsOutputHook.hook(output); + p.write(output); } clientStarted = true; } diff --git a/modules b/modules index 3e485e5a..3bc733e7 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 3e485e5ae681cd1c136fc25a49d5dd339bc4d30a +Subproject commit 3bc733e724483b064000371fb26bb31c60aa5308