|
|
@ -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; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|