From fcacd4fe127d43bcc24312cf569ce4ec728586b7 Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 3 May 2019 23:33:23 +0700 Subject: [PATCH] =?UTF-8?q?[FIX][EXPERIMENTAL]=20=D0=A4=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D1=8B=D1=85=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B1=D0=BB=D0=B5=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gravit/launchserver/websocket/WebSocketService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 ad9f4e7f..c0494259 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/WebSocketService.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/WebSocketService.java @@ -14,6 +14,7 @@ import ru.gravit.launcher.hasher.HashedEntry; import ru.gravit.launcher.hasher.HashedEntryAdapter; import ru.gravit.launcher.request.JsonResultSerializeAdapter; +import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.RequestException; import ru.gravit.launcher.request.ResultInterface; import ru.gravit.launcher.request.admin.ProxyRequest; @@ -38,6 +39,7 @@ import java.lang.reflect.Type; import java.util.HashMap; +import java.util.Random; @SuppressWarnings("rawtypes") public class WebSocketService { @@ -73,7 +75,8 @@ void process(ChannelHandlerContext ctx, TextWebSocketFrame frame, Client client) simpleResponse.ctx = ctx; } LogHelper.debug("Proxy %s request", response.getType()); - ProxyRequest proxyRequest = new ProxyRequest(response, 0); + if(client.session == 0) client.session = new Random().nextLong(); + ProxyRequest proxyRequest = new ProxyRequest(response, client.session); proxyRequest.isCheckSign = client.checkSign; try { ResultInterface result = proxyRequest.request(); @@ -85,6 +88,10 @@ void process(ChannelHandlerContext ctx, TextWebSocketFrame frame, Client client) client.session = authRequestEvent.session; if(authRequestEvent.playerProfile != null) client.username = authRequestEvent.playerProfile.username; } + if(result instanceof Request && response instanceof SimpleResponse) + { + ((Request) result).requestUUID = ((SimpleResponse) response).requestUUID; + } sendObject(ctx, result); } catch (RequestException e) {