Browse Source

30 minute mine windows

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
c2fe156680
  1. 19
      src/engine/objects/Mine.java

19
src/engine/objects/Mine.java

@ -299,34 +299,17 @@ public class Mine extends AbstractGameObject { @@ -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);
}
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);
}
// 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));

Loading…
Cancel
Save