Skip task manager tasks when working.
This commit is contained in:
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,18 +36,15 @@ public class AttackStanceTaskManager
|
|||||||
{
|
{
|
||||||
protected static final Logger LOGGER = Logger.getLogger(AttackStanceTaskManager.class.getName());
|
protected static final Logger LOGGER = Logger.getLogger(AttackStanceTaskManager.class.getName());
|
||||||
|
|
||||||
protected Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
private AttackStanceTaskManager()
|
private AttackStanceTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
|
ThreadPool.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttackStanceTaskManager getInstance()
|
|
||||||
{
|
|
||||||
return SingletonHolder.INSTANCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addAttackStanceTask(Creature actor)
|
public void addAttackStanceTask(Creature actor)
|
||||||
{
|
{
|
||||||
if (actor instanceof Summon)
|
if (actor instanceof Summon)
|
||||||
@@ -108,7 +105,7 @@ public class AttackStanceTaskManager
|
|||||||
for (Entry<Creature, Long> entry : _attackStanceTasks.entrySet())
|
for (Entry<Creature, Long> entry : _attackStanceTasks.entrySet())
|
||||||
{
|
{
|
||||||
final Creature actor = entry.getKey();
|
final Creature actor = entry.getKey();
|
||||||
if ((current - entry.getValue()) > 15000)
|
if ((current - entry.getValue()) > COMBAT_TIME)
|
||||||
{
|
{
|
||||||
actor.broadcastPacket(new AutoAttackStop(actor.getObjectId()));
|
actor.broadcastPacket(new AutoAttackStop(actor.getObjectId()));
|
||||||
if ((actor instanceof PlayerInstance) && (((PlayerInstance) actor).getPet() != null))
|
if ((actor instanceof PlayerInstance) && (((PlayerInstance) actor).getPet() != null))
|
||||||
@@ -130,6 +127,15 @@ public class AttackStanceTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the single instance of AttackStanceTaskManager.
|
||||||
|
* @return single instance of AttackStanceTaskManager
|
||||||
|
*/
|
||||||
|
public static AttackStanceTaskManager getInstance()
|
||||||
|
{
|
||||||
|
return SingletonHolder.INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
private static class SingletonHolder
|
private static class SingletonHolder
|
||||||
{
|
{
|
||||||
protected static final AttackStanceTaskManager INSTANCE = new AttackStanceTaskManager();
|
protected static final AttackStanceTaskManager INSTANCE = new AttackStanceTaskManager();
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<NpcInstance, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<NpcInstance, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<NpcInstance, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<NpcInstance, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.spawn.Spawn;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<NpcInstance, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<NpcInstance, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<NpcInstance, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<NpcInstance, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ public class AttackStanceTaskManager
|
|||||||
|
|
||||||
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
protected static final Map<Creature, Long> _attackStanceTasks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static final long COMBAT_TIME = 15_000;
|
public static final long COMBAT_TIME = 15000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new attack stance task manager.
|
* Instantiates a new attack stance task manager.
|
||||||
|
@@ -32,11 +32,18 @@ import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|||||||
public class DecayTaskManager
|
public class DecayTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
private static final Map<Creature, Long> DECAY_SCHEDULES = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public DecayTaskManager()
|
public DecayTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
for (Entry<Creature, Long> entry : DECAY_SCHEDULES.entrySet())
|
||||||
{
|
{
|
||||||
@@ -47,6 +54,8 @@ public class DecayTaskManager
|
|||||||
creature.onDecay();
|
creature.onDecay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RandomAnimationTaskManager
|
public class RandomAnimationTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_ANIMATIONS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RandomAnimationTaskManager()
|
public RandomAnimationTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -49,6 +56,8 @@ public class RandomAnimationTaskManager
|
|||||||
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
PENDING_ANIMATIONS.put(npc, time + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,18 @@ import org.l2jmobius.gameserver.model.actor.Npc;
|
|||||||
public class RespawnTaskManager
|
public class RespawnTaskManager
|
||||||
{
|
{
|
||||||
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
private static final Map<Npc, Long> PENDING_RESPAWNS = new ConcurrentHashMap<>();
|
||||||
|
private static boolean _working = false;
|
||||||
|
|
||||||
public RespawnTaskManager()
|
public RespawnTaskManager()
|
||||||
{
|
{
|
||||||
ThreadPool.scheduleAtFixedRate(() ->
|
ThreadPool.scheduleAtFixedRate(() ->
|
||||||
{
|
{
|
||||||
|
if (_working)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_working = true;
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||||
{
|
{
|
||||||
@@ -50,6 +57,8 @@ public class RespawnTaskManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_working = false;
|
||||||
}, 0, 1000);
|
}, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user