Browse Source

class and table schema now conform to JSON

combat-2
MagicBot 1 year ago
parent
commit
bd97745ed1
  1. 2
      src/engine/gameManager/ZoneManager.java
  2. 40
      src/engine/objects/Zone.java

2
src/engine/gameManager/ZoneManager.java

@ -266,7 +266,7 @@ public enum ZoneManager { @@ -266,7 +266,7 @@ public enum ZoneManager {
// Enforce min level
if (zone.minLvl < Integer.parseInt(ConfigManager.MB_HOTZONE_MIN_LEVEL.getValue()))
if (zone.min_level < Integer.parseInt(ConfigManager.MB_HOTZONE_MIN_LEVEL.getValue()))
return false;
if (ZoneManager.hotZone != null)

40
src/engine/objects/Zone.java

@ -40,14 +40,14 @@ public class Zone extends AbstractGameObject { @@ -40,14 +40,14 @@ public class Zone extends AbstractGameObject {
public final float yOffset;
public final int template;
public final byte peace_zone;
public final String Icon1;
public final String Icon2;
public final String Icon3;
public final String icon1;
public final String icon2;
public final String icon3;
public float absX = 0.0f;
public float absY = 0.0f;
public float absZ = 0.0f;
public int minLvl;
public int maxLvl;
public int min_level;
public int max_level;
public boolean hasBeenHotzone = false;
public ArrayList<Zone> nodes = null;
public int parentZoneID;
@ -76,11 +76,11 @@ public class Zone extends AbstractGameObject { @@ -76,11 +76,11 @@ public class Zone extends AbstractGameObject {
this.yOffset = rs.getFloat("yOffset");
this.template = rs.getInt("template");
this.peace_zone = rs.getByte("peace_zone");
this.Icon1 = rs.getString("icon1");
this.Icon2 = rs.getString("icon2");
this.Icon3 = rs.getString("icon3");
this.minLvl = rs.getInt("min_level");
this.maxLvl = rs.getInt("max_level");
this.icon1 = rs.getString("icon1");
this.icon2 = rs.getString("icon2");
this.icon3 = rs.getString("icon3");
this.min_level = rs.getInt("min_level");
this.max_level = rs.getInt("max_level");
this.hash = rs.getString("hash");
//this needs to be here specifically for new zones created after server boot (e.g. player city zones)
@ -88,9 +88,9 @@ public class Zone extends AbstractGameObject { @@ -88,9 +88,9 @@ public class Zone extends AbstractGameObject {
Zone parentZone = ZoneManager.getZoneByUUID(parentZoneID);
this.setParent(parentZone);
if (this.minLvl == 0 && parentZone != null) {
this.minLvl = parentZone.minLvl;
this.maxLvl = parentZone.maxLvl;
if (this.min_level == 0 && parentZone != null) {
this.min_level = parentZone.min_level;
this.max_level = parentZone.max_level;
}
if (parentZone != null)
@ -147,9 +147,9 @@ public class Zone extends AbstractGameObject { @@ -147,9 +147,9 @@ public class Zone extends AbstractGameObject {
else
writer.putString(zone.zoneName);
writer.put(zone.peace_zone);
writer.putString(zone.Icon1);
writer.putString(zone.Icon2);
writer.putString(zone.Icon3);
writer.putString(zone.icon1);
writer.putString(zone.icon2);
writer.putString(zone.icon3);
writer.put((byte) 0); // Pad
for (Zone child : zone.nodes) {
@ -209,9 +209,9 @@ public class Zone extends AbstractGameObject { @@ -209,9 +209,9 @@ public class Zone extends AbstractGameObject {
this.absY = this.yOffset + parent.absY;
this.absZ = this.zOffset + parent.absZ;
if (this.minLvl == 0 || this.maxLvl == 0) {
this.minLvl = this.parent.minLvl;
this.maxLvl = this.parent.maxLvl;
if (this.min_level == 0 || this.max_level == 0) {
this.min_level = this.parent.min_level;
this.max_level = this.parent.max_level;
}
this.setBounds();
@ -244,7 +244,7 @@ public class Zone extends AbstractGameObject { @@ -244,7 +244,7 @@ public class Zone extends AbstractGameObject {
if (this.parent == null)
return false;
return !Icon1.equals("");
return !icon1.equals("");
}
public Vector3fImmutable getLoc() {

Loading…
Cancel
Save