mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-21 23:04:45 +03:00
SuccessResult
This commit is contained in:
parent
3daabe584f
commit
df0d9f37a2
2 changed files with 15 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue