From 30f7f00b23c2f2995b6d310679c4118b2b937a3b Mon Sep 17 00:00:00 2001 From: Willem Date: Sat, 14 Dec 2024 23:51:54 +0100 Subject: [PATCH] Added more reactor fields to debug --- .../nx01/warp/core/WarpCorePlasmaConduit.java | 6 ++++ .../core/WarpCorePlasmaIntermixChamber.java | 12 +++++++- .../web/WarpCorePlasmaInspectorServlet.java | 28 +++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/nx01-warp-core/src/main/java/love/distributedrebirth/nx01/warp/core/WarpCorePlasmaConduit.java b/nx01-warp-core/src/main/java/love/distributedrebirth/nx01/warp/core/WarpCorePlasmaConduit.java index 8f354bc..c58b05c 100644 --- a/nx01-warp-core/src/main/java/love/distributedrebirth/nx01/warp/core/WarpCorePlasmaConduit.java +++ b/nx01-warp-core/src/main/java/love/distributedrebirth/nx01/warp/core/WarpCorePlasmaConduit.java @@ -80,6 +80,12 @@ public class WarpCorePlasmaConduit { synchronized (claimTypesOut) { result.slotTypesOut.addAll(claimTypesOut); } + synchronized (requireServices) { + result.requireServices.addAll(requireServices); + } + synchronized (requireSlots) { + result.requireSlots.addAll(requireSlots); + } return result; } diff --git a/nx01-warp-core/src/main/java/love/distributedrebirth/nx01/warp/core/WarpCorePlasmaIntermixChamber.java b/nx01-warp-core/src/main/java/love/distributedrebirth/nx01/warp/core/WarpCorePlasmaIntermixChamber.java index 5d8e363..7526e62 100644 --- a/nx01-warp-core/src/main/java/love/distributedrebirth/nx01/warp/core/WarpCorePlasmaIntermixChamber.java +++ b/nx01-warp-core/src/main/java/love/distributedrebirth/nx01/warp/core/WarpCorePlasmaIntermixChamber.java @@ -6,11 +6,13 @@ import java.util.List; import love.distributedrebirth.nx01.warp.core.react.WarpReactPlasma; -public class WarpCorePlasmaIntermixChamber { +public final class WarpCorePlasmaIntermixChamber { private final WarpReactPlasma slot; final List> slotTypesIn = new ArrayList<>(); final List> slotTypesOut = new ArrayList<>(); + final List> requireServices = new ArrayList<>(); + final List requireSlots = new ArrayList<>(); public WarpCorePlasmaIntermixChamber(WarpReactPlasma slot) { this.slot = slot; @@ -27,4 +29,12 @@ public class WarpCorePlasmaIntermixChamber { public List> getSlotTypesOut() { return slotTypesOut; } + + public List> getRequireServices() { + return requireServices; + } + + public List getRequireSlots() { + return requireSlots; + } } \ No newline at end of file diff --git a/nx01-zerofungus-server/src/main/java/love/distributedrebirth/nx01/zerofungus/server/web/WarpCorePlasmaInspectorServlet.java b/nx01-zerofungus-server/src/main/java/love/distributedrebirth/nx01/zerofungus/server/web/WarpCorePlasmaInspectorServlet.java index 8d50c2a..431a6f7 100644 --- a/nx01-zerofungus-server/src/main/java/love/distributedrebirth/nx01/zerofungus/server/web/WarpCorePlasmaInspectorServlet.java +++ b/nx01-zerofungus-server/src/main/java/love/distributedrebirth/nx01/zerofungus/server/web/WarpCorePlasmaInspectorServlet.java @@ -31,6 +31,8 @@ public class WarpCorePlasmaInspectorServlet extends HttpServlet { out.println("\t\n"); printClaims(out, "in", contract.getSlotTypesIn()); printClaims(out, "out", contract.getSlotTypesOut()); + printRequireServices(out, contract.getRequireServices()); + printRequireSlots(out, contract.getRequireSlots()); out.println("\n"); } out.println("\t\n"); @@ -49,4 +51,30 @@ public class WarpCorePlasmaInspectorServlet extends HttpServlet { } out.println("\t\t\n"); } + + private void printRequireServices(PrintWriter out, List> clazzes) { + if (clazzes.isEmpty()) { + return; + } + out.println("\t\t\n"); + for (Class cls : clazzes) { + out.print("\t\t\t"); + out.print(cls); + out.println("\n"); + } + out.println("\t\t\n"); + } + + private void printRequireSlots(PrintWriter out, List slots) { + if (slots.isEmpty()) { + return; + } + out.println("\t\t\n"); + for (WarpReactPlasma slot : slots) { + out.print("\t\t\t"); + out.print(slot.getSlotPath()); + out.println("\n"); + } + out.println("\t\t\n"); + } } \ No newline at end of file