forked from MagicBane/Server
class and table schema now conform to JSON
This commit is contained in:
@@ -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.isPlayerCity == false) {
|
||||
if (serverZone.isGuildZone == false) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 52, player.getName());
|
||||
return false;
|
||||
}
|
||||
@@ -201,8 +201,8 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// Cannot place assets on a dead tree
|
||||
|
||||
if ((serverZone.isPlayerCity)
|
||||
&& (City.getCity(serverZone.playerCityID).getTOL().getRank() == -1)) {
|
||||
if ((serverZone.isGuildZone)
|
||||
&& (City.getCity(serverZone.playerCityUUID).getTOL().getRank() == -1)) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 1, "Cannot place asset on dead tree until world heals");
|
||||
return false;
|
||||
}
|
||||
@@ -261,14 +261,14 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// Must be a player city
|
||||
|
||||
if (serverZone.isPlayerCity == false) {
|
||||
if (serverZone.isGuildZone == false) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 41, player.getName()); // Cannot place outside a guild zone
|
||||
return false;
|
||||
}
|
||||
|
||||
//Test zone has a city object
|
||||
|
||||
City city = City.getCity(serverZone.playerCityID);
|
||||
City city = City.getCity(serverZone.playerCityUUID);
|
||||
|
||||
if (city == null) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 52, ""); //"no city to associate asset with"
|
||||
@@ -512,7 +512,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
if (serverZone == null)
|
||||
return false;
|
||||
|
||||
cityObject = City.getCity(serverZone.playerCityID);
|
||||
cityObject = City.getCity(serverZone.playerCityUUID);
|
||||
|
||||
// Early exit if something went horribly wrong
|
||||
|
||||
@@ -571,7 +571,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// No valid player city found
|
||||
|
||||
if (serverCity == null || serverCity.getParent().isPlayerCity == false) {
|
||||
if (serverCity == null || serverCity.getParent().isGuildZone == 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.isPlayerCity = true;
|
||||
zoneObject.isGuildZone = true;
|
||||
|
||||
if (zoneObject.parent != null)
|
||||
zoneObject.parent.addNode(zoneObject); //add as child to parent
|
||||
@@ -857,7 +857,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
if (serverZone == null)
|
||||
return false;
|
||||
|
||||
cityObject = City.getCity(serverZone.playerCityID);
|
||||
cityObject = City.getCity(serverZone.playerCityUUID);
|
||||
|
||||
if (cityObject == null)
|
||||
return false;
|
||||
@@ -931,7 +931,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
int shrineCount = 0;
|
||||
|
||||
cityObject = City.getCity(serverZone.playerCityID);
|
||||
cityObject = City.getCity(serverZone.playerCityUUID);
|
||||
|
||||
// Cannot place shrine in abandoned city. Shrines must be owned
|
||||
// by the tol owner not the person placing them.
|
||||
@@ -1001,7 +1001,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
int barracksCount = 0;
|
||||
|
||||
cityObject = City.getCity(serverZone.playerCityID);
|
||||
cityObject = City.getCity(serverZone.playerCityUUID);
|
||||
|
||||
// Cannot place barracks in abandoned city.
|
||||
|
||||
@@ -1061,7 +1061,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
if (validateCityBuildingPlacement(serverZone, msg, origin, player, msg.getFirstPlacementInfo()) == false)
|
||||
return false;
|
||||
|
||||
cityObject = City.getCity(serverZone.playerCityID);
|
||||
cityObject = City.getCity(serverZone.playerCityUUID);
|
||||
|
||||
// We need to be able to access how much gold a character is carrying
|
||||
|
||||
@@ -1229,7 +1229,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
shrineType = Shrine.getShrineTypeByBlueprintUUID(blueprint.getBlueprintUUID());
|
||||
|
||||
city = City.getCity(currentZone.playerCityID);
|
||||
city = City.getCity(currentZone.playerCityUUID);
|
||||
|
||||
if (city == null)
|
||||
return false;
|
||||
@@ -1294,7 +1294,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
city = City.getCity(currentZone.playerCityID);
|
||||
city = City.getCity(currentZone.playerCityUUID);
|
||||
|
||||
if (city == null)
|
||||
return false;
|
||||
@@ -1369,7 +1369,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
newMesh.runAfterLoad();
|
||||
} else if (ago.getObjectType() == GameObjectType.Warehouse) {
|
||||
Warehouse warehouse = (Warehouse) ago;
|
||||
City city = City.getCity(currentZone.playerCityID);
|
||||
City city = City.getCity(currentZone.playerCityUUID);
|
||||
|
||||
if (city == null)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user