diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/WebSocketService.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/WebSocketService.java index 8f459165..210beda9 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/WebSocketService.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/WebSocketService.java @@ -32,7 +32,7 @@ public void sendObject(ChannelHandlerContext ctx, Object obj) { ctx.channel().writeAndFlush(new TextWebSocketFrame(gson.toJson(obj))); } - public class ErrorResult + public static class ErrorResult { public ErrorResult(String error) { this.error = error; @@ -42,6 +42,16 @@ public ErrorResult(String error) { public final String error; public final String type; } + public static class SuccessResult + { + public SuccessResult(String requesttype) { + this.requesttype = requesttype; + this.type = "success"; + } + + public final String requesttype; + public final String type; + } public class ExceptionResult { public ExceptionResult(Exception e) { 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 fdee9aed..edd7ec1b 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 @@ -67,15 +67,15 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx) throws // throw new AuthException("You profile not found"); //} server.config.hwidHandler.check(hwid, result.username); + service.sendObject(ctx,new WebSocketService.SuccessResult("auth")); } catch (AuthException | HWIDException e) { - service.sendObject(ctx,new ErrorResult(e.getMessage())); + service.sendObject(ctx,new WebSocketService.ErrorResult(e.getMessage())); } } - public class ErrorResult + public class Result { - public ErrorResult(String error) { - this.error = error; + public Result() { } public String error;