From 2937d70866391a06f69b85239387260abf4272d7 Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 28 Jan 2019 20:56:20 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A4=D0=B8=D0=BA=D1=81=20=D0=B0=D0=B2?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8=20=D1=81?= =?UTF-8?q?=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=B0=20=D0=B8=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20=D0=BB=D0=B0=D1=83=D0=BD?= =?UTF-8?q?=D1=87=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../socket/websocket/json/auth/AuthResponse.java | 7 ++++++- .../socket/websocket/json/update/LauncherResponse.java | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/AuthResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/AuthResponse.java index bd9df2dd..1238e716 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/AuthResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/AuthResponse.java @@ -35,7 +35,12 @@ public AuthResponse(String login, String password, int authid, OshiHWID hwid) { } public int authid; + public ConnectTypes type; public OshiHWID hwid; + enum ConnectTypes + { + SERVER,CLIENT + } @Override public String getType() { @@ -51,7 +56,7 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client AuthProvider.authError(LaunchServer.server.config.authRejectString); return; } - if (!clientData.checkSign) { + if (type == ConnectTypes.SERVER &&!clientData.checkSign) { AuthProvider.authError("Don't skip Launcher Update"); return; } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/LauncherResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/LauncherResponse.java index 4eab94ae..c026ba28 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/LauncherResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/LauncherResponse.java @@ -31,6 +31,7 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client byte[] hash = LaunchServer.server.launcherBinary.getBytes().getDigest(); if (hash == null) service.sendObjectAndClose(ctx, new Result(true, JAR_URL)); if (Arrays.equals(bytes, hash)) { + client.checkSign = true; service.sendObject(ctx, new Result(false, JAR_URL)); } else { service.sendObjectAndClose(ctx, new Result(true, JAR_URL)); @@ -40,6 +41,7 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client byte[] hash = LaunchServer.server.launcherEXEBinary.getBytes().getDigest(); if (hash == null) service.sendObjectAndClose(ctx, new Result(true, EXE_URL)); if (Arrays.equals(bytes, hash)) { + client.checkSign = true; service.sendObject(ctx, new Result(false, EXE_URL)); } else { service.sendObjectAndClose(ctx, new Result(true, EXE_URL));