This commit is contained in:
GoXLR 2022-10-19 09:31:07 +02:00
parent 635c1c9c75
commit 697dd58b46
No known key found for this signature in database
GPG Key ID: 5B163CA341BAA2EA
2 changed files with 11 additions and 9 deletions

View File

@ -25,7 +25,7 @@ public final class POSTServerGroups implements Handler<RoutingContext> {
String image = requestBody.getString("image"); String image = requestBody.getString("image");
ServerGroup serverGroup = new ServerGroup(id, image); ServerGroup serverGroup = new ServerGroup(id, image);
SyncUtils.<Void>runBlocking(v -> serverGroup.insert(v)); SyncUtils.<Void>runBlocking(serverGroup::insert);
if (requestBody.containsKey("addedBy")) { if (requestBody.containsKey("addedBy")) {
AuditLog.log(UuidUtils.parseUuid(requestBody.getString("addedBy")), requestBody.getString("addedByIp"), ctx, AuditLogActionType.SERVER_GROUP_CREATE, ImmutableMap.of("serverGroupId", id), (ignored, error) -> { AuditLog.log(UuidUtils.parseUuid(requestBody.getString("addedBy")), requestBody.getString("addedByIp"), ctx, AuditLogActionType.SERVER_GROUP_CREATE, ImmutableMap.of("serverGroupId", id), (ignored, error) -> {

View File

@ -75,6 +75,7 @@ public final class POSTServersHeartbeat implements Handler<RoutingContext> {
private Future<Void> createInfoResponse(Server server, double tps, Map<UUID, String> playerNames) { private Future<Void> createInfoResponse(Server server, double tps, Map<UUID, String> playerNames) {
Future<Void> callback = Future.future(); Future<Void> callback = Future.future();
if (server != null && playerNames != null) {
server.receivedHeartbeat(tps, playerNames.keySet()); server.receivedHeartbeat(tps, playerNames.keySet());
server.save((ignored, error) -> { server.save((ignored, error) -> {
if (error != null) { if (error != null) {
@ -83,6 +84,7 @@ public final class POSTServersHeartbeat implements Handler<RoutingContext> {
callback.complete(); callback.complete();
} }
}); });
}
return callback; return callback;
} }