From 21d698deb3f77de9cca812f75862eabd65b5e317 Mon Sep 17 00:00:00 2001 From: Gravit Date: Sun, 21 Apr 2019 04:56:56 +0700 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20=D0=93=D0=B8=D0=B1=D0=BA=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B0?= =?UTF-8?q?=20URL=20=D1=81=D0=BA=D0=B0=D1=87=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/ru/gravit/launchserver/LaunchServer.java | 3 ++- .../ru/gravit/launchserver/websocket/WebSocketService.java | 2 +- .../launchserver/websocket/json/update/UpdateResponse.java | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index 7cd32351..b50b7403 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -242,11 +242,12 @@ public class LauncherConf public class NettyConfig { public boolean clientEnabled; - public boolean sendExcptionEnabled; + public boolean sendExceptionEnabled; public String launcherURL; public String downloadURL; public String launcherEXEURL; public String address; + public Map bindings = new HashMap<>(); public NettyPerformanceConfig performance; public NettyBindAddress[] binds; } 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 1ec8ca55..1493e12a 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/WebSocketService.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/WebSocketService.java @@ -70,7 +70,7 @@ void process(ChannelHandlerContext ctx, TextWebSocketFrame frame, Client client) } catch (Exception e) { LogHelper.error(e); RequestEvent event; - if(server.config.netty.sendExcptionEnabled) + if(server.config.netty.sendExceptionEnabled) { event = new ExceptionEvent(e); } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateResponse.java index 6641e9f0..6b28b24f 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateResponse.java @@ -39,6 +39,8 @@ public void execute(ChannelHandlerContext ctx, Client client) { service.sendObject(ctx, new ErrorRequestEvent(String.format("Directory %s not found", dirName))); return; } - service.sendObject(ctx, new UpdateRequestEvent(dir.object, LaunchServer.server.config.netty.downloadURL.replace("%dirname%",dirName))); + String url = LaunchServer.server.config.netty.downloadURL.replace("%dirname%",dirName); + if(server.config.netty.bindings.get(dirName) != null) url = server.config.netty.bindings.get(dirName); + service.sendObject(ctx, new UpdateRequestEvent(dir.object, url)); } }