Browse Source

banes to set default times

lakebane
FatBoy-DOTC 1 week ago
parent
commit
72b2e54331
  1. 36
      src/engine/objects/Bane.java
  2. 6
      src/engine/workthreads/HourlyJobThread.java

36
src/engine/objects/Bane.java

@ -428,32 +428,24 @@ public final class Bane {
// Cache access // Cache access
private void setDefaultTime() { public void setDefaultTime() {
DateTime timeToSetDefault = new DateTime(this.placementDate); DateTime timeToSetDefault = new DateTime(this.placementDate);
timeToSetDefault = timeToSetDefault.plusDays(1); timeToSetDefault = timeToSetDefault.plusDays(1);
DateTime currentTime = DateTime.now(); if (DateTime.now().isAfter(timeToSetDefault)){
DateTime defaultTime = new DateTime(this.placementDate); if(!this.capSet){
defaultTime = defaultTime.plusDays(2); DbManager.BaneQueries.SET_BANE_CAP_NEW(20,this.getCityUUID());
defaultTime = defaultTime.hourOfDay().setCopy(22); this.capSet = true;
defaultTime = defaultTime.minuteOfHour().setCopy(0); }
defaultTime = defaultTime.secondOfMinute().setCopy(0); if(!this.daySet){
DbManager.BaneQueries.SET_BANE_DAY_NEW(3,this.getCityUUID());
if (currentTime.isAfter(timeToSetDefault)){ this.daySet = true;
DbManager.BaneQueries.SET_BANE_CAP_NEW(20,this.getCityUUID()); }
DbManager.BaneQueries.SET_BANE_TIME_NEW(9,this.getCityUUID()); if(!this.timeSet){
DbManager.BaneQueries.SET_BANE_DAY_NEW(3,this.getCityUUID()); DbManager.BaneQueries.SET_BANE_TIME_NEW(9,this.getCityUUID());
} this.timeSet = true;
//this.setLiveDate(defaultTime); }
else {
if (this.defaultTimeJob != null)
this.defaultTimeJob.cancelJob();
BaneDefaultTimeJob bdtj = new BaneDefaultTimeJob(this);
JobScheduler.getInstance().scheduleJob(bdtj, timeToSetDefault.getMillis());
this.defaultTimeJob = bdtj;
} }
} }

6
src/engine/workthreads/HourlyJobThread.java

@ -88,5 +88,11 @@ public class HourlyJobThread implements Runnable {
Logger.info(SimulationManager.getPopulationString()); Logger.info(SimulationManager.getPopulationString());
Logger.info(MessageDispatcher.getNetstatString()); Logger.info(MessageDispatcher.getNetstatString());
Logger.info(PurgeOprhans.recordsDeleted.toString() + "orphaned items deleted"); Logger.info(PurgeOprhans.recordsDeleted.toString() + "orphaned items deleted");
for (Bane bane : Bane.banes.values()){
if(bane.getSiegePhase().equals(Enum.SiegePhase.CHALLENGE)){
bane.setDefaultTime();
}
}
} }
} }

Loading…
Cancel
Save