From 50e962b77e1d0ac1b3a31d95917570b71eee4daf Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 20 Aug 2023 20:14:28 -0400 Subject: [PATCH] dirtyFlag integration. --- .../client/handlers/PlaceAssetMsgHandler.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java index c8e1e777..1825a014 100644 --- a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java +++ b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java @@ -3,6 +3,7 @@ package engine.net.client.handlers; import engine.Enum; import engine.Enum.*; import engine.InterestManagement.HeightMap; +import engine.InterestManagement.InterestManager; import engine.InterestManagement.RealmMap; import engine.InterestManagement.WorldGrid; import engine.db.archive.CityRecord; @@ -818,7 +819,9 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { // *** Refactor : figure out how to send like, one? City.lastCityUpdate = System.currentTimeMillis(); - WorldGrid.addObject(treeObject, playerCharacter); + treeObject.setLoc(treeObject.getLoc()); + InterestManager.setObjectDirty(treeObject); +// WorldGrid.addObject(treeObject, playerCharacter); serverRealm.addCity(cityObject.getObjectUUID()); playerNation.setCityUUID(cityObject.getObjectUUID()); @@ -1200,7 +1203,9 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { newMesh.setObjectTypeMask(MBServerStatics.MASK_BUILDING); MaintenanceManager.setMaintDateTime(newMesh, LocalDateTime.now().plusDays(7)); - WorldGrid.addObject(newMesh, playerCharacter); + // WorldGrid.addObject(newMesh, playerCharacter); + newMesh.setLoc(newMesh.getLoc()); + InterestManager.setObjectDirty(newMesh); return newMesh; } @@ -1259,7 +1264,8 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { newMesh.runAfterLoad(); newMesh.setObjectTypeMask(MBServerStatics.MASK_BUILDING); MaintenanceManager.setMaintDateTime(newMesh, LocalDateTime.now().plusDays(7)); - WorldGrid.addObject(newMesh, player); + newMesh.setLoc(newMesh.getLoc()); + InterestManager.setObjectDirty(newMesh); break; case Shrine: newShrine = (Shrine) ago; @@ -1319,7 +1325,8 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { newMesh.setObjectTypeMask(MBServerStatics.MASK_BUILDING); MaintenanceManager.setMaintDateTime(newMesh, LocalDateTime.now().plusDays(7)); - WorldGrid.addObject(newMesh, player); + newMesh.setLoc(newMesh.getLoc()); + InterestManager.setObjectDirty(newMesh); return true; } @@ -1360,7 +1367,9 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { newMesh = (Building) ago; newMesh.setObjectTypeMask(MBServerStatics.MASK_BUILDING); MaintenanceManager.setMaintDateTime(newMesh, LocalDateTime.now().plusDays(7)); - WorldGrid.addObject(newMesh, player); + // WorldGrid.addObject(newMesh, player); + newMesh.setLoc(newMesh.getLoc()); + InterestManager.setObjectDirty(newMesh); newMesh.runAfterLoad(); } else if (ago.getObjectType() == GameObjectType.Warehouse) { Warehouse warehouse = (Warehouse) ago;