class and table schema now conform to JSON

This commit is contained in:
2023-09-20 16:05:57 -04:00
parent 8289786099
commit be107c0858
20 changed files with 39 additions and 39 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ public class AddMobCmd extends AbstractDevCmd {
return;
}
if (zone.isGuildZone) {
if (zone.guild_zone) {
throwbackError(pc, "Cannot use ./mob on Player cities. Try ./servermob instead.");
return;
}
+2 -2
View File
@@ -81,7 +81,7 @@ public class GotoCmd extends AbstractDevCmd {
continue;
Zone zone = city.getParent();
if (zone != null) {
if (zone.isNPCCity || zone.isGuildZone)
if (zone.isNPCCity || zone.guild_zone)
loc = Vector3fImmutable.getRandomPointOnCircle(zone.getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS);
else
loc = zone.getLoc();
@@ -100,7 +100,7 @@ public class GotoCmd extends AbstractDevCmd {
if (!zone.zoneName.equalsIgnoreCase(cityName))
continue;
if (zone != null) {
if (zone.isNPCCity || zone.isGuildZone)
if (zone.isNPCCity || zone.guild_zone)
loc = Vector3fImmutable.getRandomPointOnCircle(zone.getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS);
else
loc = zone.getLoc();
+1 -1
View File
@@ -111,7 +111,7 @@ public class MakeBaneCmd extends AbstractDevCmd {
return;
}
if (!zone.isGuildZone) {
if (!zone.guild_zone) {
throwbackError(pc, "This is not a player city.");
return;
}
+1 -1
View File
@@ -42,7 +42,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd {
private static void PurgeWalls(Zone zone, PlayerCharacter pc) {
if (!zone.isGuildZone)
if (!zone.guild_zone)
return;
for (Building building : zone.zoneBuildingSet) {
+1 -1
View File
@@ -34,7 +34,7 @@ public class RemoveBaneCmd extends AbstractDevCmd {
return;
}
if (!zone.isGuildZone) {
if (!zone.guild_zone) {
throwbackError(pc, "This is not a player city.");
return;
}
+1 -1
View File
@@ -41,7 +41,7 @@ public class SetBaneActiveCmd extends AbstractDevCmd {
return;
}
if (!zone.isGuildZone) {
if (!zone.guild_zone) {
throwbackError(pc, "This is not a player city.");
return;
}
+5 -5
View File
@@ -194,7 +194,7 @@ public enum ZoneManager {
}
if (zone.isGuildZone) {
if (zone.guild_zone) {
addPlayerCityZone(zone);
return;
}
@@ -214,7 +214,7 @@ public enum ZoneManager {
}
public static final void addPlayerCityZone(final Zone zone) {
zone.isGuildZone = true;
zone.guild_zone = true;
ZoneManager.playerCityZones.add(zone);
}
@@ -250,7 +250,7 @@ public enum ZoneManager {
public static final boolean validHotZone(Zone zone) {
if (zone.peaceZone == (byte) 1)
if (zone.peace_zone == (byte) 1)
return false; // no safe zone hotzones// if (this.hotzone == null)
if (zone.getNodes().isEmpty())
@@ -387,7 +387,7 @@ public enum ZoneManager {
currentZone = ZoneManager.findSmallestZone(worldLoc);
if (currentZone.isGuildZone)
if (currentZone.guild_zone)
return City.getCity(currentZone.playerCityUUID);
return null;
@@ -440,7 +440,7 @@ public enum ZoneManager {
//not player city, must be npc city..
if (!zone.isGuildZone)
if (!zone.guild_zone)
zone.isNPCCity = true;
if ((ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER)) && (city.getHash() == null)) {
@@ -151,7 +151,7 @@ public class AbandonAssetMsgHandler extends AbstractClientMsgHandler {
cityZone = ZoneManager.findSmallestZone(targetBuilding.getLoc());
// Can't abandon a tree not within a player city zone
if (cityZone.isGuildZone == false)
if (cityZone.guild_zone == false)
return;
if (targetBuilding.getCity() == null)
@@ -65,7 +65,7 @@ public class ChannelMuteMsgHandler extends AbstractClientMsgHandler {
cityZone = ZoneManager.findSmallestZone(targetBuilding.getLoc());
// Can't abandon a tree not within a player city zone
if (cityZone.isGuildZone == false)
if (cityZone.guild_zone == false)
return;
if (targetBuilding.getCity().hasBeenTransfered == true) {
@@ -75,7 +75,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
Zone zone = ZoneManager.findSmallestZone(player.getLoc());
if (!zone.isGuildZone) {
if (!zone.guild_zone) {
ErrorPopupMsg.sendErrorMsg(player, "Unable to find city to command.");
return true;
}
@@ -334,7 +334,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
Zone zone = ZoneManager.findSmallestZone(player.getLoc());
if (zone != null) {
if (zone.isGuildZone) {
if (zone.guild_zone) {
loc = zone.getLoc();
}
}
@@ -137,7 +137,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
private static boolean validateBuildingPlacement(Zone serverZone, PlaceAssetMsg msg, ClientConnection origin, PlayerCharacter player, PlacementInfo placementInfo) {
if (serverZone.isGuildZone == false) {
if (serverZone.guild_zone == false) {
PlaceAssetMsg.sendPlaceAssetError(origin, 52, player.getName());
return false;
}
@@ -201,7 +201,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
// Cannot place assets on a dead tree
if ((serverZone.isGuildZone)
if ((serverZone.guild_zone)
&& (City.getCity(serverZone.playerCityUUID).getTOL().getRank() == -1)) {
PlaceAssetMsg.sendPlaceAssetError(origin, 1, "Cannot place asset on dead tree until world heals");
return false;
@@ -261,7 +261,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
// Must be a player city
if (serverZone.isGuildZone == false) {
if (serverZone.guild_zone == false) {
PlaceAssetMsg.sendPlaceAssetError(origin, 41, player.getName()); // Cannot place outside a guild zone
return false;
}
@@ -571,7 +571,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
// No valid player city found
if (serverCity == null || serverCity.getParent().isGuildZone == false) {
if (serverCity == null || serverCity.getParent().guild_zone == false) {
PlaceAssetMsg.sendPlaceAssetError(origin, 52, ""); // Cannot place outisde a guild zone
return false;
}
@@ -783,7 +783,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
// Link the zone with the city and then add
// to the appropriate hash tables and cache
zoneObject.isGuildZone = true;
zoneObject.guild_zone = true;
if (zoneObject.parent != null)
zoneObject.parent.addNode(zoneObject); //add as child to parent
@@ -117,7 +117,7 @@ public class GuildTreeStatusMsg extends ClientNetMsg {
city = null;
if (cityZone != null)
if (cityZone.isGuildZone)
if (cityZone.guild_zone)
city = City.GetCityFromCache(cityZone.playerCityUUID);
else if (this.treeOfLife != null && this.treeOfLife.getGuild() != null)
city = this.treeOfLife.getGuild().getOwnedCity();
@@ -130,7 +130,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
ArrayList<Zone> allIn = ZoneManager.getAllZonesIn(this.getLoc());
for (Zone zone : allIn)
if (zone.peaceZone == (byte) 1)
if (zone.peace_zone == (byte) 1)
return true;
return false;
+1 -1
View File
@@ -162,7 +162,7 @@ public final class Bane {
// Cannot place assets on a dead tree
if ((cityZone.isGuildZone) &&
if ((cityZone.guild_zone) &&
(City.getCity(cityZone.playerCityUUID).getTOL().getRank() == -1)) {
PlaceAssetMsg.sendPlaceAssetError(origin, 1, "Cannot bane a dead tree!");
return false;
+1 -1
View File
@@ -460,7 +460,7 @@ public class Building extends AbstractWorldObject {
}
}
}
if (this.parentZone.isGuildZone == false)
if (this.parentZone.guild_zone == false)
return null;
return City.getCity(this.parentZone.playerCityUUID);
+2 -2
View File
@@ -334,7 +334,7 @@ public class City extends AbstractWorldObject {
if (city.noTeleport)
continue;
if (city.parentZone != null && city.parentZone.isGuildZone) {
if (city.parentZone != null && city.parentZone.guild_zone) {
if (pc.getAccount().status.equals(AccountStatus.ADMIN)) {
cities.add(city);
@@ -395,7 +395,7 @@ public class City extends AbstractWorldObject {
if (city.noRepledge)
continue;
if (city.parentZone != null && city.parentZone.isGuildZone) {
if (city.parentZone != null && city.parentZone.guild_zone) {
//list Player cities
//open city, just list
+1 -1
View File
@@ -894,7 +894,7 @@ public class NPC extends AbstractCharacter {
this.stamina.set(this.staminaMax);
}
if (this.parentZone.isGuildZone)
if (this.parentZone.guild_zone)
if (NPC.GetNPCProfits(this) == null)
NPCProfits.CreateProfits(this);
+4 -4
View File
@@ -1703,7 +1703,7 @@ public class PlayerCharacter extends AbstractCharacter {
Zone zone = ZoneManager.findSmallestZone(this.getLoc());
if (zone != null) {
return zone.peaceZone == (byte) 1;
return zone.peace_zone == (byte) 1;
}
return false;
@@ -1797,7 +1797,7 @@ public class PlayerCharacter extends AbstractCharacter {
//DeathShroud
if (zone.peaceZone == 0)
if (zone.peace_zone == 0)
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
//enable this to give players deathshroud if mobs kill player.
@@ -1843,7 +1843,7 @@ public class PlayerCharacter extends AbstractCharacter {
//DeathShroud
if (zone.peaceZone == 0)
if (zone.peace_zone == 0)
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
if (doPVPEXP) {
@@ -1898,7 +1898,7 @@ public class PlayerCharacter extends AbstractCharacter {
killCleanup();
Zone zone = ZoneManager.findSmallestZone(this.getLoc());
if (zone.peaceZone == 0)
if (zone.peace_zone == 0)
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
// Send death message if needed
+7 -7
View File
@@ -39,7 +39,7 @@ public class Zone extends AbstractGameObject {
public final float zOffset;
public final float yOffset;
public final int zoneTemplate;
public final byte peaceZone;
public final byte peace_zone;
public final String Icon1;
public final String Icon2;
public final String Icon3;
@@ -54,7 +54,7 @@ public class Zone extends AbstractGameObject {
public Zone parent = null;
public Bounds bounds;
public boolean isNPCCity = false;
public boolean isGuildZone;
public boolean guild_zone;
public String hash;
public float worldAltitude = 0;
public float seaLevel = 0f;
@@ -69,13 +69,13 @@ public class Zone extends AbstractGameObject {
super(rs);
this.parentZoneID = rs.getInt("parent");
this.playerCityUUID = rs.getInt("playerCityUUID");
this.isGuildZone = this.playerCityUUID != 0;
this.guild_zone = this.playerCityUUID != 0;
this.zoneName = rs.getString("zoneName");
this.xOffset = rs.getFloat("xOffset");
this.zOffset = rs.getFloat("zOffset");
this.yOffset = rs.getFloat("yOffset");
this.zoneTemplate = rs.getInt("template");
this.peaceZone = rs.getByte("peaceZone");
this.peace_zone = rs.getByte("peace_zone");
this.Icon1 = rs.getString("icon1");
this.Icon2 = rs.getString("icon2");
this.Icon3 = rs.getString("icon3");
@@ -146,7 +146,7 @@ public class Zone extends AbstractGameObject {
writer.putString(city.getCityName());
else
writer.putString(zone.zoneName);
writer.put(zone.peaceZone);
writer.put(zone.peace_zone);
writer.putString(zone.Icon1);
writer.putString(zone.Icon2);
writer.putString(zone.Icon3);
@@ -238,7 +238,7 @@ public class Zone extends AbstractGameObject {
// Macro zones have icons.
if (this.isGuildZone == true)
if (this.guild_zone == true)
return false;
if (this.parent == null)
@@ -310,7 +310,7 @@ public class Zone extends AbstractGameObject {
public HeightMap getHeightMap() {
if (this.isGuildZone)
if (this.guild_zone)
return HeightMap.PlayerCityHeightMap;
return HeightMap.heightmapByLoadNum.get(this.zoneTemplate);