[FIX] Фикс авторизации сервера 2

This commit is contained in:
Gravit 2019-01-28 21:08:06 +07:00
parent 2937d70866
commit 43de166d22
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -35,9 +35,9 @@ public AuthResponse(String login, String password, int authid, OshiHWID hwid) {
} }
public int authid; public int authid;
public ConnectTypes type; public ConnectTypes authType;
public OshiHWID hwid; public OshiHWID hwid;
enum ConnectTypes public enum ConnectTypes
{ {
SERVER,CLIENT SERVER,CLIENT
} }
@ -56,7 +56,7 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client
AuthProvider.authError(LaunchServer.server.config.authRejectString); AuthProvider.authError(LaunchServer.server.config.authRejectString);
return; return;
} }
if (type == ConnectTypes.SERVER &&!clientData.checkSign) { if (authType == ConnectTypes.SERVER &&!clientData.checkSign) {
AuthProvider.authError("Don't skip Launcher Update"); AuthProvider.authError("Don't skip Launcher Update");
return; return;
} }
@ -81,6 +81,7 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client
throw new AuthException("You profile not found"); throw new AuthException("You profile not found");
} }
UUID uuid = LaunchServer.server.config.authHandler.auth(aresult); UUID uuid = LaunchServer.server.config.authHandler.auth(aresult);
if(authType == ConnectTypes.CLIENT)
LaunchServer.server.config.hwidHandler.check(hwid, aresult.username); LaunchServer.server.config.hwidHandler.check(hwid, aresult.username);
LaunchServer.server.authHookManager.postHook(context, clientData); LaunchServer.server.authHookManager.postHook(context, clientData);
clientData.isAuth = true; clientData.isAuth = true;