Browse Source

mine teleportation disabled for 5 minutes after window closes

lakebane
FatBoy-DOTC 3 weeks ago
parent
commit
77a73e9171
  1. 4
      src/engine/net/client/msg/TeleportRepledgeListMsg.java
  2. 6
      src/engine/objects/Mine.java

4
src/engine/net/client/msg/TeleportRepledgeListMsg.java

@ -114,9 +114,9 @@ public class TeleportRepledgeListMsg extends ClientNetMsg {
for (City city : cities) for (City city : cities)
City.serializeForClientMsg(city, writer); City.serializeForClientMsg(city, writer);
for(Mine mine : mines) for(Mine mine : mines) {
Mine.serializeForClientMsgTeleport(mine, writer); Mine.serializeForClientMsgTeleport(mine, writer);
}
//Dungeon.serializeForClientMsgTeleport(writer); //Dungeon.serializeForClientMsgTeleport(writer);
} }

6
src/engine/objects/Mine.java

@ -69,6 +69,8 @@ public class Mine extends AbstractGameObject {
public ZergTracker zergTracker; public ZergTracker zergTracker;
public Long allowed_teleport_time;
/** /**
* ResultSet Constructor * ResultSet Constructor
*/ */
@ -133,6 +135,7 @@ public class Mine extends AbstractGameObject {
tower.setMaxHitPoints(5000f * this.capSize); tower.setMaxHitPoints(5000f * this.capSize);
tower.setCurrentHitPoints(tower.healthMax); tower.setCurrentHitPoints(tower.healthMax);
} }
this.allowed_teleport_time = System.currentTimeMillis();
} }
public static void releaseMineClaims(PlayerCharacter playerCharacter) { public static void releaseMineClaims(PlayerCharacter playerCharacter) {
@ -341,7 +344,7 @@ public class Mine extends AbstractGameObject {
public static ArrayList<Mine> getMinesToTeleportTo(PlayerCharacter player) { public static ArrayList<Mine> getMinesToTeleportTo(PlayerCharacter player) {
ArrayList<Mine> mines = new ArrayList<>(); ArrayList<Mine> mines = new ArrayList<>();
for(Mine mine : Mine.getMines()) for(Mine mine : Mine.getMines())
if(!mine.isActive) if(!mine.isActive && System.currentTimeMillis() > mine.allowed_teleport_time)
if(mine.getOwningGuild() != null) if(mine.getOwningGuild() != null)
if(mine.getOwningGuild().getNation().equals(player.getGuild().getNation())) if(mine.getOwningGuild().getNation().equals(player.getGuild().getNation()))
if(!mine.getOwningGuild().equals(Guild.getErrantGuild())) 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? //something went wrong resetting zerg multiplier, maybe player was deleted?
} }
} }
this.allowed_teleport_time = System.currentTimeMillis() + MBServerStatics.FIVE_MINUTES;
} }
} }

Loading…
Cancel
Save