From c2fe156680532e4bfc620a98d4ce669a7505e16f Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 7 Mar 2024 20:24:14 -0600 Subject: [PATCH] 30 minute mine windows --- src/engine/objects/Mine.java | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 1896e549..406c0388 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -299,34 +299,17 @@ public class Mine extends AbstractGameObject { writer.putInt(mine.production.hash); writer.putInt(mine.getModifiedProductionAmount()); writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here - writer.putInt(1800); //window in seconds + writer.putInt(3600); //window in seconds //production per hour in seconds? // Errant mines are currently open. Set time to now. LocalDateTime mineOpenTime;// = LocalDateTime.now().withMinute(0).withSecond(0).withNano(0); if(mine.firstThirty == true){ - - if (mine.wasClaimed == true) - mineOpenTime = mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0).withNano(0).plusDays(1); - else - mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0).withNano(0); + mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0).withNano(0); } else{ - if (mine.wasClaimed == true) - mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(30).withSecond(0).withNano(0).plusDays(1); - else - mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(30).withSecond(0).withNano(0); + mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(30).withSecond(0).withNano(0); } - // Mine times are those of the nation not individual guild. - - Guild mineNatonGuild = mine.getOwningGuild().getNation(); - - // Adjust the serialized mine time based upon whether - // the Guild's mine window has passed or not and if it was claimed. - // If a mine is active serialize current datetime irrespective - // of any claim. - - writer.putLocalDateTime(mineOpenTime); writer.putLocalDateTime(mineOpenTime.plusMinutes(30));