Browse Source

Portal array list now filled at bootstrap.

master
MagicBot 2 years ago
parent
commit
eac2e3f42b
  1. 2
      src/engine/db/handlers/dbRunegateHandler.java
  2. 10
      src/engine/objects/Runegate.java

2
src/engine/db/handlers/dbRunegateHandler.java

@ -31,7 +31,7 @@ public class dbRunegateHandler extends dbHandlerBase {
ArrayList<Integer> gateList = new ArrayList<>(); ArrayList<Integer> gateList = new ArrayList<>();
prepareCallable("SELECT DISTINCT `source_Building` FROM `static_runegate_portals`;"); prepareCallable("SELECT DISTINCT `sourceBuilding` FROM `static_runegate_portals`;");
try { try {
ResultSet rs = executeQuery(); ResultSet rs = executeQuery();

10
src/engine/objects/Runegate.java

@ -74,11 +74,21 @@ public class Runegate {
Building gateBuilding = (Building) DbManager.getObject(Enum.GameObjectType.Building, gateID); Building gateBuilding = (Building) DbManager.getObject(Enum.GameObjectType.Building, gateID);
Runegate runegate = new Runegate(gateBuilding); Runegate runegate = new Runegate(gateBuilding);
runegate.configurePortals();
_runegates.put(gateID, runegate); _runegates.put(gateID, runegate);
} }
} }
public void configurePortals() {
ArrayList<Portal> portalList = DbManager.RunegateQueries.GET_PORTAL_LIST(this.gateBuilding.getObjectUUID());
for (Portal portal : portalList) {
this._portals[portal.portalType.ordinal()] = portal;
}
}
public void _serializeForEnterWorld(ByteBufferWriter writer) { public void _serializeForEnterWorld(ByteBufferWriter writer) {
writer.putInt(gateBuilding.getObjectType().ordinal()); writer.putInt(gateBuilding.getObjectType().ordinal());

Loading…
Cancel
Save