From eac2e3f42b5372873487367ffb05529b91dd79b1 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 15 Feb 2023 12:29:38 -0500 Subject: [PATCH] Portal array list now filled at bootstrap. --- src/engine/db/handlers/dbRunegateHandler.java | 2 +- src/engine/objects/Runegate.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/engine/db/handlers/dbRunegateHandler.java b/src/engine/db/handlers/dbRunegateHandler.java index 01a41a82..be9bf624 100644 --- a/src/engine/db/handlers/dbRunegateHandler.java +++ b/src/engine/db/handlers/dbRunegateHandler.java @@ -31,7 +31,7 @@ public class dbRunegateHandler extends dbHandlerBase { ArrayList gateList = new ArrayList<>(); - prepareCallable("SELECT DISTINCT `source_Building` FROM `static_runegate_portals`;"); + prepareCallable("SELECT DISTINCT `sourceBuilding` FROM `static_runegate_portals`;"); try { ResultSet rs = executeQuery(); diff --git a/src/engine/objects/Runegate.java b/src/engine/objects/Runegate.java index 4d38f4ec..f55b48de 100644 --- a/src/engine/objects/Runegate.java +++ b/src/engine/objects/Runegate.java @@ -74,11 +74,21 @@ public class Runegate { Building gateBuilding = (Building) DbManager.getObject(Enum.GameObjectType.Building, gateID); Runegate runegate = new Runegate(gateBuilding); + runegate.configurePortals(); _runegates.put(gateID, runegate); } } + public void configurePortals() { + + ArrayList portalList = DbManager.RunegateQueries.GET_PORTAL_LIST(this.gateBuilding.getObjectUUID()); + + for (Portal portal : portalList) { + this._portals[portal.portalType.ordinal()] = portal; + } + } + public void _serializeForEnterWorld(ByteBufferWriter writer) { writer.putInt(gateBuilding.getObjectType().ordinal());