diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/WebSocketService.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/WebSocketService.java index 08d9505c..ad9f4e7f 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/WebSocketService.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/WebSocketService.java @@ -9,6 +9,7 @@ import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; import ru.gravit.launcher.events.ExceptionEvent; import ru.gravit.launcher.events.RequestEvent; +import ru.gravit.launcher.events.request.AuthRequestEvent; import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.hasher.HashedEntry; import ru.gravit.launcher.hasher.HashedEntryAdapter; @@ -73,8 +74,17 @@ void process(ChannelHandlerContext ctx, TextWebSocketFrame frame, Client client) } LogHelper.debug("Proxy %s request", response.getType()); ProxyRequest proxyRequest = new ProxyRequest(response, 0); + proxyRequest.isCheckSign = client.checkSign; try { ResultInterface result = proxyRequest.request(); + if(result instanceof AuthRequestEvent) + { + LogHelper.debug("Client auth params get successful"); + AuthRequestEvent authRequestEvent = (AuthRequestEvent) result; + client.isAuth = true; + client.session = authRequestEvent.session; + if(authRequestEvent.playerProfile != null) client.username = authRequestEvent.playerProfile.username; + } sendObject(ctx, result); } catch (RequestException e) { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/ProxyCommandResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/ProxyCommandResponse.java index 9b372b86..a8be5cdc 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/ProxyCommandResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/ProxyCommandResponse.java @@ -8,6 +8,7 @@ public class ProxyCommandResponse extends SimpleResponse { public JsonResponseInterface response; public long session; + public boolean isCheckSign; @Override public void execute(ChannelHandlerContext ctx, Client client) throws Exception { if(!client.proxy) { @@ -15,6 +16,7 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception { return; } Client real_client = server.sessionManager.getOrNewClient(session); + real_client.checkSign = isCheckSign; response.execute(ctx, real_client); } diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/admin/ProxyRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/admin/ProxyRequest.java index 84d27219..f9855048 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/admin/ProxyRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/admin/ProxyRequest.java @@ -7,6 +7,7 @@ public class ProxyRequest extends Request implements RequestInterface { public RequestInterface response; public long session; + public boolean isCheckSign; public ProxyRequest(RequestInterface response, long session) { this.response = response;