From 4d290c90646bcdd8e8d7013a948be9cb35f35fa2 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 18 Oct 2023 09:38:19 -0400 Subject: [PATCH] Refactored city planting to use new system. --- src/engine/gameManager/ZoneManager.java | 7 +---- .../client/handlers/PlaceAssetMsgHandler.java | 26 +++++-------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index 5d79ee2b..a4e4ebf1 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -181,7 +181,7 @@ public enum ZoneManager { } if (zone.guild_zone) { - addPlayerCityZone(zone); + ZoneManager.playerCityZones.add(zone); return; } @@ -199,11 +199,6 @@ public enum ZoneManager { ZoneManager.npcCityZones.add(zone); } - public static final void addPlayerCityZone(final Zone zone) { - zone.guild_zone = true; - ZoneManager.playerCityZones.add(zone); - } - public static final void generateAndSetRandomHotzone() { Zone hotZone; diff --git a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java index 1f40da87..79f9eb10 100644 --- a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java +++ b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java @@ -780,33 +780,19 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { playerNation = playerCharacter.getGuild(); playerNation.setGuildState(GuildState.Sovereign); - // Link the zone with the city and then add - // to the appropriate hash tables and cache - - zoneObject.guild_zone = true; - - if (zoneObject.parent != null) - zoneObject.parent.addNode(zoneObject); //add as child to parent - - ZoneManager.addPlayerCityZone(zoneObject); - serverZone.addNode(zoneObject); - - zoneObject.global_height = ZoneManager.calculateGlobalZoneHeight(zoneObject); - - //Link the tree of life with the new zone + // Update guild binds and tags - treeObject.setObjectTypeMask(MBServerStatics.MASK_BUILDING); - treeObject.setParentZone(zoneObject); - MaintenanceManager.setMaintDateTime(treeObject, LocalDateTime.now().plusDays(7)); + GuildManager.updateAllGuildBinds(playerNation, cityObject); + GuildManager.updateAllGuildTags(playerNation); - // Update guild binds and tags //load the new city on the clients CityZoneMsg czm = new CityZoneMsg(1, treeObject.getLoc().x, treeObject.getLoc().y, treeObject.getLoc().z, cityObject.getCityName(), zoneObject, Enum.CityBoundsType.ZONE.halfExtents, Enum.CityBoundsType.ZONE.halfExtents); DispatchMessage.dispatchMsgToAll(czm); - GuildManager.updateAllGuildBinds(playerNation, cityObject); - GuildManager.updateAllGuildTags(playerNation); + // Set maintenance date + + MaintenanceManager.setMaintDateTime(treeObject, LocalDateTime.now().plusDays(7)); // Send all the cities to the clients? // *** Refactor : figure out how to send like, one?