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) {