From 4d17f34ba6a4cbf21338072ee4f23040863be4ff Mon Sep 17 00:00:00 2001 From: Gravit Date: Thu, 27 Aug 2020 23:02:40 +0700 Subject: [PATCH] [FIX] ExitResponse --- .../launchserver/socket/response/auth/ExitResponse.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java index ce288d69..60cfbc0d 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java @@ -5,6 +5,7 @@ import pro.gravit.launcher.ClientPermissions; import pro.gravit.launcher.events.RequestEvent; import pro.gravit.launcher.events.request.ExitRequestEvent; +import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.handlers.WebSocketFrameHandler; import pro.gravit.launchserver.socket.response.SimpleResponse; @@ -46,7 +47,7 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception { } else { if (client1.session != client.session) return; } - exit(webSocketFrameHandler, channel, ExitRequestEvent.ExitReason.SERVER); + exit(server, webSocketFrameHandler, channel, ExitRequestEvent.ExitReason.SERVER); })); } sendResult(new ExitRequestEvent(ExitRequestEvent.ExitReason.CLIENT)); @@ -55,17 +56,16 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception { Client client1 = webSocketFrameHandler.getClient(); if(client1 != null && client.isAuth && client.username != null && client1.username.equals(username)) { - exit(webSocketFrameHandler, channel, ExitRequestEvent.ExitReason.SERVER); + exit(server, webSocketFrameHandler, channel, ExitRequestEvent.ExitReason.SERVER); } })); sendResult(new ExitRequestEvent(ExitRequestEvent.ExitReason.NO_EXIT)); } } - public void exit(WebSocketFrameHandler wsHandler, Channel channel, ExitRequestEvent.ExitReason reason) + public static void exit(LaunchServer server, WebSocketFrameHandler wsHandler, Channel channel, ExitRequestEvent.ExitReason reason) { Client chClient = wsHandler.getClient(); - if (!chClient.isAuth || !username.equals(chClient.username)) return; Client newCusClient = new Client(null); newCusClient.checkSign = chClient.checkSign; wsHandler.setClient(newCusClient);