From 77a73e917190c9cde47a498b462ec915902d3221 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 12 Mar 2025 19:33:42 -0500 Subject: [PATCH] mine teleportation disabled for 5 minutes after window closes --- src/engine/net/client/msg/TeleportRepledgeListMsg.java | 4 ++-- src/engine/objects/Mine.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/engine/net/client/msg/TeleportRepledgeListMsg.java b/src/engine/net/client/msg/TeleportRepledgeListMsg.java index d623ed5b..6f682f83 100644 --- a/src/engine/net/client/msg/TeleportRepledgeListMsg.java +++ b/src/engine/net/client/msg/TeleportRepledgeListMsg.java @@ -114,9 +114,9 @@ public class TeleportRepledgeListMsg extends ClientNetMsg { for (City city : cities) City.serializeForClientMsg(city, writer); - for(Mine mine : mines) + for(Mine mine : mines) { Mine.serializeForClientMsgTeleport(mine, writer); - + } //Dungeon.serializeForClientMsgTeleport(writer); } diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 599f7c1e..fe68430e 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -69,6 +69,8 @@ public class Mine extends AbstractGameObject { public ZergTracker zergTracker; + public Long allowed_teleport_time; + /** * ResultSet Constructor */ @@ -133,6 +135,7 @@ public class Mine extends AbstractGameObject { tower.setMaxHitPoints(5000f * this.capSize); tower.setCurrentHitPoints(tower.healthMax); } + this.allowed_teleport_time = System.currentTimeMillis(); } public static void releaseMineClaims(PlayerCharacter playerCharacter) { @@ -341,7 +344,7 @@ public class Mine extends AbstractGameObject { public static ArrayList getMinesToTeleportTo(PlayerCharacter player) { ArrayList mines = new ArrayList<>(); for(Mine mine : Mine.getMines()) - if(!mine.isActive) + if(!mine.isActive && System.currentTimeMillis() > mine.allowed_teleport_time) if(mine.getOwningGuild() != null) if(mine.getOwningGuild().getNation().equals(player.getGuild().getNation())) if(!mine.getOwningGuild().equals(Guild.getErrantGuild())) @@ -427,6 +430,7 @@ public class Mine extends AbstractGameObject { //something went wrong resetting zerg multiplier, maybe player was deleted? } } + this.allowed_teleport_time = System.currentTimeMillis() + MBServerStatics.FIVE_MINUTES; } }