|
@@ -37,6 +37,10 @@ import com.l2jserver.gameserver.ThreadPoolManager;
|
|
import com.l2jserver.gameserver.datatables.DoorTable;
|
|
import com.l2jserver.gameserver.datatables.DoorTable;
|
|
import com.l2jserver.gameserver.datatables.NpcTable;
|
|
import com.l2jserver.gameserver.datatables.NpcTable;
|
|
import com.l2jserver.gameserver.datatables.SpawnTable;
|
|
import com.l2jserver.gameserver.datatables.SpawnTable;
|
|
|
|
+import com.l2jserver.gameserver.instancemanager.tasks.FourSepulchersChangeAttackTimeTask;
|
|
|
|
+import com.l2jserver.gameserver.instancemanager.tasks.FourSepulchersChangeCoolDownTimeTask;
|
|
|
|
+import com.l2jserver.gameserver.instancemanager.tasks.FourSepulchersChangeEntryTimeTask;
|
|
|
|
+import com.l2jserver.gameserver.instancemanager.tasks.FourSepulchersChangeWarmUpTimeTask;
|
|
import com.l2jserver.gameserver.model.L2Spawn;
|
|
import com.l2jserver.gameserver.model.L2Spawn;
|
|
import com.l2jserver.gameserver.model.actor.L2Npc;
|
|
import com.l2jserver.gameserver.model.actor.L2Npc;
|
|
import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
|
|
import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
|
|
@@ -60,9 +64,9 @@ import gnu.trove.map.hash.TIntObjectHashMap;
|
|
* Zoey76: TODO: Use Location DTO instead of array of int.
|
|
* Zoey76: TODO: Use Location DTO instead of array of int.
|
|
* @author sandman
|
|
* @author sandman
|
|
*/
|
|
*/
|
|
-public class FourSepulchersManager
|
|
|
|
|
|
+public final class FourSepulchersManager
|
|
{
|
|
{
|
|
- protected static final Logger _log = Logger.getLogger(FourSepulchersManager.class.getName());
|
|
|
|
|
|
+ private static final Logger _log = Logger.getLogger(FourSepulchersManager.class.getName());
|
|
|
|
|
|
private static final int QUEST_ID = 620;
|
|
private static final int QUEST_ID = 620;
|
|
|
|
|
|
@@ -71,17 +75,16 @@ public class FourSepulchersManager
|
|
private static final int CHAPEL_KEY = 7260;
|
|
private static final int CHAPEL_KEY = 7260;
|
|
private static final int ANTIQUE_BROOCH = 7262;
|
|
private static final int ANTIQUE_BROOCH = 7262;
|
|
|
|
|
|
- protected boolean _firstTimeRun;
|
|
|
|
- protected boolean _inEntryTime = false;
|
|
|
|
- protected boolean _inWarmUpTime = false;
|
|
|
|
- protected boolean _inAttackTime = false;
|
|
|
|
- protected boolean _inCoolDownTime = false;
|
|
|
|
|
|
+ private boolean _firstTimeRun;
|
|
|
|
+ private boolean _inEntryTime = false;
|
|
|
|
+ private boolean _inWarmUpTime = false;
|
|
|
|
+ private boolean _inAttackTime = false;
|
|
|
|
+ private boolean _inCoolDownTime = false;
|
|
|
|
|
|
- protected ScheduledFuture<?> _changeCoolDownTimeTask = null;
|
|
|
|
- protected ScheduledFuture<?> _changeEntryTimeTask = null;
|
|
|
|
- protected ScheduledFuture<?> _changeWarmUpTimeTask = null;
|
|
|
|
- protected ScheduledFuture<?> _changeAttackTimeTask = null;
|
|
|
|
- protected ScheduledFuture<?> _onPartyAnnihilatedTask = null;
|
|
|
|
|
|
+ private ScheduledFuture<?> _changeCoolDownTimeTask = null;
|
|
|
|
+ private ScheduledFuture<?> _changeEntryTimeTask = null;
|
|
|
|
+ private ScheduledFuture<?> _changeWarmUpTimeTask = null;
|
|
|
|
+ private ScheduledFuture<?> _changeAttackTimeTask = null;
|
|
|
|
|
|
// @formatter:off
|
|
// @formatter:off
|
|
private final int[][] _startHallSpawn =
|
|
private final int[][] _startHallSpawn =
|
|
@@ -146,12 +149,12 @@ public class FourSepulchersManager
|
|
protected FastList<L2Spawn> _emperorsGraveSpawns;
|
|
protected FastList<L2Spawn> _emperorsGraveSpawns;
|
|
protected FastList<L2Npc> _allMobs = new FastList<>();
|
|
protected FastList<L2Npc> _allMobs = new FastList<>();
|
|
|
|
|
|
- protected long _attackTimeEnd = 0;
|
|
|
|
- protected long _coolDownTimeEnd = 0;
|
|
|
|
- protected long _entryTimeEnd = 0;
|
|
|
|
- protected long _warmUpTimeEnd = 0;
|
|
|
|
|
|
+ private long _attackTimeEnd = 0;
|
|
|
|
+ private long _coolDownTimeEnd = 0;
|
|
|
|
+ private long _entryTimeEnd = 0;
|
|
|
|
+ private long _warmUpTimeEnd = 0;
|
|
|
|
|
|
- protected byte _newCycleMin = 55;
|
|
|
|
|
|
+ private final byte _newCycleMin = 55;
|
|
|
|
|
|
public void init()
|
|
public void init()
|
|
{
|
|
{
|
|
@@ -208,7 +211,7 @@ public class FourSepulchersManager
|
|
// check
|
|
// check
|
|
{
|
|
{
|
|
clean();
|
|
clean();
|
|
- _changeEntryTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeEntryTime(), 0);
|
|
|
|
|
|
+ _changeEntryTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeEntryTimeTask(), 0);
|
|
_log.info(getClass().getSimpleName() + ": Beginning in Entry time");
|
|
_log.info(getClass().getSimpleName() + ": Beginning in Entry time");
|
|
}
|
|
}
|
|
else if ((currentTime >= _entryTimeEnd) && (currentTime < _warmUpTimeEnd)) // warmup
|
|
else if ((currentTime >= _entryTimeEnd) && (currentTime < _warmUpTimeEnd)) // warmup
|
|
@@ -216,7 +219,7 @@ public class FourSepulchersManager
|
|
// check
|
|
// check
|
|
{
|
|
{
|
|
clean();
|
|
clean();
|
|
- _changeWarmUpTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeWarmUpTime(), 0);
|
|
|
|
|
|
+ _changeWarmUpTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeWarmUpTimeTask(), 0);
|
|
_log.info(getClass().getSimpleName() + ": Beginning in WarmUp time");
|
|
_log.info(getClass().getSimpleName() + ": Beginning in WarmUp time");
|
|
}
|
|
}
|
|
else if ((currentTime >= _warmUpTimeEnd) && (currentTime < _attackTimeEnd)) // attack
|
|
else if ((currentTime >= _warmUpTimeEnd) && (currentTime < _attackTimeEnd)) // attack
|
|
@@ -224,14 +227,14 @@ public class FourSepulchersManager
|
|
// check
|
|
// check
|
|
{
|
|
{
|
|
clean();
|
|
clean();
|
|
- _changeAttackTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeAttackTime(), 0);
|
|
|
|
|
|
+ _changeAttackTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeAttackTimeTask(), 0);
|
|
_log.info(getClass().getSimpleName() + ": Beginning in Attack time");
|
|
_log.info(getClass().getSimpleName() + ": Beginning in Attack time");
|
|
}
|
|
}
|
|
else
|
|
else
|
|
// else cooldown time and without cleanup because it's already
|
|
// else cooldown time and without cleanup because it's already
|
|
// implemented
|
|
// implemented
|
|
{
|
|
{
|
|
- _changeCoolDownTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeCoolDownTime(), 0);
|
|
|
|
|
|
+ _changeCoolDownTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeCoolDownTimeTask(), 0);
|
|
_log.info(getClass().getSimpleName() + ": Beginning in Cooldown time");
|
|
_log.info(getClass().getSimpleName() + ": Beginning in Cooldown time");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -817,9 +820,79 @@ public class FourSepulchersManager
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public boolean isEntryTime()
|
|
|
|
|
|
+ public ScheduledFuture<?> getChangeAttackTimeTask()
|
|
{
|
|
{
|
|
- return _inEntryTime;
|
|
|
|
|
|
+ return _changeAttackTimeTask;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setChangeAttackTimeTask(ScheduledFuture<?> task)
|
|
|
|
+ {
|
|
|
|
+ _changeAttackTimeTask = task;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public ScheduledFuture<?> getChangeCoolDownTimeTask()
|
|
|
|
+ {
|
|
|
|
+ return _changeCoolDownTimeTask;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setChangeCoolDownTimeTask(ScheduledFuture<?> task)
|
|
|
|
+ {
|
|
|
|
+ _changeCoolDownTimeTask = task;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public ScheduledFuture<?> getChangeEntryTimeTask()
|
|
|
|
+ {
|
|
|
|
+ return _changeEntryTimeTask;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setChangeEntryTimeTask(ScheduledFuture<?> task)
|
|
|
|
+ {
|
|
|
|
+ _changeEntryTimeTask = task;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public ScheduledFuture<?> getChangeWarmUpTimeTask()
|
|
|
|
+ {
|
|
|
|
+ return _changeWarmUpTimeTask;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setChangeWarmUpTimeTask(ScheduledFuture<?> task)
|
|
|
|
+ {
|
|
|
|
+ _changeWarmUpTimeTask = task;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public long getAttackTimeEnd()
|
|
|
|
+ {
|
|
|
|
+ return _attackTimeEnd;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setAttackTimeEnd(long attackTimeEnd)
|
|
|
|
+ {
|
|
|
|
+ _attackTimeEnd = attackTimeEnd;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public byte getCycleMin()
|
|
|
|
+ {
|
|
|
|
+ return _newCycleMin;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public long getEntrytTimeEnd()
|
|
|
|
+ {
|
|
|
|
+ return _entryTimeEnd;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setEntryTimeEnd(long entryTimeEnd)
|
|
|
|
+ {
|
|
|
|
+ _entryTimeEnd = entryTimeEnd;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public long getWarmUpTimeEnd()
|
|
|
|
+ {
|
|
|
|
+ return _warmUpTimeEnd;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setWarmUpTimeEnd(long warmUpTimeEnd)
|
|
|
|
+ {
|
|
|
|
+ _warmUpTimeEnd = warmUpTimeEnd;
|
|
}
|
|
}
|
|
|
|
|
|
public boolean isAttackTime()
|
|
public boolean isAttackTime()
|
|
@@ -827,6 +900,51 @@ public class FourSepulchersManager
|
|
return _inAttackTime;
|
|
return _inAttackTime;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void setIsAttackTime(boolean attackTime)
|
|
|
|
+ {
|
|
|
|
+ _inAttackTime = attackTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isCoolDownTime()
|
|
|
|
+ {
|
|
|
|
+ return _inCoolDownTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setIsCoolDownTime(boolean isCoolDownTime)
|
|
|
|
+ {
|
|
|
|
+ _inCoolDownTime = isCoolDownTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isEntryTime()
|
|
|
|
+ {
|
|
|
|
+ return _inEntryTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setIsEntryTime(boolean entryTime)
|
|
|
|
+ {
|
|
|
|
+ _inEntryTime = entryTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isFirstTimeRun()
|
|
|
|
+ {
|
|
|
|
+ return _firstTimeRun;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setIsFirstTimeRun(boolean isFirstTimeRun)
|
|
|
|
+ {
|
|
|
|
+ _firstTimeRun = isFirstTimeRun;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isWarmUpTime()
|
|
|
|
+ {
|
|
|
|
+ return _inWarmUpTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setIsWarmUpTime(boolean isWarmUpTime)
|
|
|
|
+ {
|
|
|
|
+ _inWarmUpTime = isWarmUpTime;
|
|
|
|
+ }
|
|
|
|
+
|
|
public synchronized void tryEntry(L2Npc npc, L2PcInstance player)
|
|
public synchronized void tryEntry(L2Npc npc, L2PcInstance player)
|
|
{
|
|
{
|
|
Quest hostQuest = QuestManager.getInstance().getQuest(QUEST_ID);
|
|
Quest hostQuest = QuestManager.getInstance().getQuest(QUEST_ID);
|
|
@@ -1333,7 +1451,7 @@ public class FourSepulchersManager
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- protected void locationShadowSpawns()
|
|
|
|
|
|
+ public void locationShadowSpawns()
|
|
{
|
|
{
|
|
int locNo = Rnd.get(4);
|
|
int locNo = Rnd.get(4);
|
|
// _log.info("FourSepulchersManager.LocationShadowSpawns: Location index
|
|
// _log.info("FourSepulchersManager.LocationShadowSpawns: Location index
|
|
@@ -1571,216 +1689,6 @@ public class FourSepulchersManager
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- protected class ManagerSay implements Runnable
|
|
|
|
- {
|
|
|
|
- @Override
|
|
|
|
- public void run()
|
|
|
|
- {
|
|
|
|
- if (_inAttackTime)
|
|
|
|
- {
|
|
|
|
- Calendar tmp = Calendar.getInstance();
|
|
|
|
- tmp.setTimeInMillis(Calendar.getInstance().getTimeInMillis() - _warmUpTimeEnd);
|
|
|
|
- if ((tmp.get(Calendar.MINUTE) + 5) < Config.FS_TIME_ATTACK)
|
|
|
|
- {
|
|
|
|
- managerSay((byte) tmp.get(Calendar.MINUTE)); // byte
|
|
|
|
- // because
|
|
|
|
- // minute
|
|
|
|
- // cannot be
|
|
|
|
- // more than
|
|
|
|
- // 59
|
|
|
|
- ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), 5 * 60000);
|
|
|
|
- }
|
|
|
|
- // attack time ending chat
|
|
|
|
- else if ((tmp.get(Calendar.MINUTE) + 5) >= Config.FS_TIME_ATTACK)
|
|
|
|
- {
|
|
|
|
- managerSay((byte) 90); // sending a unique id :D
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (_inEntryTime)
|
|
|
|
- {
|
|
|
|
- managerSay((byte) 0);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- protected class ChangeEntryTime implements Runnable
|
|
|
|
- {
|
|
|
|
- @Override
|
|
|
|
- public void run()
|
|
|
|
- {
|
|
|
|
- // _log.info("FourSepulchersManager:In Entry Time");
|
|
|
|
- _inEntryTime = true;
|
|
|
|
- _inWarmUpTime = false;
|
|
|
|
- _inAttackTime = false;
|
|
|
|
- _inCoolDownTime = false;
|
|
|
|
-
|
|
|
|
- long interval = 0;
|
|
|
|
- // if this is first launch - search time when entry time will be
|
|
|
|
- // ended:
|
|
|
|
- // counting difference between time when entry time ends and current
|
|
|
|
- // time
|
|
|
|
- // and then launching change time task
|
|
|
|
- if (_firstTimeRun)
|
|
|
|
- {
|
|
|
|
- interval = _entryTimeEnd - Calendar.getInstance().getTimeInMillis();
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- interval = Config.FS_TIME_ENTRY * 60000L; // else use stupid
|
|
|
|
- // method
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // launching saying process...
|
|
|
|
- ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), 0);
|
|
|
|
- _changeWarmUpTimeTask = ThreadPoolManager.getInstance().scheduleEffect(new ChangeWarmUpTime(), interval);
|
|
|
|
- if (_changeEntryTimeTask != null)
|
|
|
|
- {
|
|
|
|
- _changeEntryTimeTask.cancel(true);
|
|
|
|
- _changeEntryTimeTask = null;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- protected class ChangeWarmUpTime implements Runnable
|
|
|
|
- {
|
|
|
|
- @Override
|
|
|
|
- public void run()
|
|
|
|
- {
|
|
|
|
- // _log.info("FourSepulchersManager:In Warm-Up Time");
|
|
|
|
- _inEntryTime = true;
|
|
|
|
- _inWarmUpTime = false;
|
|
|
|
- _inAttackTime = false;
|
|
|
|
- _inCoolDownTime = false;
|
|
|
|
-
|
|
|
|
- long interval = 0;
|
|
|
|
- // searching time when warmup time will be ended:
|
|
|
|
- // counting difference between time when warmup time ends and
|
|
|
|
- // current time
|
|
|
|
- // and then launching change time task
|
|
|
|
- if (_firstTimeRun)
|
|
|
|
- {
|
|
|
|
- interval = _warmUpTimeEnd - Calendar.getInstance().getTimeInMillis();
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- interval = Config.FS_TIME_WARMUP * 60000L;
|
|
|
|
- }
|
|
|
|
- _changeAttackTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeAttackTime(), interval);
|
|
|
|
-
|
|
|
|
- if (_changeWarmUpTimeTask != null)
|
|
|
|
- {
|
|
|
|
- _changeWarmUpTimeTask.cancel(true);
|
|
|
|
- _changeWarmUpTimeTask = null;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- protected class ChangeAttackTime implements Runnable
|
|
|
|
- {
|
|
|
|
- @Override
|
|
|
|
- public void run()
|
|
|
|
- {
|
|
|
|
- // _log.info("FourSepulchersManager:In Attack Time");
|
|
|
|
- _inEntryTime = false;
|
|
|
|
- _inWarmUpTime = false;
|
|
|
|
- _inAttackTime = true;
|
|
|
|
- _inCoolDownTime = false;
|
|
|
|
-
|
|
|
|
- locationShadowSpawns();
|
|
|
|
-
|
|
|
|
- spawnMysteriousBox(31921);
|
|
|
|
- spawnMysteriousBox(31922);
|
|
|
|
- spawnMysteriousBox(31923);
|
|
|
|
- spawnMysteriousBox(31924);
|
|
|
|
-
|
|
|
|
- if (!_firstTimeRun)
|
|
|
|
- {
|
|
|
|
- _warmUpTimeEnd = Calendar.getInstance().getTimeInMillis();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- long interval = 0;
|
|
|
|
- // say task
|
|
|
|
- if (_firstTimeRun)
|
|
|
|
- {
|
|
|
|
- for (double min = Calendar.getInstance().get(Calendar.MINUTE); min < _newCycleMin; min++)
|
|
|
|
- {
|
|
|
|
- // looking for next shout time....
|
|
|
|
- if ((min % 5) == 0)// check if min can be divided by 5
|
|
|
|
- {
|
|
|
|
- _log.info(getClass().getSimpleName() + ": " + Calendar.getInstance().getTime() + " Atk announce scheduled to " + min + " minute of this hour.");
|
|
|
|
- Calendar inter = Calendar.getInstance();
|
|
|
|
- inter.set(Calendar.MINUTE, (int) min);
|
|
|
|
- ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), inter.getTimeInMillis() - Calendar.getInstance().getTimeInMillis());
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), 5 * 60400);
|
|
|
|
- }
|
|
|
|
- // searching time when attack time will be ended:
|
|
|
|
- // counting difference between time when attack time ends and
|
|
|
|
- // current time
|
|
|
|
- // and then launching change time task
|
|
|
|
- if (_firstTimeRun)
|
|
|
|
- {
|
|
|
|
- interval = _attackTimeEnd - Calendar.getInstance().getTimeInMillis();
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- interval = Config.FS_TIME_ATTACK * 60000L;
|
|
|
|
- }
|
|
|
|
- _changeCoolDownTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeCoolDownTime(), interval);
|
|
|
|
-
|
|
|
|
- if (_changeAttackTimeTask != null)
|
|
|
|
- {
|
|
|
|
- _changeAttackTimeTask.cancel(true);
|
|
|
|
- _changeAttackTimeTask = null;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- protected class ChangeCoolDownTime implements Runnable
|
|
|
|
- {
|
|
|
|
- @Override
|
|
|
|
- public void run()
|
|
|
|
- {
|
|
|
|
- // _log.info("FourSepulchersManager:In Cool-Down Time");
|
|
|
|
- _inEntryTime = false;
|
|
|
|
- _inWarmUpTime = false;
|
|
|
|
- _inAttackTime = false;
|
|
|
|
- _inCoolDownTime = true;
|
|
|
|
-
|
|
|
|
- clean();
|
|
|
|
-
|
|
|
|
- Calendar time = Calendar.getInstance();
|
|
|
|
- // one hour = 55th min to 55 min of next hour, so we check for this,
|
|
|
|
- // also check for first launch
|
|
|
|
- if ((Calendar.getInstance().get(Calendar.MINUTE) > _newCycleMin) && !_firstTimeRun)
|
|
|
|
- {
|
|
|
|
- time.set(Calendar.HOUR, Calendar.getInstance().get(Calendar.HOUR) + 1);
|
|
|
|
- }
|
|
|
|
- time.set(Calendar.MINUTE, _newCycleMin);
|
|
|
|
- _log.info(getClass().getSimpleName() + ": Entry time: " + time.getTime());
|
|
|
|
- if (_firstTimeRun)
|
|
|
|
- {
|
|
|
|
- _firstTimeRun = false; // cooldown phase ends event hour, so it
|
|
|
|
- // will be not first run
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- long interval = time.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
|
|
|
|
- _changeEntryTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeEntryTime(), interval);
|
|
|
|
-
|
|
|
|
- if (_changeCoolDownTimeTask != null)
|
|
|
|
- {
|
|
|
|
- _changeCoolDownTimeTask.cancel(true);
|
|
|
|
- _changeCoolDownTimeTask = null;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public TIntIntHashMap getHallGateKeepers()
|
|
public TIntIntHashMap getHallGateKeepers()
|
|
{
|
|
{
|
|
return _hallGateKeepers;
|
|
return _hallGateKeepers;
|