Browse Source

duplicated zone loading disabled

lakebane-new
FatBoy-DOTC 5 months ago
parent
commit
395fe31e02
  1. 9
      src/engine/db/handlers/dbHandlerBase.java
  2. 2
      src/engine/objects/Zone.java
  3. 3
      src/engine/server/world/WorldServer.java

9
src/engine/db/handlers/dbHandlerBase.java

@ -32,14 +32,7 @@ public abstract class dbHandlerBase {
try { try {
if (rs.next()) { if (rs.next()) {
abstractGameObject = localClass.getConstructor(ResultSet.class).newInstance(rs); abstractGameObject = localClass.getConstructor(ResultSet.class).newInstance(rs);
DbManager.addToCache(abstractGameObject);
if(abstractGameObject.getObjectType().equals(GameObjectType.Zone)){
if(rs.getInt("canLoad") == 1){
DbManager.addToCache(abstractGameObject);
}
}else {
DbManager.addToCache(abstractGameObject);
}
} }
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);

2
src/engine/objects/Zone.java

@ -61,6 +61,7 @@ public class Zone extends AbstractGameObject {
//public static ArrayList<Mob> respawnQue = new ArrayList<>(); //public static ArrayList<Mob> respawnQue = new ArrayList<>();
public static final Set<Mob> respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>()); public static final Set<Mob> respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>());
public static long lastRespawn = 0; public static long lastRespawn = 0;
public int canLoad;
/** /**
* ResultSet Constructor * ResultSet Constructor
*/ */
@ -101,6 +102,7 @@ public class Zone extends AbstractGameObject {
if (hash == null) if (hash == null)
setHash(); setHash();
this.canLoad = rs.getInt("canLoad");
} }

3
src/engine/server/world/WorldServer.java

@ -568,6 +568,9 @@ public class WorldServer {
for (Zone zone : rootParent) { for (Zone zone : rootParent) {
if(zone.canLoad == 0)
continue;
try { try {
ZoneManager.addZone(zone.getLoadNum(), zone); ZoneManager.addZone(zone.getLoadNum(), zone);

Loading…
Cancel
Save