|
|
@ -47,21 +47,16 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler { |
|
|
|
if (serverZone.playerCityUUID == 0 && targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.MINE) |
|
|
|
if (serverZone.playerCityUUID == 0 && targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.MINE) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
City city = City.GetCityFromCache(serverZone.playerCityUUID); |
|
|
|
City city = City.GetCityFromCache(serverZone.playerCityUUID); |
|
|
|
|
|
|
|
|
|
|
|
if (city != null) { |
|
|
|
if (city != null) |
|
|
|
if (city.getBane() != null && city.protectionEnforced == false) |
|
|
|
if (city.getBane() != null && city.protectionEnforced == false) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//cannot repair mines during 24/7 activity.
|
|
|
|
//cannot repair mines during 24/7 activity.
|
|
|
|
|
|
|
|
|
|
|
|
if (targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.MINE && Mine.getMineFromTower(targetBuilding.getObjectUUID()).isActive == true) { |
|
|
|
if (targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.MINE && Mine.getMineFromTower(targetBuilding.getObjectUUID()).isActive == true) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int maxHP = (int) targetBuilding.getMaxHitPoints(); |
|
|
|
int maxHP = (int) targetBuilding.getMaxHitPoints(); |
|
|
|
int repairCost = BuildingManager.GetRepairCost(targetBuilding); |
|
|
|
int repairCost = BuildingManager.GetRepairCost(targetBuilding); |
|
|
@ -94,35 +89,22 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler { |
|
|
|
Building targetBuilding; |
|
|
|
Building targetBuilding; |
|
|
|
RepairBuildingMsg msg; |
|
|
|
RepairBuildingMsg msg; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Member variable assignment
|
|
|
|
// Member variable assignment
|
|
|
|
|
|
|
|
|
|
|
|
msg = (RepairBuildingMsg) baseMsg; |
|
|
|
msg = (RepairBuildingMsg) baseMsg; |
|
|
|
|
|
|
|
|
|
|
|
player = SessionManager.getPlayerCharacter(origin); |
|
|
|
player = SessionManager.getPlayerCharacter(origin); |
|
|
|
|
|
|
|
|
|
|
|
if (player == null) |
|
|
|
if (player == null) |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (msg.getType()) { |
|
|
|
switch (msg.getType()) { |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
|
targetBuilding = BuildingManager.getBuildingFromCache(msg.getBuildingID()); |
|
|
|
targetBuilding = BuildingManager.getBuildingFromCache(msg.getBuildingID()); |
|
|
|
RepairBuilding(targetBuilding, origin, msg); |
|
|
|
RepairBuilding(targetBuilding, origin, msg); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
// targetBuilding.createFurniture(item.getItemBase().getUseID(), 0, msg.getFurnitureLoc(), Vector3f.ZERO, 0, player);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// dispatch = Dispatch.borrow(player, baseMsg);
|
|
|
|
|
|
|
|
// DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|