From 3f11996b40cc065a6b02471afc68e0371a5637aa Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 29 May 2024 19:48:35 -0500 Subject: [PATCH] box limits resolved --- src/engine/net/client/msg/VendorDialogMsg.java | 17 ++++------------- src/engine/objects/PlayerCharacter.java | 4 ++-- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/engine/net/client/msg/VendorDialogMsg.java b/src/engine/net/client/msg/VendorDialogMsg.java index 11014670..c6cb5a8a 100644 --- a/src/engine/net/client/msg/VendorDialogMsg.java +++ b/src/engine/net/client/msg/VendorDialogMsg.java @@ -21,6 +21,7 @@ import engine.net.client.ClientConnection; import engine.net.client.Protocol; import engine.objects.*; import engine.server.MBServerStatics; +import engine.util.BoxTracker; import java.util.ArrayList; import java.util.concurrent.ThreadLocalRandom; @@ -141,6 +142,7 @@ public class VendorDialogMsg extends ClientNetMsg { playerCharacter.getTimestamps().put("lastBoxChange",System.currentTimeMillis() - 1000); if(playerCharacter.getTimeStamp("lastBoxChange") + 30000L > System.currentTimeMillis()) { + ChatManager.chatSystemInfo(playerCharacter, "You Must Wait To Promote Again."); return; } @@ -151,23 +153,12 @@ public class VendorDialogMsg extends ClientNetMsg { playerCharacter.getTimestamps().put("lastBoxChange",System.currentTimeMillis()); - playerCharacter.isBoxed = false; - playerCharacter.removeEffectBySource(Enum.EffectSourceType.DeathShroud,50,true); - ChatManager.chatSystemInfo(playerCharacter, "Promoting To Active Duty"); - ArrayList currentBoxes = new ArrayList<>(); - for(PlayerCharacter pc : SessionManager.getAllActivePlayerCharacters()){ - if(pc.getClientConnection().machineID.equals(playerCharacter.getClientConnection().machineID) && pc.equals(playerCharacter) == false) - currentBoxes.add(pc); + for(PlayerCharacter newlyBoxed : BoxTracker.getPlayers(playerCharacter.getClientConnection().machineID)){ + newlyBoxed.isBoxed = true; } playerCharacter.isBoxed = false; - playerCharacter.title = CharacterTitle.NONE; InterestManager.setObjectDirty(playerCharacter); playerCharacter.removeEffectBySource(Enum.EffectSourceType.DeathShroud,50,true); - for(PlayerCharacter box : currentBoxes) { - box.isBoxed = true; - box.title = CharacterTitle.BOX; - InterestManager.setObjectDirty(box); - } } Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 5a561d8c..222983c5 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -4876,7 +4876,7 @@ public class PlayerCharacter extends AbstractCharacter { if (this.isBoxed) { if (this.title.equals(CharacterTitle.BOX) == false) { this.title = CharacterTitle.BOX; - InterestManager.setObjectDirty(this); + InterestManager.reloadCharacter(this,false); } if (this.containsEffect(1672601862) == false) {//Deathshroud PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); @@ -4884,7 +4884,7 @@ public class PlayerCharacter extends AbstractCharacter { } else { if (this.title.equals(CharacterTitle.NONE) == false) { this.title = CharacterTitle.NONE; - InterestManager.setObjectDirty(this); + InterestManager.reloadCharacter(this,false); } } }