mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] Гибкая настройка URL скачивания клиента
This commit is contained in:
parent
4d6a456b8f
commit
21d698deb3
3 changed files with 6 additions and 3 deletions
|
@ -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<String, String> bindings = new HashMap<>();
|
||||
public NettyPerformanceConfig performance;
|
||||
public NettyBindAddress[] binds;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue