Merge branch 'dev' of github.com:GravitLauncher/Launcher into dev

This commit is contained in:
Zaxar163 2019-11-28 17:30:10 +01:00
commit 3923251fd2
No known key found for this signature in database
GPG key ID: 1FE4F2E1F053831B

View file

@ -28,14 +28,14 @@ public void execute(ChannelHandlerContext ctx, Client client) {
for (ClientProfile p : server.getProfiles()) { for (ClientProfile p : server.getProfiles()) {
if (!client.profile.getTitle().equals(p.getTitle())) continue; if (!client.profile.getTitle().equals(p.getTitle())) continue;
if (!p.isWhitelistContains(client.username)) { if (!p.isWhitelistContains(client.username)) {
service.sendObject(ctx, new ErrorRequestEvent("You don't download this folder")); sendError("You don't download this folder");
return; return;
} }
} }
} }
HashedDir dir = server.updatesDirMap.get(dirName); HashedDir dir = server.updatesDirMap.get(dirName);
if (dir == null) { if (dir == null) {
service.sendObject(ctx, new ErrorRequestEvent(String.format("Directory %s not found", dirName))); sendError(String.format("Directory %s not found", dirName));
return; return;
} }
String url = server.config.netty.downloadURL.replace("%dirname%", IOHelper.urlEncode(dirName)); String url = server.config.netty.downloadURL.replace("%dirname%", IOHelper.urlEncode(dirName));
@ -45,6 +45,6 @@ public void execute(ChannelHandlerContext ctx, Client client) {
url = bind.url; url = bind.url;
zip = bind.zip; zip = bind.zip;
} }
service.sendObject(ctx, new UpdateRequestEvent(dir, url, zip)); sendResult(new UpdateRequestEvent(dir, url, zip));
} }
} }