forked from MagicBane/Server
Inlined empty getters
This commit is contained in:
@@ -469,7 +469,7 @@ public class Enum {
|
|||||||
|
|
||||||
// 14001 does not have a banestone to bind at
|
// 14001 does not have a banestone to bind at
|
||||||
|
|
||||||
if (ruinZone.getLoadNum() == 14001)
|
if (ruinZone.loadNum == 14001)
|
||||||
spawnLocation = Vector3fImmutable.getRandomPointOnCircle(ruinZone.getLoc(), 30);
|
spawnLocation = Vector3fImmutable.getRandomPointOnCircle(ruinZone.getLoc(), 30);
|
||||||
else
|
else
|
||||||
spawnLocation = Vector3fImmutable.getRandomPointOnCircle(ruinZone.getLoc()
|
spawnLocation = Vector3fImmutable.getRandomPointOnCircle(ruinZone.getLoc()
|
||||||
|
|||||||
@@ -154,8 +154,8 @@ public class HeightMap {
|
|||||||
|
|
||||||
this.heightMapID = 999999;
|
this.heightMapID = 999999;
|
||||||
this.maxHeight = 0;
|
this.maxHeight = 0;
|
||||||
int halfExtentsX = (int) zone.getBounds().getHalfExtents().x;
|
int halfExtentsX = (int) zone.bounds.getHalfExtents().x;
|
||||||
int halfExtentsY = (int) zone.getBounds().getHalfExtents().y;
|
int halfExtentsY = (int) zone.bounds.getHalfExtents().y;
|
||||||
this.zoneLoadID = 0;
|
this.zoneLoadID = 0;
|
||||||
this.seaLevel = 0;
|
this.seaLevel = 0;
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ public class HeightMap {
|
|||||||
|
|
||||||
HeightMap heightMap = new HeightMap(zone);
|
HeightMap heightMap = new HeightMap(zone);
|
||||||
|
|
||||||
HeightMap.heightmapByLoadNum.put(zone.getLoadNum(), heightMap);
|
HeightMap.heightmapByLoadNum.put(zone.loadNum, heightMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ public class HeightMap {
|
|||||||
return zone;
|
return zone;
|
||||||
|
|
||||||
while (nextZone.getHeightMap() == null)
|
while (nextZone.getHeightMap() == null)
|
||||||
nextZone = nextZone.getParent();
|
nextZone = nextZone.parent;
|
||||||
|
|
||||||
return nextZone;
|
return nextZone;
|
||||||
}
|
}
|
||||||
@@ -247,9 +247,14 @@ public class HeightMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static float interpolatePLANAR(Vector3fImmutable worldLoc, Zone heightMapZone, Vector2f zoneLoc, float interpolatedTerrainHeight) {
|
private static float interpolatePLANAR(Vector3fImmutable worldLoc, Zone heightMapZone, Vector2f zoneLoc, float interpolatedTerrainHeight) {
|
||||||
|
|
||||||
|
// zones of type PLANAR
|
||||||
|
|
||||||
Zone parentZone;
|
Zone parentZone;
|
||||||
float interpolatedParentTerrainHeight;
|
float interpolatedParentTerrainHeight;
|
||||||
parentZone = HeightMap.getNextZoneWithTerrain(heightMapZone.getParent());
|
|
||||||
|
parentZone = HeightMap.getNextZoneWithTerrain(heightMapZone.parent);
|
||||||
|
|
||||||
interpolatedParentTerrainHeight = HeightMap.getWorldHeight(parentZone, worldLoc);
|
interpolatedParentTerrainHeight = HeightMap.getWorldHeight(parentZone, worldLoc);
|
||||||
interpolatedParentTerrainHeight += parentZone.worldAltitude;
|
interpolatedParentTerrainHeight += parentZone.worldAltitude;
|
||||||
|
|
||||||
@@ -263,8 +268,8 @@ public class HeightMap {
|
|||||||
(heightMapZone.maxBlend.getHalfExtents().y);
|
(heightMapZone.maxBlend.getHalfExtents().y);
|
||||||
float currentArea = (blendBounds.getHalfExtents().x) *
|
float currentArea = (blendBounds.getHalfExtents().x) *
|
||||||
(blendBounds.getHalfExtents().y);
|
(blendBounds.getHalfExtents().y);
|
||||||
float zoneArea = (heightMapZone.getBounds().getHalfExtents().x) *
|
float zoneArea = (heightMapZone.bounds.getHalfExtents().x) *
|
||||||
(heightMapZone.getBounds().getHalfExtents().y);
|
(heightMapZone.bounds.getHalfExtents().y);
|
||||||
|
|
||||||
blendBounds.release();
|
blendBounds.release();
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class CityRecord extends DataRecord {
|
|||||||
cityRecord.locX = cityRecord.city.getTOL().getLoc().x;
|
cityRecord.locX = cityRecord.city.getTOL().getLoc().x;
|
||||||
cityRecord.locY = -cityRecord.city.getTOL().getLoc().z; // flip sign on 'y' coordinate
|
cityRecord.locY = -cityRecord.city.getTOL().getLoc().z; // flip sign on 'y' coordinate
|
||||||
|
|
||||||
cityRecord.zoneHash = cityRecord.city.getParent().getHash();
|
cityRecord.zoneHash = cityRecord.city.getParent().hash;
|
||||||
|
|
||||||
if (cityRecord.eventType.equals(Enum.RecordEventType.CREATE))
|
if (cityRecord.eventType.equals(Enum.RecordEventType.CREATE))
|
||||||
cityRecord.establishedDatetime = cityRecord.city.established;
|
cityRecord.establishedDatetime = cityRecord.city.established;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class MineRecord extends DataRecord {
|
|||||||
mineRecord.eventType = eventType;
|
mineRecord.eventType = eventType;
|
||||||
}
|
}
|
||||||
|
|
||||||
mineRecord.zoneHash = mine.getParentZone().getHash();
|
mineRecord.zoneHash = mine.getParentZone().hash;
|
||||||
|
|
||||||
if (character.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
if (character.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||||
player = (PlayerCharacter) character;
|
player = (PlayerCharacter) character;
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ public class PvpRecord extends DataRecord {
|
|||||||
outStatement.setInt(8, this.victim.getLevel());
|
outStatement.setInt(8, this.victim.getLevel());
|
||||||
|
|
||||||
outStatement.setString(9, DataWarehouse.hasher.encrypt(zone.getObjectUUID()));
|
outStatement.setString(9, DataWarehouse.hasher.encrypt(zone.getObjectUUID()));
|
||||||
outStatement.setString(10, zone.getName());
|
outStatement.setString(10, zone.zoneName);
|
||||||
outStatement.setFloat(11, this.location.getX());
|
outStatement.setFloat(11, this.location.getX());
|
||||||
outStatement.setFloat(12, -this.location.getZ()); // flip sign on 'y' coordinate
|
outStatement.setFloat(12, -this.location.getZ()); // flip sign on 'y' coordinate
|
||||||
outStatement.setBoolean(13, this.pvpExp);
|
outStatement.setBoolean(13, this.pvpExp);
|
||||||
|
|||||||
@@ -33,18 +33,18 @@ public class dbZoneHandler extends dbHandlerBase {
|
|||||||
ArrayList<Zone> wsmList = new ArrayList<>();
|
ArrayList<Zone> wsmList = new ArrayList<>();
|
||||||
wsmList.addAll(zone.getNodes());
|
wsmList.addAll(zone.getNodes());
|
||||||
if (zone.absX == 0.0f) {
|
if (zone.absX == 0.0f) {
|
||||||
zone.absX = zone.getXCoord();
|
zone.absX = zone.xCoord;
|
||||||
}
|
}
|
||||||
if (zone.absY == 0.0f) {
|
if (zone.absY == 0.0f) {
|
||||||
zone.absY = zone.getYCoord();
|
zone.absY = zone.yCoord;
|
||||||
}
|
}
|
||||||
if (zone.absZ == 0.0f) {
|
if (zone.absZ == 0.0f) {
|
||||||
zone.absZ = zone.getZCoord();
|
zone.absZ = zone.zCoord;
|
||||||
}
|
}
|
||||||
for (Zone child : zone.getNodes()) {
|
for (Zone child : zone.getNodes()) {
|
||||||
child.absX = child.getXCoord() + zone.absX;
|
child.absX = child.xCoord + zone.absX;
|
||||||
child.absY = child.getYCoord() + zone.absY;
|
child.absY = child.yCoord + zone.absY;
|
||||||
child.absZ = child.getZCoord() + zone.absZ;
|
child.absZ = child.zCoord + zone.absZ;
|
||||||
wsmList.addAll(this.GET_ALL_NODES(child));
|
wsmList.addAll(this.GET_ALL_NODES(child));
|
||||||
}
|
}
|
||||||
return wsmList;
|
return wsmList;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class AddMobCmd extends AbstractDevCmd {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zone.isPlayerCity()) {
|
if (zone.isPlayerCity) {
|
||||||
throwbackError(pc, "Cannot use ./mob on Player cities. Try ./servermob instead.");
|
throwbackError(pc, "Cannot use ./mob on Player cities. Try ./servermob instead.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ public class AuditMobsCmd extends AbstractDevCmd {
|
|||||||
|
|
||||||
if (size >= count) {
|
if (size >= count) {
|
||||||
plusplus++;
|
plusplus++;
|
||||||
throwbackInfo(pcSender, zoneMicro.getName() + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. ");
|
throwbackInfo(pcSender, zoneMicro.zoneName + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. ");
|
||||||
System.out.println(zoneMicro.getName() + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. ");
|
System.out.println(zoneMicro.zoneName + " at location " + zoneMicro.getLoc().toString() + " has " + size + " mobs. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ public class AuditMobsCmd extends AbstractDevCmd {
|
|||||||
//ConcurrentHashMap<Mob, Long> respawnMap = Mob.getRespawnMap();
|
//ConcurrentHashMap<Mob, Long> respawnMap = Mob.getRespawnMap();
|
||||||
// ConcurrentHashMap<Mob, Long> despawnMap = Mob.getDespawnMap();
|
// ConcurrentHashMap<Mob, Long> despawnMap = Mob.getDespawnMap();
|
||||||
|
|
||||||
throwbackInfo(pcSender, zone.getName() + ", numMobs: " + zone.zoneMobSet.size());
|
throwbackInfo(pcSender, zone.zoneName + ", numMobs: " + zone.zoneMobSet.size());
|
||||||
throwbackInfo(pcSender, "UUID, dbID, inRespawnMap, isAlive, activeAI, Loc");
|
throwbackInfo(pcSender, "UUID, dbID, inRespawnMap, isAlive, activeAI, Loc");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class GetHeightCmd extends AbstractDevCmd {
|
|||||||
|
|
||||||
currentZone = ZoneManager.findSmallestZone(playerCharacter.getLoc());
|
currentZone = ZoneManager.findSmallestZone(playerCharacter.getLoc());
|
||||||
heightmapZone = HeightMap.getNextZoneWithTerrain(currentZone);
|
heightmapZone = HeightMap.getNextZoneWithTerrain(currentZone);
|
||||||
parentZone = HeightMap.getNextZoneWithTerrain(currentZone.getParent());
|
parentZone = HeightMap.getNextZoneWithTerrain(currentZone.parent);
|
||||||
|
|
||||||
float currentHeight = HeightMap.getWorldHeight(currentZone, playerCharacter.getLoc());
|
float currentHeight = HeightMap.getWorldHeight(currentZone, playerCharacter.getLoc());
|
||||||
float parentHeight = HeightMap.getWorldHeight(parentZone, playerCharacter.getLoc());
|
float parentHeight = HeightMap.getWorldHeight(parentZone, playerCharacter.getLoc());
|
||||||
@@ -42,17 +42,17 @@ public class GetHeightCmd extends AbstractDevCmd {
|
|||||||
Vector2f zoneLoc = ZoneManager.worldToZoneSpace(playerCharacter.getLoc(), heightmapZone);
|
Vector2f zoneLoc = ZoneManager.worldToZoneSpace(playerCharacter.getLoc(), heightmapZone);
|
||||||
Vector2f gridSquare = heightmapZone.getHeightMap().getGridSquare(zoneLoc);
|
Vector2f gridSquare = heightmapZone.getHeightMap().getGridSquare(zoneLoc);
|
||||||
|
|
||||||
this.throwbackInfo(playerCharacter, "Current Zone : " + currentZone.getName());
|
this.throwbackInfo(playerCharacter, "Current Zone : " + currentZone.zoneName);
|
||||||
this.throwbackInfo(playerCharacter, "Heightmap Zone : " + heightmapZone.getName());
|
this.throwbackInfo(playerCharacter, "Heightmap Zone : " + heightmapZone.zoneName);
|
||||||
this.throwbackInfo(playerCharacter, "Zone Height: " + heightmapZone.worldAltitude);
|
this.throwbackInfo(playerCharacter, "Zone Height: " + heightmapZone.worldAltitude);
|
||||||
this.throwbackInfo(playerCharacter, "Sea Level: " + heightmapZone.getSeaLevel());
|
this.throwbackInfo(playerCharacter, "Sea Level: " + heightmapZone.seaLevel);
|
||||||
this.throwbackInfo(playerCharacter, "Drowning Height: " + (heightmapZone.getSeaLevel() + playerCharacter.getCharacterHeight()));
|
this.throwbackInfo(playerCharacter, "Drowning Height: " + (heightmapZone.seaLevel + playerCharacter.getCharacterHeight()));
|
||||||
this.throwbackInfo(playerCharacter, "Grid : " + (int) gridSquare.x + "x" + (int) gridSquare.y);
|
this.throwbackInfo(playerCharacter, "Grid : " + (int) gridSquare.x + "x" + (int) gridSquare.y);
|
||||||
this.throwbackInfo(playerCharacter, "*** 256: " + currentHeight);
|
this.throwbackInfo(playerCharacter, "*** 256: " + currentHeight);
|
||||||
this.throwbackInfo(playerCharacter, "***Adjusted Height: " + (currentHeight + playerCharacter.getCharacterHeight()));
|
this.throwbackInfo(playerCharacter, "***Adjusted Height: " + (currentHeight + playerCharacter.getCharacterHeight()));
|
||||||
|
|
||||||
this.throwbackInfo(playerCharacter, "------------");
|
this.throwbackInfo(playerCharacter, "------------");
|
||||||
this.throwbackInfo(playerCharacter, "Parent : " + parentZone.getName());
|
this.throwbackInfo(playerCharacter, "Parent : " + parentZone.zoneName);
|
||||||
this.throwbackInfo(playerCharacter, "Height returned : " + parentHeight);
|
this.throwbackInfo(playerCharacter, "Height returned : " + parentHeight);
|
||||||
this.throwbackInfo(playerCharacter, "------------");
|
this.throwbackInfo(playerCharacter, "------------");
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class GetOffsetCmd extends AbstractDevCmd {
|
|||||||
float difY = pcSender.getLoc().y - zone.absY;
|
float difY = pcSender.getLoc().y - zone.absY;
|
||||||
float difZ = pcSender.getLoc().z - zone.absZ;
|
float difZ = pcSender.getLoc().z - zone.absZ;
|
||||||
|
|
||||||
throwbackInfo(pcSender, zone.getName() + ": (x: " + difX + ", y: " + difY + ", z: " + difZ + ')');
|
throwbackInfo(pcSender, zone.zoneName + ": (x: " + difX + ", y: " + difY + ", z: " + difZ + ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class GetZoneCmd extends AbstractDevCmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Zone zone : allIn)
|
for (Zone zone : allIn)
|
||||||
throwbackInfo(pcSender, zone.getName() + "; UUID: " + zone.getObjectUUID() + ", loadNum: " + zone.getLoadNum());
|
throwbackInfo(pcSender, zone.zoneName + "; UUID: " + zone.getObjectUUID() + ", loadNum: " + zone.loadNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class GotoCmd extends AbstractDevCmd {
|
|||||||
continue;
|
continue;
|
||||||
Zone zone = city.getParent();
|
Zone zone = city.getParent();
|
||||||
if (zone != null) {
|
if (zone != null) {
|
||||||
if (zone.isNPCCity() || zone.isPlayerCity())
|
if (zone.isNPCCity || zone.isPlayerCity)
|
||||||
loc = Vector3fImmutable.getRandomPointOnCircle(zone.getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS);
|
loc = Vector3fImmutable.getRandomPointOnCircle(zone.getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS);
|
||||||
else
|
else
|
||||||
loc = zone.getLoc();
|
loc = zone.getLoc();
|
||||||
@@ -97,10 +97,10 @@ public class GotoCmd extends AbstractDevCmd {
|
|||||||
Zone zone = (Zone) zoneAgo;
|
Zone zone = (Zone) zoneAgo;
|
||||||
if (zone == null)
|
if (zone == null)
|
||||||
continue;
|
continue;
|
||||||
if (!zone.getName().equalsIgnoreCase(cityName))
|
if (!zone.zoneName.equalsIgnoreCase(cityName))
|
||||||
continue;
|
continue;
|
||||||
if (zone != null) {
|
if (zone != null) {
|
||||||
if (zone.isNPCCity() || zone.isPlayerCity())
|
if (zone.isNPCCity || zone.isPlayerCity)
|
||||||
loc = Vector3fImmutable.getRandomPointOnCircle(zone.getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS);
|
loc = Vector3fImmutable.getRandomPointOnCircle(zone.getLoc(), MBServerStatics.TREE_TELEPORT_RADIUS);
|
||||||
else
|
else
|
||||||
loc = zone.getLoc();
|
loc = zone.getLoc();
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class HotzoneCmd extends AbstractDevCmd {
|
|||||||
String input = data.toString().trim();
|
String input = data.toString().trim();
|
||||||
|
|
||||||
if (input.length() == 0) {
|
if (input.length() == 0) {
|
||||||
outString = "Current hotZone: " + ZoneManager.hotZone.getName() + "\r\n";
|
outString = "Current hotZone: " + ZoneManager.hotZone.zoneName + "\r\n";
|
||||||
outString += "Available hotZones: " + ZoneManager.availableHotZones();
|
outString += "Available hotZones: " + ZoneManager.availableHotZones();
|
||||||
throwbackInfo(playerCharacter, outString);
|
throwbackInfo(playerCharacter, outString);
|
||||||
return;
|
return;
|
||||||
@@ -48,7 +48,7 @@ public class HotzoneCmd extends AbstractDevCmd {
|
|||||||
|
|
||||||
if (input.equalsIgnoreCase("random")) {
|
if (input.equalsIgnoreCase("random")) {
|
||||||
ZoneManager.generateAndSetRandomHotzone();
|
ZoneManager.generateAndSetRandomHotzone();
|
||||||
outString = "New hotZone: " + ZoneManager.hotZone.getName() + "\r\n";
|
outString = "New hotZone: " + ZoneManager.hotZone.zoneName + "\r\n";
|
||||||
outString += "Available hotZones: " + ZoneManager.availableHotZones();
|
outString += "Available hotZones: " + ZoneManager.availableHotZones();
|
||||||
throwbackInfo(playerCharacter, outString);
|
throwbackInfo(playerCharacter, outString);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ public class InfoCmd extends AbstractDevCmd {
|
|||||||
output += newline;
|
output += newline;
|
||||||
output += "EquipSet: " + targetNPC.getEquipmentSetID();
|
output += "EquipSet: " + targetNPC.getEquipmentSetID();
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "Parent Zone LoadNum : " + targetNPC.getParentZone().getLoadNum();
|
output += "Parent Zone LoadNum : " + targetNPC.getParentZone().loadNum;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -473,7 +473,7 @@ public class InfoCmd extends AbstractDevCmd {
|
|||||||
output += "EquipSet: " + targetMob.equipmentSetID;
|
output += "EquipSet: " + targetMob.equipmentSetID;
|
||||||
output += newline;
|
output += newline;
|
||||||
try {
|
try {
|
||||||
output += "Parent Zone LoadNum : " + targetMob.getParentZone().getLoadNum();
|
output += "Parent Zone LoadNum : " + targetMob.getParentZone().loadNum;
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
//who cares
|
//who cares
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,12 +111,12 @@ public class MakeBaneCmd extends AbstractDevCmd {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!zone.isPlayerCity()) {
|
if (!zone.isPlayerCity) {
|
||||||
throwbackError(pc, "This is not a player city.");
|
throwbackError(pc, "This is not a player city.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
City city = City.getCity(zone.getPlayerCityUUID());
|
City city = City.getCity(zone.playerCityID);
|
||||||
if (city == null) {
|
if (city == null) {
|
||||||
throwbackError(pc, "Unable to find the city associated with this zone.");
|
throwbackError(pc, "Unable to find the city associated with this zone.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd {
|
|||||||
|
|
||||||
private static void PurgeWalls(Zone zone, PlayerCharacter pc) {
|
private static void PurgeWalls(Zone zone, PlayerCharacter pc) {
|
||||||
|
|
||||||
if (!zone.isPlayerCity())
|
if (!zone.isPlayerCity)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (Building building : zone.zoneBuildingSet) {
|
for (Building building : zone.zoneBuildingSet) {
|
||||||
|
|||||||
@@ -60,12 +60,12 @@ public class RealmInfoCmd extends AbstractDevCmd {
|
|||||||
outString += ")";
|
outString += ")";
|
||||||
outString += newline;
|
outString += newline;
|
||||||
|
|
||||||
outString += " Zone: " + serverZone.getName();
|
outString += " Zone: " + serverZone.zoneName;
|
||||||
|
|
||||||
outString += newline;
|
outString += newline;
|
||||||
|
|
||||||
if (serverZone.getParent() != null)
|
if (serverZone.parent != null)
|
||||||
outString += " Parent: " + serverZone.getParent().getName();
|
outString += " Parent: " + serverZone.parent.zoneName;
|
||||||
else
|
else
|
||||||
outString += "Parent: NONE";
|
outString += "Parent: NONE";
|
||||||
|
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ public class RemoveBaneCmd extends AbstractDevCmd {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!zone.isPlayerCity()) {
|
if (!zone.isPlayerCity) {
|
||||||
throwbackError(pc, "This is not a player city.");
|
throwbackError(pc, "This is not a player city.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
City city = City.getCity(zone.getPlayerCityUUID());
|
City city = City.getCity(zone.playerCityID);
|
||||||
if (city == null) {
|
if (city == null) {
|
||||||
throwbackError(pc, "Unable to find the city associated with this zone.");
|
throwbackError(pc, "Unable to find the city associated with this zone.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ public class RemoveObjectCmd extends AbstractDevCmd {
|
|||||||
building.disableSpire(false);
|
building.disableSpire(false);
|
||||||
|
|
||||||
if ((building.getBlueprint() != null) && (building.getBlueprint().getBuildingGroup() == BuildingGroup.WAREHOUSE)) {
|
if ((building.getBlueprint() != null) && (building.getBlueprint().getBuildingGroup() == BuildingGroup.WAREHOUSE)) {
|
||||||
City city = City.getCity(building.getParentZone().getPlayerCityUUID());
|
City city = City.getCity(building.getParentZone().playerCityID);
|
||||||
if (city != null) {
|
if (city != null) {
|
||||||
city.setWarehouseBuildingID(0);
|
city.setWarehouseBuildingID(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ public class SeaAuditCmd extends AbstractDevCmd {
|
|||||||
AbstractGameObject target) {
|
AbstractGameObject target) {
|
||||||
|
|
||||||
for (Zone zone : ZoneManager.getAllZones())
|
for (Zone zone : ZoneManager.getAllZones())
|
||||||
if (zone.getSeaLevel() > zone.worldAltitude)
|
if (zone.seaLevel > zone.worldAltitude)
|
||||||
this.throwbackInfo(playerCharacter, zone.getObjectUUID() + zone.getName());
|
this.throwbackInfo(playerCharacter, zone.getObjectUUID() + zone.zoneName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -41,12 +41,12 @@ public class SetBaneActiveCmd extends AbstractDevCmd {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!zone.isPlayerCity()) {
|
if (!zone.isPlayerCity) {
|
||||||
throwbackError(pc, "This is not a player city.");
|
throwbackError(pc, "This is not a player city.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
City city = City.getCity(zone.getPlayerCityUUID());
|
City city = City.getCity(zone.playerCityID);
|
||||||
if (city == null) {
|
if (city == null) {
|
||||||
throwbackError(pc, "Unable to find the city associated with this zone.");
|
throwbackError(pc, "Unable to find the city associated with this zone.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ public class SetForceRenameCityCmd extends AbstractDevCmd {
|
|||||||
if (zone == null)
|
if (zone == null)
|
||||||
return;
|
return;
|
||||||
boolean rename = words[0].equalsIgnoreCase("true") ? true : false;
|
boolean rename = words[0].equalsIgnoreCase("true") ? true : false;
|
||||||
if (zone.getPlayerCityUUID() == 0)
|
if (zone.playerCityID == 0)
|
||||||
return;
|
return;
|
||||||
City city = City.getCity(zone.getPlayerCityUUID());
|
City city = City.getCity(zone.playerCityID);
|
||||||
if (city == null)
|
if (city == null)
|
||||||
return;
|
return;
|
||||||
city.setForceRename(rename);
|
city.setForceRename(rename);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class SummonCmd extends AbstractDevCmd {
|
|||||||
Zone zone = ZoneManager.findSmallestZone(pc.getLoc());
|
Zone zone = ZoneManager.findSmallestZone(pc.getLoc());
|
||||||
String location = "Somewhere";
|
String location = "Somewhere";
|
||||||
if (zone != null)
|
if (zone != null)
|
||||||
location = zone.getName();
|
location = zone.zoneName;
|
||||||
RecvSummonsRequestMsg rsrm = new RecvSummonsRequestMsg(pc.getObjectType().ordinal(), pc.getObjectUUID(), pc.getFirstName(),
|
RecvSummonsRequestMsg rsrm = new RecvSummonsRequestMsg(pc.getObjectType().ordinal(), pc.getObjectUUID(), pc.getFirstName(),
|
||||||
location, false);
|
location, false);
|
||||||
toSummon.getClientConnection().sendMsg(rsrm);
|
toSummon.getClientConnection().sendMsg(rsrm);
|
||||||
|
|||||||
@@ -73,21 +73,21 @@ public class ZoneInfoCmd extends AbstractDevCmd {
|
|||||||
output = "Target Information:" + newline;
|
output = "Target Information:" + newline;
|
||||||
output += StringUtils.addWS("UUID: " + objectUUID, 20);
|
output += StringUtils.addWS("UUID: " + objectUUID, 20);
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "name: " + zone.getName();
|
output += "name: " + zone.zoneName;
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "loadNum: " + zone.getLoadNum();
|
output += "loadNum: " + zone.loadNum;
|
||||||
if (zone.getParent() != null) {
|
if (zone.parent != null) {
|
||||||
output += StringUtils.addWS(", parent: " + zone.getParent().getObjectUUID(), 30);
|
output += StringUtils.addWS(", parent: " + zone.parent.getObjectUUID(), 30);
|
||||||
output += "Parentabs: x: " + zone.getParent().getAbsX() + ", y: " + zone.getParent().getAbsY() + ", z: " + zone.getParent().getAbsZ();
|
output += "Parentabs: x: " + zone.parent.absX + ", y: " + zone.parent.absY + ", z: " + zone.parent.absZ;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
output += StringUtils.addWS(", parent: none", 30);
|
output += StringUtils.addWS(", parent: none", 30);
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "absLoc: x: " + zone.getAbsX() + ", y: " + zone.getAbsY() + ", z: " + zone.getAbsZ();
|
output += "absLoc: x: " + zone.absX + ", y: " + zone.absY + ", z: " + zone.absZ;
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "offset: x: " + zone.getXCoord() + ", y: " + zone.getYCoord() + ", z: " + zone.getZCoord();
|
output += "offset: x: " + zone.xCoord + ", y: " + zone.yCoord + ", z: " + zone.zCoord;
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "radius: x: " + zone.getBounds().getHalfExtents().x + ", z: " + zone.getBounds().getHalfExtents().y;
|
output += "radius: x: " + zone.bounds.getHalfExtents().x + ", z: " + zone.bounds.getHalfExtents().y;
|
||||||
output += newline;
|
output += newline;
|
||||||
|
|
||||||
if (zone.getHeightMap() != null) {
|
if (zone.getHeightMap() != null) {
|
||||||
@@ -98,11 +98,11 @@ public class ZoneInfoCmd extends AbstractDevCmd {
|
|||||||
output += "Bucket Width Y : " + zone.getHeightMap().bucketWidthY;
|
output += "Bucket Width Y : " + zone.getHeightMap().bucketWidthY;
|
||||||
|
|
||||||
}
|
}
|
||||||
output += "radius: x: " + zone.getBounds().getHalfExtents().x + ", z: " + zone.getBounds().getHalfExtents().y;
|
output += "radius: x: " + zone.bounds.getHalfExtents().x + ", z: " + zone.bounds.getHalfExtents().y;
|
||||||
output += newline;
|
output += newline;
|
||||||
// output += "minLvl = " + zone.getMinLvl() + " | maxLvl = " + zone.getMaxLvl();
|
// output += "minLvl = " + zone.getMinLvl() + " | maxLvl = " + zone.getMaxLvl();
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "Sea Level = " + zone.getSeaLevel();
|
output += "Sea Level = " + zone.seaLevel;
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "World Altitude = " + zone.worldAltitude;
|
output += "World Altitude = " + zone.worldAltitude;
|
||||||
throwbackInfo(player, output);
|
throwbackInfo(player, output);
|
||||||
@@ -110,7 +110,7 @@ public class ZoneInfoCmd extends AbstractDevCmd {
|
|||||||
City city = ZoneManager.getCityAtLocation(player.getLoc());
|
City city = ZoneManager.getCityAtLocation(player.getLoc());
|
||||||
|
|
||||||
output += newline;
|
output += newline;
|
||||||
output += (city == null) ? "None" : city.getParent().getName();
|
output += (city == null) ? "None" : city.getParent().zoneName;
|
||||||
|
|
||||||
if (city != null) {
|
if (city != null) {
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ public class ZoneInfoCmd extends AbstractDevCmd {
|
|||||||
|
|
||||||
for (Zone child : nodes) {
|
for (Zone child : nodes) {
|
||||||
output += newline;
|
output += newline;
|
||||||
output += child.getName() + " (" + child.getLoadNum() + ')';
|
output += child.zoneName + " (" + child.loadNum + ')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throwbackInfo(player, output);
|
throwbackInfo(player, output);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class ZoneSetCmd extends AbstractDevCmd {
|
|||||||
|
|
||||||
zone = ZoneManager.findSmallestZone(playerCharacter.getLoc());
|
zone = ZoneManager.findSmallestZone(playerCharacter.getLoc());
|
||||||
|
|
||||||
throwbackInfo(playerCharacter, zone.getName() + " (" + zone.getLoadNum() + ") " + zone.getObjectUUID());
|
throwbackInfo(playerCharacter, zone.zoneName + " (" + zone.loadNum + ") " + zone.getObjectUUID());
|
||||||
|
|
||||||
// NPC
|
// NPC
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public enum LootManager {
|
|||||||
if(ib == null)
|
if(ib == null)
|
||||||
break;
|
break;
|
||||||
if (ib.isDiscRune() || ib.getName().toLowerCase().contains("of the gods")) {
|
if (ib.isDiscRune() || ib.getName().toLowerCase().contains("of the gods")) {
|
||||||
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " has found the " + ib.getName() + ". Are you tough enough to take it?");
|
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + ib.getName() + ". Are you tough enough to take it?");
|
||||||
chatMsg.setMessageType(10);
|
chatMsg.setMessageType(10);
|
||||||
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
|
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
|
||||||
DispatchMessage.dispatchMsgToAll(chatMsg);
|
DispatchMessage.dispatchMsgToAll(chatMsg);
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ public enum MovementManager {
|
|||||||
Zone serverZone = null;
|
Zone serverZone = null;
|
||||||
|
|
||||||
serverZone = ZoneManager.findSmallestZone(player.getLoc());
|
serverZone = ZoneManager.findSmallestZone(player.getLoc());
|
||||||
cityObject = (City) DbManager.getFromCache(GameObjectType.City, serverZone.getPlayerCityUUID());
|
cityObject = (City) DbManager.getFromCache(GameObjectType.City, serverZone.playerCityID);
|
||||||
|
|
||||||
// Do not send group messages if player is on grid
|
// Do not send group messages if player is on grid
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
if (zone != null) {
|
if (zone != null) {
|
||||||
allIn.add(zone);
|
allIn.add(zone);
|
||||||
while (zone.getParent() != null) {
|
while (zone.parent != null) {
|
||||||
zone = zone.getParent();
|
zone = zone.parent;
|
||||||
allIn.add(zone);
|
allIn.add(zone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ public enum ZoneManager {
|
|||||||
if (nodes != null)
|
if (nodes != null)
|
||||||
for (Zone child : nodes) {
|
for (Zone child : nodes) {
|
||||||
|
|
||||||
if (Bounds.collide(loc, child.getBounds()) == true) {
|
if (Bounds.collide(loc, child.bounds) == true) {
|
||||||
zone = child;
|
zone = child;
|
||||||
childFound = true;
|
childFound = true;
|
||||||
break;
|
break;
|
||||||
@@ -106,7 +106,7 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
ZoneManager.zonesByUUID.put(zone.getObjectUUID(), zone);
|
ZoneManager.zonesByUUID.put(zone.getObjectUUID(), zone);
|
||||||
|
|
||||||
ZoneManager.zonesByName.put(zone.getName().toLowerCase(), zone);
|
ZoneManager.zonesByName.put(zone.zoneName.toLowerCase(), zone);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ public enum ZoneManager {
|
|||||||
if (ZoneManager.hotZone == null)
|
if (ZoneManager.hotZone == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (Bounds.collide(loc, ZoneManager.hotZone.getBounds()) == true);
|
return (Bounds.collide(loc, ZoneManager.hotZone.bounds) == true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Zone getSeaFloor() {
|
public static Zone getSeaFloor() {
|
||||||
@@ -182,7 +182,7 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
public static final void populateWorldZones(final Zone zone) {
|
public static final void populateWorldZones(final Zone zone) {
|
||||||
|
|
||||||
int loadNum = zone.getLoadNum();
|
int loadNum = zone.loadNum;
|
||||||
|
|
||||||
// Zones are added to separate
|
// Zones are added to separate
|
||||||
// collections for quick access
|
// collections for quick access
|
||||||
@@ -194,12 +194,12 @@ public enum ZoneManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (zone.isPlayerCity()) {
|
if (zone.isPlayerCity) {
|
||||||
addPlayerCityZone(zone);
|
addPlayerCityZone(zone);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zone.isNPCCity())
|
if (zone.isNPCCity)
|
||||||
addNPCCityZone(zone);
|
addNPCCityZone(zone);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -209,12 +209,12 @@ public enum ZoneManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void addNPCCityZone(final Zone zone) {
|
private static void addNPCCityZone(final Zone zone) {
|
||||||
zone.setNPCCity(true);
|
zone.isNPCCity = true;
|
||||||
ZoneManager.npcCityZones.add(zone);
|
ZoneManager.npcCityZones.add(zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final void addPlayerCityZone(final Zone zone) {
|
public static final void addPlayerCityZone(final Zone zone) {
|
||||||
zone.setPlayerCity(true);
|
zone.isPlayerCity = true;
|
||||||
ZoneManager.playerCityZones.add(zone);
|
ZoneManager.playerCityZones.add(zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
public static final boolean validHotZone(Zone zone) {
|
public static final boolean validHotZone(Zone zone) {
|
||||||
|
|
||||||
if (zone.getSafeZone() == (byte) 1)
|
if (zone.peaceZone == (byte) 1)
|
||||||
return false; // no safe zone hotzones// if (this.hotzone == null)
|
return false; // no safe zone hotzones// if (this.hotzone == null)
|
||||||
|
|
||||||
if (zone.getNodes().isEmpty())
|
if (zone.getNodes().isEmpty())
|
||||||
@@ -298,14 +298,14 @@ public enum ZoneManager {
|
|||||||
// Top left corner of zone is calculated in world space by the center and it's extents.
|
// Top left corner of zone is calculated in world space by the center and it's extents.
|
||||||
|
|
||||||
zoneOrigin = new Vector2f(serverZone.getLoc().x, serverZone.getLoc().z);
|
zoneOrigin = new Vector2f(serverZone.getLoc().x, serverZone.getLoc().z);
|
||||||
zoneOrigin = zoneOrigin.subtract(new Vector2f(serverZone.getBounds().getHalfExtents().x, serverZone.getBounds().getHalfExtents().y));
|
zoneOrigin = zoneOrigin.subtract(new Vector2f(serverZone.bounds.getHalfExtents().x, serverZone.bounds.getHalfExtents().y));
|
||||||
|
|
||||||
// Local coordinate in world space translated to an offset from the calculated zone origin.
|
// Local coordinate in world space translated to an offset from the calculated zone origin.
|
||||||
|
|
||||||
localCoords = new Vector2f(worldVector.x, worldVector.z);
|
localCoords = new Vector2f(worldVector.x, worldVector.z);
|
||||||
localCoords = localCoords.subtract(zoneOrigin);
|
localCoords = localCoords.subtract(zoneOrigin);
|
||||||
|
|
||||||
localCoords.setY((serverZone.getBounds().getHalfExtents().y * 2) - localCoords.y);
|
localCoords.setY((serverZone.bounds.getHalfExtents().y * 2) - localCoords.y);
|
||||||
|
|
||||||
|
|
||||||
// TODO : Make sure this value does not go outside the zone's bounds.
|
// TODO : Make sure this value does not go outside the zone's bounds.
|
||||||
@@ -387,8 +387,8 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
currentZone = ZoneManager.findSmallestZone(worldLoc);
|
currentZone = ZoneManager.findSmallestZone(worldLoc);
|
||||||
|
|
||||||
if (currentZone.isPlayerCity())
|
if (currentZone.isPlayerCity)
|
||||||
return City.getCity(currentZone.getPlayerCityUUID());
|
return City.getCity(currentZone.playerCityID);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -420,7 +420,7 @@ public enum ZoneManager {
|
|||||||
if (zone.isContinent())
|
if (zone.isContinent())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (Bounds.collide(treeBounds, zone.getBounds(), 0.0f))
|
if (Bounds.collide(treeBounds, zone.bounds, 0.0f))
|
||||||
validLocation = false;
|
validLocation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,8 +440,8 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
//not player city, must be npc city..
|
//not player city, must be npc city..
|
||||||
|
|
||||||
if (!zone.isPlayerCity())
|
if (!zone.isPlayerCity)
|
||||||
zone.setNPCCity(true);
|
zone.isNPCCity = true;
|
||||||
|
|
||||||
if ((ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER)) && (city.getHash() == null)) {
|
if ((ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER)) && (city.getHash() == null)) {
|
||||||
|
|
||||||
@@ -461,15 +461,15 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
// Seafloor
|
// Seafloor
|
||||||
|
|
||||||
if (zone.getParent() == null)
|
if (zone.parent == null)
|
||||||
return worldAlttitude;
|
return worldAlttitude;
|
||||||
|
|
||||||
Zone parentZone = zone.getParent();
|
Zone parentZone = zone.parent;
|
||||||
|
|
||||||
// Children of seafloor
|
// Children of seafloor
|
||||||
|
|
||||||
if (parentZone.getParent() == null)
|
if (parentZone.parent == null)
|
||||||
return worldAlttitude + zone.getYCoord();
|
return worldAlttitude + zone.yCoord;
|
||||||
|
|
||||||
// return height from heightmap engine at zone location
|
// return height from heightmap engine at zone location
|
||||||
|
|
||||||
@@ -477,7 +477,7 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
// Add zone offset to value
|
// Add zone offset to value
|
||||||
|
|
||||||
worldAlttitude += zone.getYCoord();
|
worldAlttitude += zone.yCoord;
|
||||||
|
|
||||||
return worldAlttitude;
|
return worldAlttitude;
|
||||||
}
|
}
|
||||||
@@ -487,6 +487,6 @@ public enum ZoneManager {
|
|||||||
float localAltitude = HeightMap.getWorldHeight(currentLoc);
|
float localAltitude = HeightMap.getWorldHeight(currentLoc);
|
||||||
Zone zone = findSmallestZone(currentLoc);
|
Zone zone = findSmallestZone(currentLoc);
|
||||||
|
|
||||||
return localAltitude < zone.getSeaLevel();
|
return localAltitude < zone.seaLevel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ public class MovementUtilities {
|
|||||||
float zoneRange = 250;
|
float zoneRange = 250;
|
||||||
|
|
||||||
if (agent.getParentZone() != null) {
|
if (agent.getParentZone() != null) {
|
||||||
if (agent.getParentZone().getBounds() != null)
|
if (agent.getParentZone().bounds != null)
|
||||||
zoneRange = agent.getParentZone().getBounds().getHalfExtents().x * 2;
|
zoneRange = agent.getParentZone().bounds.getHalfExtents().x * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zoneRange > 300)
|
if (zoneRange > 300)
|
||||||
|
|||||||
@@ -1196,7 +1196,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
|||||||
|
|
||||||
|
|
||||||
if (npc.getCharItemManager().getInventoryCount() > 150) {
|
if (npc.getCharItemManager().getInventoryCount() > 150) {
|
||||||
if (npc.getParentZone() != null && npc.getParentZone().getPlayerCityUUID() == 0) {
|
if (npc.getParentZone() != null && npc.getParentZone().playerCityID == 0) {
|
||||||
ArrayList<Item> inv = npc.getInventory();
|
ArrayList<Item> inv = npc.getInventory();
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
try {
|
try {
|
||||||
@@ -1229,7 +1229,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
|||||||
if (ib == null)
|
if (ib == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (npc.getParentZone() != null && npc.getParentZone().getPlayerCityUUID() != 0)
|
if (npc.getParentZone() != null && npc.getParentZone().playerCityID != 0)
|
||||||
if (!npc.getCharItemManager().hasRoomInventory(ib.getWeight())) {
|
if (!npc.getCharItemManager().hasRoomInventory(ib.getWeight())) {
|
||||||
|
|
||||||
ErrorPopupMsg.sendErrorPopup(player, 21);
|
ErrorPopupMsg.sendErrorPopup(player, 21);
|
||||||
@@ -1280,7 +1280,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
|||||||
|
|
||||||
if (building != null && building.getProtectionState().equals(ProtectionState.NPC))
|
if (building != null && building.getProtectionState().equals(ProtectionState.NPC))
|
||||||
building = null;
|
building = null;
|
||||||
if (npc.getParentZone().getPlayerCityUUID() == 0)
|
if (npc.getParentZone().playerCityID == 0)
|
||||||
building = null;
|
building = null;
|
||||||
|
|
||||||
//make sure npc can afford item
|
//make sure npc can afford item
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ public class AbandonAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
cityZone = ZoneManager.findSmallestZone(targetBuilding.getLoc());
|
cityZone = ZoneManager.findSmallestZone(targetBuilding.getLoc());
|
||||||
|
|
||||||
// Can't abandon a tree not within a player city zone
|
// Can't abandon a tree not within a player city zone
|
||||||
if (cityZone.isPlayerCity() == false)
|
if (cityZone.isPlayerCity == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (targetBuilding.getCity() == null)
|
if (targetBuilding.getCity() == null)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class AssetSupportMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (serverZone == null)
|
if (serverZone == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
serverCity = City.GetCityFromCache(serverZone.getPlayerCityUUID());
|
serverCity = City.GetCityFromCache(serverZone.playerCityID);
|
||||||
|
|
||||||
if (serverCity == null)
|
if (serverCity == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class ChannelMuteMsgHandler extends AbstractClientMsgHandler {
|
|||||||
cityZone = ZoneManager.findSmallestZone(targetBuilding.getLoc());
|
cityZone = ZoneManager.findSmallestZone(targetBuilding.getLoc());
|
||||||
|
|
||||||
// Can't abandon a tree not within a player city zone
|
// Can't abandon a tree not within a player city zone
|
||||||
if (cityZone.isPlayerCity() == false)
|
if (cityZone.isPlayerCity == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (targetBuilding.getCity().hasBeenTransfered == true) {
|
if (targetBuilding.getCity().hasBeenTransfered == true) {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
|
|||||||
playerZone = building.getParentZone();
|
playerZone = building.getParentZone();
|
||||||
|
|
||||||
if (playerZone != null)
|
if (playerZone != null)
|
||||||
playerCity = City.getCity(playerZone.getPlayerCityUUID());
|
playerCity = City.getCity(playerZone.playerCityID);
|
||||||
|
|
||||||
// Oops! *** Refactor: Log error
|
// Oops! *** Refactor: Log error
|
||||||
switch (msg.getMessageType()) {
|
switch (msg.getMessageType()) {
|
||||||
|
|||||||
@@ -75,12 +75,12 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
Zone zone = ZoneManager.findSmallestZone(player.getLoc());
|
Zone zone = ZoneManager.findSmallestZone(player.getLoc());
|
||||||
|
|
||||||
if (!zone.isPlayerCity()) {
|
if (!zone.isPlayerCity) {
|
||||||
ErrorPopupMsg.sendErrorMsg(player, "Unable to find city to command.");
|
ErrorPopupMsg.sendErrorMsg(player, "Unable to find city to command.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
City city = City.GetCityFromCache(zone.getPlayerCityUUID());
|
City city = City.GetCityFromCache(zone.playerCityID);
|
||||||
|
|
||||||
if (city == null) {
|
if (city == null) {
|
||||||
ErrorPopupMsg.sendErrorMsg(player, "Unable to find city to command.");
|
ErrorPopupMsg.sendErrorMsg(player, "Unable to find city to command.");
|
||||||
@@ -254,7 +254,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (baneZone == null)
|
if (baneZone == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
City banedCity = City.getCity(baneZone.getPlayerCityUUID());
|
City banedCity = City.getCity(baneZone.playerCityID);
|
||||||
|
|
||||||
if (banedCity == null)
|
if (banedCity == null)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
|||||||
Zone zone = ZoneManager.findSmallestZone(player.getLoc());
|
Zone zone = ZoneManager.findSmallestZone(player.getLoc());
|
||||||
|
|
||||||
if (zone != null) {
|
if (zone != null) {
|
||||||
if (zone.isPlayerCity()) {
|
if (zone.isPlayerCity) {
|
||||||
loc = zone.getLoc();
|
loc = zone.getLoc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (zone == null)
|
if (zone == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (zone.getPlayerCityUUID() == 0)
|
if (zone.playerCityID == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
City city = building.getCity();
|
City city = building.getCity();
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
private static boolean validateBuildingPlacement(Zone serverZone, PlaceAssetMsg msg, ClientConnection origin, PlayerCharacter player, PlacementInfo placementInfo) {
|
private static boolean validateBuildingPlacement(Zone serverZone, PlaceAssetMsg msg, ClientConnection origin, PlayerCharacter player, PlacementInfo placementInfo) {
|
||||||
|
|
||||||
if (serverZone.isPlayerCity() == false) {
|
if (serverZone.isPlayerCity == false) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 52, player.getName());
|
PlaceAssetMsg.sendPlaceAssetError(origin, 52, player.getName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -156,7 +156,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
// Retrieve the building details we're placing
|
// Retrieve the building details we're placing
|
||||||
|
|
||||||
if (serverZone.isNPCCity() == true) {
|
if (serverZone.isNPCCity == true) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 15, ""); // Cannot place in a peace zone
|
PlaceAssetMsg.sendPlaceAssetError(origin, 15, ""); // Cannot place in a peace zone
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -185,7 +185,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
// Players cannot place buildings in mob zones.
|
// Players cannot place buildings in mob zones.
|
||||||
|
|
||||||
if ((serverZone.isMacroZone() == true)
|
if ((serverZone.isMacroZone() == true)
|
||||||
|| (serverZone.getParent().isMacroZone() == true)) {
|
|| (serverZone.parent.isMacroZone() == true)) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 57, player.getName()); // No building may be placed within this territory
|
PlaceAssetMsg.sendPlaceAssetError(origin, 57, player.getName()); // No building may be placed within this territory
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -201,8 +201,8 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
// Cannot place assets on a dead tree
|
// Cannot place assets on a dead tree
|
||||||
|
|
||||||
if ((serverZone.isPlayerCity())
|
if ((serverZone.isPlayerCity)
|
||||||
&& (City.getCity(serverZone.getPlayerCityUUID()).getTOL().getRank() == -1)) {
|
&& (City.getCity(serverZone.playerCityID).getTOL().getRank() == -1)) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 1, "Cannot place asset on dead tree until world heals");
|
PlaceAssetMsg.sendPlaceAssetError(origin, 1, "Cannot place asset on dead tree until world heals");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -261,14 +261,14 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
// Must be a player city
|
// Must be a player city
|
||||||
|
|
||||||
if (serverZone.isPlayerCity() == false) {
|
if (serverZone.isPlayerCity == false) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 41, player.getName()); // Cannot place outside a guild zone
|
PlaceAssetMsg.sendPlaceAssetError(origin, 41, player.getName()); // Cannot place outside a guild zone
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Test zone has a city object
|
//Test zone has a city object
|
||||||
|
|
||||||
City city = City.getCity(serverZone.getPlayerCityUUID());
|
City city = City.getCity(serverZone.playerCityID);
|
||||||
|
|
||||||
if (city == null) {
|
if (city == null) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 52, ""); //"no city to associate asset with"
|
PlaceAssetMsg.sendPlaceAssetError(origin, 52, ""); //"no city to associate asset with"
|
||||||
@@ -512,7 +512,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (serverZone == null)
|
if (serverZone == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
cityObject = City.getCity(serverZone.getPlayerCityUUID());
|
cityObject = City.getCity(serverZone.playerCityID);
|
||||||
|
|
||||||
// Early exit if something went horribly wrong
|
// Early exit if something went horribly wrong
|
||||||
|
|
||||||
@@ -571,7 +571,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
// No valid player city found
|
// No valid player city found
|
||||||
|
|
||||||
if (serverCity == null || serverCity.getParent().isPlayerCity() == false) {
|
if (serverCity == null || serverCity.getParent().isPlayerCity == false) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 52, ""); // Cannot place outisde a guild zone
|
PlaceAssetMsg.sendPlaceAssetError(origin, 52, ""); // Cannot place outisde a guild zone
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -749,8 +749,8 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
cityObjects = DbManager.CityQueries.CREATE_CITY(playerCharacter.getObjectUUID(), serverZone.getObjectUUID(),
|
cityObjects = DbManager.CityQueries.CREATE_CITY(playerCharacter.getObjectUUID(), serverZone.getObjectUUID(),
|
||||||
serverRealm.getRealmID(),
|
serverRealm.getRealmID(),
|
||||||
plantLoc.x - serverZone.getAbsX(), plantLoc.y,
|
plantLoc.x - serverZone.absX, plantLoc.y,
|
||||||
plantLoc.z - serverZone.getAbsZ(), treeInfo.getRot().y, treeInfo.getW(), playerCharacter.getGuild().getName(), LocalDateTime.now());
|
plantLoc.z - serverZone.absZ, treeInfo.getRot().y, treeInfo.getW(), playerCharacter.getGuild().getName(), LocalDateTime.now());
|
||||||
|
|
||||||
// Uh oh!
|
// Uh oh!
|
||||||
|
|
||||||
@@ -783,10 +783,10 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
// Link the zone with the city and then add
|
// Link the zone with the city and then add
|
||||||
// to the appropriate hash tables and cache
|
// to the appropriate hash tables and cache
|
||||||
|
|
||||||
zoneObject.setPlayerCity(true);
|
zoneObject.isPlayerCity = true;
|
||||||
|
|
||||||
if (zoneObject.getParent() != null)
|
if (zoneObject.parent != null)
|
||||||
zoneObject.getParent().addNode(zoneObject); //add as child to parent
|
zoneObject.parent.addNode(zoneObject); //add as child to parent
|
||||||
|
|
||||||
ZoneManager.addZone(zoneObject.getObjectUUID(), zoneObject);
|
ZoneManager.addZone(zoneObject.getObjectUUID(), zoneObject);
|
||||||
ZoneManager.addPlayerCityZone(zoneObject);
|
ZoneManager.addPlayerCityZone(zoneObject);
|
||||||
@@ -857,7 +857,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (serverZone == null)
|
if (serverZone == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
cityObject = City.getCity(serverZone.getPlayerCityUUID());
|
cityObject = City.getCity(serverZone.playerCityID);
|
||||||
|
|
||||||
if (cityObject == null)
|
if (cityObject == null)
|
||||||
return false;
|
return false;
|
||||||
@@ -931,7 +931,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
int shrineCount = 0;
|
int shrineCount = 0;
|
||||||
|
|
||||||
cityObject = City.getCity(serverZone.getPlayerCityUUID());
|
cityObject = City.getCity(serverZone.playerCityID);
|
||||||
|
|
||||||
// Cannot place shrine in abandoned city. Shrines must be owned
|
// Cannot place shrine in abandoned city. Shrines must be owned
|
||||||
// by the tol owner not the person placing them.
|
// by the tol owner not the person placing them.
|
||||||
@@ -1001,7 +1001,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
int barracksCount = 0;
|
int barracksCount = 0;
|
||||||
|
|
||||||
cityObject = City.getCity(serverZone.getPlayerCityUUID());
|
cityObject = City.getCity(serverZone.playerCityID);
|
||||||
|
|
||||||
// Cannot place barracks in abandoned city.
|
// Cannot place barracks in abandoned city.
|
||||||
|
|
||||||
@@ -1061,7 +1061,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (validateCityBuildingPlacement(serverZone, msg, origin, player, msg.getFirstPlacementInfo()) == false)
|
if (validateCityBuildingPlacement(serverZone, msg, origin, player, msg.getFirstPlacementInfo()) == false)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
cityObject = City.getCity(serverZone.getPlayerCityUUID());
|
cityObject = City.getCity(serverZone.playerCityID);
|
||||||
|
|
||||||
// We need to be able to access how much gold a character is carrying
|
// We need to be able to access how much gold a character is carrying
|
||||||
|
|
||||||
@@ -1117,7 +1117,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
building.removeFromCache();
|
building.removeFromCache();
|
||||||
WorldGrid.RemoveWorldObject(building);
|
WorldGrid.RemoveWorldObject(building);
|
||||||
WorldGrid.removeObject(building);
|
WorldGrid.removeObject(building);
|
||||||
building.getParentZone().getParent().zoneBuildingSet.remove(building);
|
building.getParentZone().parent.zoneBuildingSet.remove(building);
|
||||||
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup().equals(BuildingGroup.BARRACK)) {
|
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup().equals(BuildingGroup.BARRACK)) {
|
||||||
building.RemoveFromBarracksList();
|
building.RemoveFromBarracksList();
|
||||||
}
|
}
|
||||||
@@ -1229,7 +1229,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
shrineType = Shrine.getShrineTypeByBlueprintUUID(blueprint.getBlueprintUUID());
|
shrineType = Shrine.getShrineTypeByBlueprintUUID(blueprint.getBlueprintUUID());
|
||||||
|
|
||||||
city = City.getCity(currentZone.getPlayerCityUUID());
|
city = City.getCity(currentZone.playerCityID);
|
||||||
|
|
||||||
if (city == null)
|
if (city == null)
|
||||||
return false;
|
return false;
|
||||||
@@ -1294,7 +1294,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
city = City.getCity(currentZone.getPlayerCityUUID());
|
city = City.getCity(currentZone.playerCityID);
|
||||||
|
|
||||||
if (city == null)
|
if (city == null)
|
||||||
return false;
|
return false;
|
||||||
@@ -1369,7 +1369,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
newMesh.runAfterLoad();
|
newMesh.runAfterLoad();
|
||||||
} else if (ago.getObjectType() == GameObjectType.Warehouse) {
|
} else if (ago.getObjectType() == GameObjectType.Warehouse) {
|
||||||
Warehouse warehouse = (Warehouse) ago;
|
Warehouse warehouse = (Warehouse) ago;
|
||||||
City city = City.getCity(currentZone.getPlayerCityUUID());
|
City city = City.getCity(currentZone.playerCityID);
|
||||||
|
|
||||||
if (city == null)
|
if (city == null)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
serverZone = ZoneManager.findSmallestZone(pc.getLoc());
|
serverZone = ZoneManager.findSmallestZone(pc.getLoc());
|
||||||
|
|
||||||
if (serverZone.getPlayerCityUUID() == 0 && targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.MINE)
|
if (serverZone.playerCityID == 0 && targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.MINE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
City city = City.GetCityFromCache(serverZone.getPlayerCityUUID());
|
City city = City.GetCityFromCache(serverZone.playerCityID);
|
||||||
|
|
||||||
if (city != null) {
|
if (city != null) {
|
||||||
if (city.getBane() != null && city.protectionEnforced == false)
|
if (city.getBane() != null && city.protectionEnforced == false)
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class CityAssetMsg extends ClientNetMsg {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
city = City.getCity(zone.getPlayerCityUUID());
|
city = City.getCity(zone.playerCityID);
|
||||||
|
|
||||||
if (city == null) {
|
if (city == null) {
|
||||||
Logger.debug("Failed to load city data for Tree of life.");
|
Logger.debug("Failed to load city data for Tree of life.");
|
||||||
|
|||||||
@@ -117,8 +117,8 @@ public class GuildTreeStatusMsg extends ClientNetMsg {
|
|||||||
city = null;
|
city = null;
|
||||||
|
|
||||||
if (cityZone != null)
|
if (cityZone != null)
|
||||||
if (cityZone.isPlayerCity())
|
if (cityZone.isPlayerCity)
|
||||||
city = City.GetCityFromCache(cityZone.getPlayerCityUUID());
|
city = City.GetCityFromCache(cityZone.playerCityID);
|
||||||
else if (this.treeOfLife != null && this.treeOfLife.getGuild() != null)
|
else if (this.treeOfLife != null && this.treeOfLife.getGuild() != null)
|
||||||
city = this.treeOfLife.getGuild().getOwnedCity();
|
city = this.treeOfLife.getGuild().getOwnedCity();
|
||||||
|
|
||||||
|
|||||||
@@ -299,8 +299,8 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
|
|||||||
Set<Building> buildings = ZoneManager.findSmallestZone(assetManager.getLoc()).zoneBuildingSet;
|
Set<Building> buildings = ZoneManager.findSmallestZone(assetManager.getLoc()).zoneBuildingSet;
|
||||||
|
|
||||||
Building tol = null;
|
Building tol = null;
|
||||||
if (playerZone.getPlayerCityUUID() != 0)
|
if (playerZone.playerCityID != 0)
|
||||||
city = City.GetCityFromCache(playerZone.getPlayerCityUUID());
|
city = City.GetCityFromCache(playerZone.playerCityID);
|
||||||
|
|
||||||
if (city != null)
|
if (city != null)
|
||||||
tol = city.getTOL();
|
tol = city.getTOL();
|
||||||
@@ -368,7 +368,7 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
|
|||||||
if (zone == null)
|
if (zone == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
City banedCity = City.getCity(zone.getPlayerCityUUID());
|
City banedCity = City.getCity(zone.playerCityID);
|
||||||
|
|
||||||
if (banedCity == null)
|
if (banedCity == null)
|
||||||
return;
|
return;
|
||||||
@@ -479,7 +479,7 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
|
|||||||
if (zone == null)
|
if (zone == null)
|
||||||
writer.putString("Forlord");
|
writer.putString("Forlord");
|
||||||
else
|
else
|
||||||
writer.putString(zone.getName());
|
writer.putString(zone.zoneName);
|
||||||
|
|
||||||
writer.putString(building.getGuild().getName());
|
writer.putString(building.getGuild().getName());
|
||||||
|
|
||||||
@@ -621,9 +621,9 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
|
|||||||
} else {
|
} else {
|
||||||
writer.putInt(1); //kos on/off?
|
writer.putInt(1); //kos on/off?
|
||||||
writer.putInt(3); // was 3
|
writer.putInt(3); // was 3
|
||||||
if (zone.getPlayerCityUUID() != 0 && asset.assetIsProtected()) {
|
if (zone.playerCityID != 0 && asset.assetIsProtected()) {
|
||||||
writer.putInt(GameObjectType.Building.ordinal());
|
writer.putInt(GameObjectType.Building.ordinal());
|
||||||
writer.putInt(City.getCity(zone.getPlayerCityUUID()).getTOL().getObjectUUID());
|
writer.putInt(City.getCity(zone.playerCityID).getTOL().getObjectUUID());
|
||||||
} else {
|
} else {
|
||||||
writer.putInt(0);
|
writer.putInt(0);
|
||||||
writer.putInt(0);
|
writer.putInt(0);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class ViewResourcesMessage extends ClientNetMsg {
|
|||||||
if (this.warehouseBuilding.getParentZone() == null)
|
if (this.warehouseBuilding.getParentZone() == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
this.city = (City) DbManager.getObject(Enum.GameObjectType.City, this.warehouseBuilding.getParentZone().getPlayerCityUUID());
|
this.city = (City) DbManager.getObject(Enum.GameObjectType.City, this.warehouseBuilding.getParentZone().playerCityID);
|
||||||
|
|
||||||
if (this.city == null)
|
if (this.city == null)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
|||||||
ArrayList<Zone> allIn = ZoneManager.getAllZonesIn(this.getLoc());
|
ArrayList<Zone> allIn = ZoneManager.getAllZonesIn(this.getLoc());
|
||||||
|
|
||||||
for (Zone zone : allIn)
|
for (Zone zone : allIn)
|
||||||
if (zone.getSafeZone() == (byte) 1)
|
if (zone.peaceZone == (byte) 1)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -162,8 +162,8 @@ public final class Bane {
|
|||||||
|
|
||||||
// Cannot place assets on a dead tree
|
// Cannot place assets on a dead tree
|
||||||
|
|
||||||
if ((cityZone.isPlayerCity()) &&
|
if ((cityZone.isPlayerCity) &&
|
||||||
(City.getCity(cityZone.getPlayerCityUUID()).getTOL().getRank() == -1)) {
|
(City.getCity(cityZone.playerCityID).getTOL().getRank() == -1)) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 1, "Cannot bane a dead tree!");
|
PlaceAssetMsg.sendPlaceAssetError(origin, 1, "Cannot bane a dead tree!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -460,10 +460,10 @@ public class Building extends AbstractWorldObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.parentZone.isPlayerCity() == false)
|
if (this.parentZone.isPlayerCity == false)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return City.getCity(this.parentZone.getPlayerCityUUID());
|
return City.getCity(this.parentZone.playerCityID);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1402,7 +1402,7 @@ public class Building extends AbstractWorldObject {
|
|||||||
// Buildings on an npc citygrid are never vulnerable
|
// Buildings on an npc citygrid are never vulnerable
|
||||||
|
|
||||||
if (this.getCity() != null) {
|
if (this.getCity() != null) {
|
||||||
if (this.getCity().getParent().isNPCCity() == true)
|
if (this.getCity().getParent().isNPCCity == true)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ public class City extends AbstractWorldObject {
|
|||||||
if (city.noTeleport)
|
if (city.noTeleport)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (city.parentZone != null && city.parentZone.isPlayerCity()) {
|
if (city.parentZone != null && city.parentZone.isPlayerCity) {
|
||||||
|
|
||||||
if (pc.getAccount().status.equals(AccountStatus.ADMIN)) {
|
if (pc.getAccount().status.equals(AccountStatus.ADMIN)) {
|
||||||
cities.add(city);
|
cities.add(city);
|
||||||
@@ -395,7 +395,7 @@ public class City extends AbstractWorldObject {
|
|||||||
if (city.noRepledge)
|
if (city.noRepledge)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (city.parentZone != null && city.parentZone.isPlayerCity()) {
|
if (city.parentZone != null && city.parentZone.isPlayerCity) {
|
||||||
|
|
||||||
//list Player cities
|
//list Player cities
|
||||||
//open city, just list
|
//open city, just list
|
||||||
@@ -589,7 +589,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
if (zone.getHeightMap() == null && this.isNpc == 1 && this.getObjectUUID() != 1213) {
|
if (zone.getHeightMap() == null && this.isNpc == 1 && this.getObjectUUID() != 1213) {
|
||||||
HeightMap.GenerateCustomHeightMap(zone);
|
HeightMap.GenerateCustomHeightMap(zone);
|
||||||
Logger.info(zone.getName() + " created custom heightmap");
|
Logger.info(zone.zoneName + " created custom heightmap");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(e);
|
Logger.error(e);
|
||||||
@@ -791,7 +791,7 @@ public class City extends AbstractWorldObject {
|
|||||||
// Any players currently in the zone will not be processed by the heartbeat
|
// Any players currently in the zone will not be processed by the heartbeat
|
||||||
// if it's not the first effect toggled so we do it here manually
|
// if it's not the first effect toggled so we do it here manually
|
||||||
|
|
||||||
currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, this.parentZone.getBounds().getHalfExtents().x * 1.2f, MBServerStatics.MASK_PLAYER);
|
currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, this.parentZone.bounds.getHalfExtents().x * 1.2f, MBServerStatics.MASK_PLAYER);
|
||||||
|
|
||||||
for (AbstractWorldObject playerObject : currentPlayers) {
|
for (AbstractWorldObject playerObject : currentPlayers) {
|
||||||
|
|
||||||
@@ -874,7 +874,7 @@ public class City extends AbstractWorldObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLocationOnCityZone(Vector3fImmutable insideLoc) {
|
public boolean isLocationOnCityZone(Vector3fImmutable insideLoc) {
|
||||||
return Bounds.collide(insideLoc, this.parentZone.getBounds());
|
return Bounds.collide(insideLoc, this.parentZone.bounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyAllCityEffects(PlayerCharacter player) {
|
private void applyAllCityEffects(PlayerCharacter player) {
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class ItemFactory {
|
|||||||
if (zone == null)
|
if (zone == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
City city = City.getCity(zone.getPlayerCityUUID());
|
City city = City.getCity(zone.playerCityID);
|
||||||
|
|
||||||
if (city == null)
|
if (city == null)
|
||||||
return null;
|
return null;
|
||||||
@@ -796,7 +796,7 @@ public class ItemFactory {
|
|||||||
if (zone == null)
|
if (zone == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
City city = City.getCity(zone.getPlayerCityUUID());
|
City city = City.getCity(zone.playerCityID);
|
||||||
|
|
||||||
if (city == null)
|
if (city == null)
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
this.flags = rs.getInt("flags");
|
this.flags = rs.getInt("flags");
|
||||||
int parent = rs.getInt("parent");
|
int parent = rs.getInt("parent");
|
||||||
this.parentZone = ZoneManager.getZoneByUUID(parent);
|
this.parentZone = ZoneManager.getZoneByUUID(parent);
|
||||||
this.zoneName = this.parentZone.getParent().getName();
|
this.zoneName = this.parentZone.parent.zoneName;
|
||||||
|
|
||||||
this.owningGuild = Guild.getGuild(ownerUID);
|
this.owningGuild = Guild.getGuild(ownerUID);
|
||||||
Guild nation = null;
|
Guild nation = null;
|
||||||
@@ -129,7 +129,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
|
|
||||||
mine.getTimestamps().put("MineAttack", System.currentTimeMillis() + MBServerStatics.ONE_MINUTE);
|
mine.getTimestamps().put("MineAttack", System.currentTimeMillis() + MBServerStatics.ONE_MINUTE);
|
||||||
|
|
||||||
ChatManager.chatNationInfo(mine.getGuild().getNation(), mine.getName() + " in " + mine.getParentZone().getParent().getName() + " is Under attack!");
|
ChatManager.chatNationInfo(mine.getGuild().getNation(), mine.getName() + " in " + mine.getParentZone().parent.zoneName + " is Under attack!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadAllMines() {
|
public static void loadAllMines() {
|
||||||
|
|||||||
@@ -894,7 +894,7 @@ public class NPC extends AbstractCharacter {
|
|||||||
this.stamina.set(this.staminaMax);
|
this.stamina.set(this.staminaMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.parentZone.isPlayerCity())
|
if (this.parentZone.isPlayerCity)
|
||||||
if (NPC.GetNPCProfits(this) == null)
|
if (NPC.GetNPCProfits(this) == null)
|
||||||
NPCProfits.CreateProfits(this);
|
NPCProfits.CreateProfits(this);
|
||||||
|
|
||||||
@@ -1192,7 +1192,7 @@ public class NPC extends AbstractCharacter {
|
|||||||
if (serverZone == null)
|
if (serverZone == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
city = City.GetCityFromCache(serverZone.getPlayerCityUUID());
|
city = City.GetCityFromCache(serverZone.playerCityID);
|
||||||
|
|
||||||
if (city == null) {
|
if (city == null) {
|
||||||
|
|
||||||
|
|||||||
@@ -1507,16 +1507,16 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
return true;
|
return true;
|
||||||
Zone zone = ZoneManager.findSmallestZone(breather.getLoc());
|
Zone zone = ZoneManager.findSmallestZone(breather.getLoc());
|
||||||
|
|
||||||
if (zone.getSeaLevel() != 0) {
|
if (zone.seaLevel != 0) {
|
||||||
|
|
||||||
float localAltitude = breather.getLoc().y;
|
float localAltitude = breather.getLoc().y;
|
||||||
|
|
||||||
|
|
||||||
if (localAltitude + breather.characterHeight < zone.getSeaLevel() - 2)
|
if (localAltitude + breather.characterHeight < zone.seaLevel - 2)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (breather.isMoving()) {
|
if (breather.isMoving()) {
|
||||||
if (localAltitude + breather.characterHeight < zone.getSeaLevel())
|
if (localAltitude + breather.characterHeight < zone.seaLevel)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1547,12 +1547,12 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
Zone zone = ZoneManager.findSmallestZone(enterer.getLoc());
|
Zone zone = ZoneManager.findSmallestZone(enterer.getLoc());
|
||||||
|
|
||||||
if (zone.getSeaLevel() != 0) {
|
if (zone.seaLevel != 0) {
|
||||||
|
|
||||||
float localAltitude = enterer.getLoc().y + enterer.characterHeight;
|
float localAltitude = enterer.getLoc().y + enterer.characterHeight;
|
||||||
|
|
||||||
|
|
||||||
if (localAltitude < zone.getSeaLevel())
|
if (localAltitude < zone.seaLevel)
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (enterer.getLoc().y + enterer.characterHeight < 0)
|
if (enterer.getLoc().y + enterer.characterHeight < 0)
|
||||||
@@ -1579,12 +1579,12 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
leaveWater = 1f;
|
leaveWater = 1f;
|
||||||
|
|
||||||
|
|
||||||
if (zone.getSeaLevel() != 0) {
|
if (zone.seaLevel != 0) {
|
||||||
|
|
||||||
float localAltitude = leaver.getLoc().y;
|
float localAltitude = leaver.getLoc().y;
|
||||||
|
|
||||||
|
|
||||||
if (localAltitude + leaveWater < zone.getSeaLevel())
|
if (localAltitude + leaveWater < zone.seaLevel)
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (leaver.getLoc().y + leaveWater < 0)
|
if (leaver.getLoc().y + leaveWater < 0)
|
||||||
@@ -1703,7 +1703,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
Zone zone = ZoneManager.findSmallestZone(this.getLoc());
|
Zone zone = ZoneManager.findSmallestZone(this.getLoc());
|
||||||
|
|
||||||
if (zone != null) {
|
if (zone != null) {
|
||||||
return zone.getSafeZone() == (byte) 1;
|
return zone.peaceZone == (byte) 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -1797,7 +1797,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
//DeathShroud
|
//DeathShroud
|
||||||
|
|
||||||
if (zone.getSafeZone() == 0)
|
if (zone.peaceZone == 0)
|
||||||
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
|
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
|
||||||
|
|
||||||
//enable this to give players deathshroud if mobs kill player.
|
//enable this to give players deathshroud if mobs kill player.
|
||||||
@@ -1843,7 +1843,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
//DeathShroud
|
//DeathShroud
|
||||||
|
|
||||||
if (zone.getSafeZone() == 0)
|
if (zone.peaceZone == 0)
|
||||||
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
|
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
|
||||||
|
|
||||||
if (doPVPEXP) {
|
if (doPVPEXP) {
|
||||||
@@ -1898,7 +1898,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
killCleanup();
|
killCleanup();
|
||||||
Zone zone = ZoneManager.findSmallestZone(this.getLoc());
|
Zone zone = ZoneManager.findSmallestZone(this.getLoc());
|
||||||
|
|
||||||
if (zone.getSafeZone() == 0)
|
if (zone.peaceZone == 0)
|
||||||
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
|
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
|
||||||
|
|
||||||
// Send death message if needed
|
// Send death message if needed
|
||||||
@@ -4739,10 +4739,10 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
Zone zone = ZoneManager.findSmallestZone(this.getLoc());
|
Zone zone = ZoneManager.findSmallestZone(this.getLoc());
|
||||||
|
|
||||||
if (zone.getSeaLevel() != 0) {
|
if (zone.seaLevel != 0) {
|
||||||
|
|
||||||
float localAltitude = this.getLoc().y + this.centerHeight;
|
float localAltitude = this.getLoc().y + this.centerHeight;
|
||||||
if (localAltitude < zone.getSeaLevel())
|
if (localAltitude < zone.seaLevel)
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (this.getLoc().y + this.centerHeight < 0)
|
if (this.getLoc().y + this.centerHeight < 0)
|
||||||
@@ -4764,9 +4764,9 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
|
|
||||||
Zone zone = ZoneManager.findSmallestZone(currentLoc);
|
Zone zone = ZoneManager.findSmallestZone(currentLoc);
|
||||||
|
|
||||||
if (zone.getSeaLevel() != 0) {
|
if (zone.seaLevel != 0) {
|
||||||
|
|
||||||
if (localAltitude < zone.getSeaLevel())
|
if (localAltitude < zone.seaLevel)
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (localAltitude < 0)
|
if (localAltitude < 0)
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class Runegate {
|
|||||||
|
|
||||||
writer.putInt(gateBuilding.getObjectType().ordinal());
|
writer.putInt(gateBuilding.getObjectType().ordinal());
|
||||||
writer.putInt(gateBuilding.getObjectUUID());
|
writer.putInt(gateBuilding.getObjectUUID());
|
||||||
writer.putString(gateBuilding.getParentZone().getName());
|
writer.putString(gateBuilding.getParentZone().zoneName);
|
||||||
writer.putFloat(gateBuilding.getLoc().getLat());
|
writer.putFloat(gateBuilding.getLoc().getLat());
|
||||||
writer.putFloat(gateBuilding.getLoc().getAlt());
|
writer.putFloat(gateBuilding.getLoc().getAlt());
|
||||||
writer.putFloat(gateBuilding.getLoc().getLong());
|
writer.putFloat(gateBuilding.getLoc().getLong());
|
||||||
|
|||||||
@@ -1272,7 +1272,7 @@ public class Warehouse extends AbstractWorldObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
City city = City.getCity(cityZone.getPlayerCityUUID());
|
City city = City.getCity(cityZone.playerCityID);
|
||||||
|
|
||||||
if (city == null) {
|
if (city == null) {
|
||||||
Logger.error("Failed to load City for Warehouse with UUID " + this.getObjectUUID());
|
Logger.error("Failed to load City for Warehouse with UUID " + this.getObjectUUID());
|
||||||
|
|||||||
+25
-104
@@ -33,31 +33,31 @@ public class Zone extends AbstractGameObject {
|
|||||||
public final Set<Building> zoneBuildingSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
public final Set<Building> zoneBuildingSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||||
public final Set<NPC> zoneNPCSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
public final Set<NPC> zoneNPCSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||||
public final Set<Mob> zoneMobSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
public final Set<Mob> zoneMobSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||||
private final int playerCityID;
|
public final int playerCityID;
|
||||||
private final String zoneName;
|
public final String zoneName;
|
||||||
private final float xCoord;
|
public final float xCoord;
|
||||||
private final float zCoord;
|
public final float zCoord;
|
||||||
private final float yCoord;
|
public final float yCoord;
|
||||||
private final int loadNum;
|
public final int loadNum;
|
||||||
private final byte safeZone;
|
public final byte peaceZone;
|
||||||
private final String Icon1;
|
public final String Icon1;
|
||||||
private final String Icon2;
|
public final String Icon2;
|
||||||
private final String Icon3;
|
public final String Icon3;
|
||||||
public float absX = 0.0f;
|
public float absX = 0.0f;
|
||||||
public float absY = 0.0f;
|
public float absY = 0.0f;
|
||||||
public float absZ = 0.0f;
|
public float absZ = 0.0f;
|
||||||
public int minLvl;
|
public int minLvl;
|
||||||
public int maxLvl;
|
public int maxLvl;
|
||||||
public boolean hasBeenHotzone = false;
|
public boolean hasBeenHotzone = false;
|
||||||
private ArrayList<Zone> nodes = null;
|
public ArrayList<Zone> nodes = null;
|
||||||
private int parentZoneID;
|
public int parentZoneID;
|
||||||
private Zone parent = null;
|
public Zone parent = null;
|
||||||
private Bounds bounds;
|
public Bounds bounds;
|
||||||
private boolean isNPCCity = false;
|
public boolean isNPCCity = false;
|
||||||
private boolean isPlayerCity = false;
|
public boolean isPlayerCity = false;
|
||||||
private String hash;
|
public String hash;
|
||||||
public float worldAltitude = 0;
|
public float worldAltitude = 0;
|
||||||
private float seaLevel = 0f;
|
public float seaLevel = 0f;
|
||||||
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 Bounds maxBlend;
|
public Bounds maxBlend;
|
||||||
@@ -75,7 +75,7 @@ public class Zone extends AbstractGameObject {
|
|||||||
this.zCoord = rs.getFloat("ZCoord");
|
this.zCoord = rs.getFloat("ZCoord");
|
||||||
this.yCoord = rs.getFloat("YOffset");
|
this.yCoord = rs.getFloat("YOffset");
|
||||||
this.loadNum = rs.getInt("LoadNum");
|
this.loadNum = rs.getInt("LoadNum");
|
||||||
this.safeZone = rs.getByte("SafeZone");
|
this.peaceZone = rs.getByte("SafeZone");
|
||||||
this.Icon1 = rs.getString("Icon1");
|
this.Icon1 = rs.getString("Icon1");
|
||||||
this.Icon2 = rs.getString("Icon2");
|
this.Icon2 = rs.getString("Icon2");
|
||||||
this.Icon3 = rs.getString("Icon3");
|
this.Icon3 = rs.getString("Icon3");
|
||||||
@@ -147,7 +147,7 @@ public class Zone extends AbstractGameObject {
|
|||||||
writer.putString(city.getCityName());
|
writer.putString(city.getCityName());
|
||||||
else
|
else
|
||||||
writer.putString(zone.zoneName);
|
writer.putString(zone.zoneName);
|
||||||
writer.put(zone.safeZone);
|
writer.put(zone.peaceZone);
|
||||||
writer.putString(zone.Icon1);
|
writer.putString(zone.Icon1);
|
||||||
writer.putString(zone.Icon2);
|
writer.putString(zone.Icon2);
|
||||||
writer.putString(zone.Icon3);
|
writer.putString(zone.Icon3);
|
||||||
@@ -182,50 +182,14 @@ public class Zone extends AbstractGameObject {
|
|||||||
// Set heightmap blending bounds
|
// Set heightmap blending bounds
|
||||||
|
|
||||||
if (heightMap == null) {
|
if (heightMap == null) {
|
||||||
this.maxBlend = this.getBounds();
|
this.maxBlend = bounds;
|
||||||
} else {
|
} else {
|
||||||
this.maxBlend = Bounds.borrow();
|
this.maxBlend = Bounds.borrow();
|
||||||
this.maxBlend.setBounds(new Vector2f(this.absX, this.absZ), this.getBounds().getHalfExtents().subtract(heightMap.zone_minBlend, heightMap.zone_minBlend), 0.0f);
|
this.maxBlend.setBounds(new Vector2f(this.absX, this.absZ), bounds.getHalfExtents().subtract(heightMap.zone_minBlend, heightMap.zone_minBlend), 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPlayerCityUUID() {
|
|
||||||
return this.playerCityID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return zoneName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getXCoord() {
|
|
||||||
return xCoord;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getYCoord() {
|
|
||||||
return yCoord;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getZCoord() {
|
|
||||||
return zCoord;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLoadNum() {
|
|
||||||
return loadNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte getSafeZone() {
|
|
||||||
return safeZone;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIcon1() {
|
|
||||||
return Icon1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Zone getParent() {
|
|
||||||
return this.parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParent(final Zone value) {
|
public void setParent(final Zone value) {
|
||||||
|
|
||||||
this.parent = value;
|
this.parent = value;
|
||||||
@@ -254,7 +218,7 @@ public class Zone extends AbstractGameObject {
|
|||||||
this.setBounds();
|
this.setBounds();
|
||||||
this.worldAltitude = ZoneManager.caclulateWorldAltitude(this);
|
this.worldAltitude = ZoneManager.caclulateWorldAltitude(this);
|
||||||
|
|
||||||
if (this.getParent() == null) {
|
if (this.parent == null) {
|
||||||
this.seaLevel = MBServerStatics.SEA_FLOOR_ALTITUDE;
|
this.seaLevel = MBServerStatics.SEA_FLOOR_ALTITUDE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -271,18 +235,6 @@ public class Zone extends AbstractGameObject {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getAbsX() {
|
|
||||||
return this.absX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getAbsY() {
|
|
||||||
return this.absY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getAbsZ() {
|
|
||||||
return this.absZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMacroZone() {
|
public boolean isMacroZone() {
|
||||||
|
|
||||||
// Macro zones have icons.
|
// Macro zones have icons.
|
||||||
@@ -293,23 +245,7 @@ public class Zone extends AbstractGameObject {
|
|||||||
if (this.parent == null)
|
if (this.parent == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return !this.getIcon1().equals("");
|
return !Icon1.equals("");
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isNPCCity() {
|
|
||||||
return this.isNPCCity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNPCCity(boolean value) {
|
|
||||||
this.isNPCCity = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPlayerCity() {
|
|
||||||
return this.isPlayerCity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPlayerCity(boolean value) {
|
|
||||||
this.isPlayerCity = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3fImmutable getLoc() {
|
public Vector3fImmutable getLoc() {
|
||||||
@@ -358,21 +294,10 @@ public class Zone extends AbstractGameObject {
|
|||||||
if (this.getNodes().get(0).isMacroZone())
|
if (this.getNodes().get(0).isMacroZone())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return this.getParent().equals(ZoneManager.getSeaFloor());
|
return this.parent.equals(ZoneManager.getSeaFloor());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the bounds
|
|
||||||
*/
|
|
||||||
public Bounds getBounds() {
|
|
||||||
return bounds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getHash() {
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHash() {
|
public void setHash() {
|
||||||
|
|
||||||
this.hash = DataWarehouse.hasher.encrypt(this.getObjectUUID());
|
this.hash = DataWarehouse.hasher.encrypt(this.getObjectUUID());
|
||||||
@@ -392,8 +317,4 @@ public class Zone extends AbstractGameObject {
|
|||||||
return HeightMap.heightmapByLoadNum.get(this.loadNum);
|
return HeightMap.heightmapByLoadNum.get(this.loadNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getSeaLevel() {
|
|
||||||
return seaLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class SummonPowerAction extends AbstractPowerAction {
|
|||||||
String location = "Somewhere";
|
String location = "Somewhere";
|
||||||
|
|
||||||
if (zone != null)
|
if (zone != null)
|
||||||
location = zone.getName();
|
location = zone.zoneName;
|
||||||
|
|
||||||
RecvSummonsRequestMsg rsrm = new RecvSummonsRequestMsg(source.getObjectType().ordinal(), source.getObjectUUID(), source.getFirstName(),
|
RecvSummonsRequestMsg rsrm = new RecvSummonsRequestMsg(source.getObjectType().ordinal(), source.getObjectUUID(), source.getFirstName(),
|
||||||
location, false);
|
location, false);
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ public class WorldServer {
|
|||||||
for (Zone zone : ZoneManager.getAllZones()) {
|
for (Zone zone : ZoneManager.getAllZones()) {
|
||||||
if (zone.getHeightMap() != null) {
|
if (zone.getHeightMap() != null) {
|
||||||
if (zone.getHeightMap().bucketWidthX == 0) {
|
if (zone.getHeightMap().bucketWidthX == 0) {
|
||||||
System.out.println("Zone load num: " + zone.getLoadNum() + " has no bucket width");
|
System.out.println("Zone load num: " + zone.loadNum + " has no bucket width");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -565,7 +565,7 @@ public class WorldServer {
|
|||||||
|
|
||||||
for (Zone zone : rootParent) {
|
for (Zone zone : rootParent) {
|
||||||
|
|
||||||
ZoneManager.addZone(zone.getLoadNum(), zone);
|
ZoneManager.addZone(zone.loadNum, zone);
|
||||||
|
|
||||||
//Handle Buildings
|
//Handle Buildings
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class DestroyCityThread implements Runnable {
|
|||||||
// Member variable assignment
|
// Member variable assignment
|
||||||
|
|
||||||
cityZone = city.getParent();
|
cityZone = city.getParent();
|
||||||
newParent = cityZone.getParent();
|
newParent = cityZone.parent;
|
||||||
formerGuild = city.getTOL().getGuild();
|
formerGuild = city.getTOL().getGuild();
|
||||||
|
|
||||||
// Former guild loses it's tree!
|
// Former guild loses it's tree!
|
||||||
@@ -150,6 +150,6 @@ public class DestroyCityThread implements Runnable {
|
|||||||
// Zone and city should vanish upon next reboot
|
// Zone and city should vanish upon next reboot
|
||||||
// if the codebase reaches here.
|
// if the codebase reaches here.
|
||||||
|
|
||||||
Logger.info(city.getParent().getName() + " uuid:" + city.getObjectUUID() + "has been destroyed!");
|
Logger.info(city.getParent().zoneName + " uuid:" + city.getObjectUUID() + "has been destroyed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public class HourlyJobThread implements Runnable {
|
|||||||
mineBuilding.rebuildMine();
|
mineBuilding.rebuildMine();
|
||||||
WorldGrid.updateObject(mineBuilding);
|
WorldGrid.updateObject(mineBuilding);
|
||||||
|
|
||||||
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mine.lastClaimer.getName() + " has claimed the mine in " + mine.getParentZone().getParent().getName() + " for " + mine.getOwningGuild().getName() + ". The mine is no longer active.");
|
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mine.lastClaimer.getName() + " has claimed the mine in " + mine.getParentZone().parent.zoneName + " for " + mine.getOwningGuild().getName() + ". The mine is no longer active.");
|
||||||
chatMsg.setMessageType(10);
|
chatMsg.setMessageType(10);
|
||||||
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
|
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
|
||||||
DispatchMessage.dispatchMsgToAll(chatMsg);
|
DispatchMessage.dispatchMsgToAll(chatMsg);
|
||||||
@@ -205,7 +205,7 @@ public class HourlyJobThread implements Runnable {
|
|||||||
if (ZoneManager.hotZone == null) {
|
if (ZoneManager.hotZone == null) {
|
||||||
Logger.error("Null HotZone returned from ZoneManager");
|
Logger.error("Null HotZone returned from ZoneManager");
|
||||||
} else {
|
} else {
|
||||||
Logger.info("HotZone switched to: " + ZoneManager.hotZone.getName());
|
Logger.info("HotZone switched to: " + ZoneManager.hotZone.zoneName);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user