From a6686029a5fd3ea2d487003bce3479c0e2e525f3 Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 28 Jan 2019 21:16:11 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=B2=D0=B8=D0=BB=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=B7=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../socket/websocket/json/auth/AuthResponse.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 e49c887f..b1280931 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 @@ -39,7 +39,7 @@ public AuthResponse(String login, String password, int authid, OshiHWID hwid) { public OshiHWID hwid; public enum ConnectTypes { - SERVER,CLIENT + SERVER,CLIENT,BOT } @Override @@ -56,10 +56,19 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client AuthProvider.authError(LaunchServer.server.config.authRejectString); return; } - if (authType == ConnectTypes.SERVER &&!clientData.checkSign) { + if (authType != ConnectTypes.CLIENT &&!clientData.checkSign) { AuthProvider.authError("Don't skip Launcher Update"); return; } + clientData.permissions = LaunchServer.server.config.permissionsHandler.getPermissions(login); + if(authType == ConnectTypes.BOT && !clientData.permissions.canBot) + { + AuthProvider.authError("authType: BOT not allowed for this account"); + } + if(authType == ConnectTypes.SERVER && !clientData.permissions.canServer) + { + AuthProvider.authError("authType: SERVER not allowed for this account"); + } ru.gravit.launchserver.response.auth.AuthResponse.AuthContext context = new ru.gravit.launchserver.response.auth.AuthResponse.AuthContext(0, login, password.length(), client, null, false); AuthProvider provider = LaunchServer.server.config.authProvider[authid]; LaunchServer.server.authHookManager.preHook(context, clientData);