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 8d1fafdd..1ede6f4e 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 @@ -99,9 +99,9 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client clientData.profile = p; } } - if (clientData.profile == null) { - throw new AuthException("You profile not found"); - } + //if (clientData.profile == null) { + // throw new AuthException("You profile not found"); + //} UUID uuid = LaunchServer.server.config.authHandler.auth(aresult); if(authType == ConnectTypes.CLIENT) LaunchServer.server.config.hwidHandler.check(hwid, aresult.username); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/ProfilesResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/ProfilesResponse.java index 778b1caa..8e3014d3 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/ProfilesResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/ProfilesResponse.java @@ -18,7 +18,7 @@ public String getType() { @Override public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) throws Exception { - if(!client.isAuth) + if(!client.checkSign) { service.sendObject(ctx, new WebSocketService.ErrorResult("Access denied")); return; diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/ProfilesRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/ProfilesRequest.java index 9b831296..4f58cbe2 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/ProfilesRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/ProfilesRequest.java @@ -7,6 +7,8 @@ import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.RequestType; +import ru.gravit.launcher.request.websockets.LegacyRequestBridge; +import ru.gravit.launcher.request.websockets.RequestInterface; import ru.gravit.launcher.serialize.HInput; import ru.gravit.launcher.serialize.HOutput; @@ -14,7 +16,7 @@ import java.util.Collections; import java.util.List; -public final class ProfilesRequest extends Request { +public final class ProfilesRequest extends Request implements RequestInterface { @LauncherAPI public ProfilesRequest() { @@ -31,6 +33,12 @@ public Integer getLegacyType() { return RequestType.PROFILES.getNumber(); } + @Override + public ProfilesRequestEvent requestWebSockets() throws Exception + { + return (ProfilesRequestEvent) LegacyRequestBridge.sendRequest(this); + } + @Override protected ProfilesRequestEvent requestDo(HInput input, HOutput output) throws Exception { output.writeBoolean(true); @@ -46,4 +54,9 @@ protected ProfilesRequestEvent requestDo(HInput input, HOutput output) throws Ex // Return request result return new ProfilesRequestEvent(profiles); } + + @Override + public String getType() { + return "profiles"; + } }