ThreadPool manager rework.

This commit is contained in:
MobiusDev
2017-08-23 05:23:31 +00:00
parent 374c53df4b
commit b77de360af
718 changed files with 3180 additions and 7193 deletions

View File

@@ -296,7 +296,7 @@ public final class Q00511_AwlUnderFoot extends Quest
dungeon.setReEnterTime(System.currentTimeMillis() + REENTERTIME);
InstanceManager.getInstance().addWorld(world);
_log.info("Fortress AwlUnderFoot started " + template + " Instance: " + instanceId + " created by player: " + player.getName());
ThreadPoolManager.getInstance().scheduleGeneral(new spawnRaid((FAUWorld) world), RAID_SPAWN_DELAY);
ThreadPoolManager.schedule(new spawnRaid((FAUWorld) world), RAID_SPAWN_DELAY);
// teleport players
if (player.getParty() == null)
@@ -398,7 +398,7 @@ public final class Q00511_AwlUnderFoot extends Quest
else
{
world.incStatus();
ThreadPoolManager.getInstance().scheduleGeneral(new spawnRaid(world), RAID_SPAWN_DELAY);
ThreadPoolManager.schedule(new spawnRaid(world), RAID_SPAWN_DELAY);
}
}
return null;

View File

@@ -286,7 +286,7 @@ public class Q00726_LightWithinTheDarkness extends Quest
world.setStatus(0);
dungeon.setReEnterTime(System.currentTimeMillis() + 14400000);
InstanceManager.getInstance().addWorld(world);
ThreadPoolManager.getInstance().scheduleGeneral(new spawnNpcs((PAWORLD) world), 10000);
ThreadPoolManager.schedule(new spawnNpcs((PAWORLD) world), 10000);
for (L2PcInstance partyMember : party.getMembers())
{
@@ -397,7 +397,7 @@ public class Q00726_LightWithinTheDarkness extends Quest
protected void FirstWave(PAWORLD world)
{
ThreadPoolManager.getInstance().scheduleGeneral(() ->
ThreadPoolManager.schedule(() ->
{
addSpawn(SEDUCED_KNIGHT, 49384, -12232, -9384, 0, false, 0, false, world.getInstanceId());
addSpawn(SEDUCED_RANGER, 49192, -12232, -9384, 0, false, 0, false, world.getInstanceId());
@@ -409,7 +409,7 @@ public class Q00726_LightWithinTheDarkness extends Quest
{
addSpawn(KANADIS_FOLLOWER1, 50536, -12232, -9384, 32768, false, 0, false, world.getInstanceId());
}
ThreadPoolManager.getInstance().scheduleGeneral(() -> SecondWave(world), 8 * 60 * 1000);
ThreadPoolManager.schedule(() -> SecondWave(world), 8 * 60 * 1000);
}, 10000);
}
@@ -421,7 +421,7 @@ public class Q00726_LightWithinTheDarkness extends Quest
{
addSpawn(KANADIS_FOLLOWER2, 50536, -12232, -9384, 32768, false, 0, false, world.getInstanceId());
}
ThreadPoolManager.getInstance().scheduleGeneral(() -> ThirdWave(world), 8 * 60 * 1000);
ThreadPoolManager.schedule(() -> ThirdWave(world), 8 * 60 * 1000);
}
protected void ThirdWave(PAWORLD world)

View File

@@ -477,7 +477,7 @@ public class Q00727_HopeWithinTheDarkness extends Quest
// Destroy instance after 5 minutes
inst.setDuration(5 * 60000);
inst.setEmptyDestroyTime(0);
ThreadPoolManager.getInstance().scheduleGeneral(new completeDungeon(world, player), 1500);
ThreadPoolManager.schedule(new completeDungeon(world, player), 1500);
}
}
}
@@ -634,7 +634,7 @@ public class Q00727_HopeWithinTheDarkness extends Quest
world.setStatus(0);
dungeon.setReEnterTime(System.currentTimeMillis() + REENTER_INTERVAL);
InstanceManager.getInstance().addWorld(world);
ThreadPoolManager.getInstance().scheduleGeneral(new spawnNpcs((CAUWorld) world), INITIAL_SPAWN_DELAY);
ThreadPoolManager.schedule(new spawnNpcs((CAUWorld) world), INITIAL_SPAWN_DELAY);
if (DEBUG)
{
_log.info("Castle HopeWithinTheDarkness started " + template + " Instance: " + instanceId + " created by player: " + player.getName());
@@ -681,21 +681,21 @@ public class Q00727_HopeWithinTheDarkness extends Quest
_instance.spawnGroup("victims");
_instance.spawnGroup("bosses_1");
ThreadPoolManager.getInstance().scheduleGeneral(new spawnNpcs(_world), WAVE_SPAWN_DELAY);
ThreadPoolManager.getInstance().scheduleGeneral(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
ThreadPoolManager.schedule(new spawnNpcs(_world), WAVE_SPAWN_DELAY);
ThreadPoolManager.schedule(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
}
else if (_world.getStatus() == 1)
{
_instance.spawnGroup("bosses_2");
ThreadPoolManager.getInstance().scheduleGeneral(new spawnNpcs(_world), WAVE_SPAWN_DELAY);
ThreadPoolManager.getInstance().scheduleGeneral(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
ThreadPoolManager.schedule(new spawnNpcs(_world), WAVE_SPAWN_DELAY);
ThreadPoolManager.schedule(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
}
else if (_world.getStatus() == 2)
{
_instance.spawnGroup("bosses_3");
ThreadPoolManager.getInstance().scheduleGeneral(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
ThreadPoolManager.schedule(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
}
}
catch (Exception e)

View File

@@ -166,7 +166,7 @@ public final class Q10292_SevenSignsGirlOfDoubt extends Quest
creature1.setIsNoRndWalk(true);
final L2Npc creature2 = addSpawn(CREATURE_OF_THE_DUSK2, 89524, -238131, -9632, 56, false, 0, false, player.getInstanceId());
creature2.setIsNoRndWalk(true);
ThreadPoolManager.getInstance().scheduleGeneral(() ->
ThreadPoolManager.schedule(() ->
{
creature1.deleteMe();
creature2.deleteMe();