ThreadPool manager rework.
This commit is contained in:
@@ -291,11 +291,11 @@ public abstract class AirShipController extends AbstractNpcAI
|
||||
playMovie(_dockedShip.getPassengers(), _movie);
|
||||
}
|
||||
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(_decayTask, 1000);
|
||||
ThreadPoolManager.schedule(_decayTask, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
_departSchedule = ThreadPoolManager.getInstance().scheduleGeneral(_departTask, DEPART_INTERVAL);
|
||||
_departSchedule = ThreadPoolManager.schedule(_departTask, DEPART_INTERVAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
|
||||
case 1:
|
||||
// _ship.teleToLocation(-167874, 256731, -509, 41035, false);
|
||||
_ship.setOustLoc(OUST_GRACIA);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 5000);
|
||||
ThreadPoolManager.schedule(this, 5000);
|
||||
break;
|
||||
case 2:
|
||||
_ship.executePath(WARPGATE_TO_GRACIA);
|
||||
@@ -257,7 +257,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
|
||||
broadcastInGracia(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_ADEN_CONTINENT_IN_1_MINUTE);
|
||||
_ship.setInDock(GRACIA_DOCK_ID);
|
||||
_ship.oustPlayers();
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 60000);
|
||||
ThreadPoolManager.schedule(this, 60000);
|
||||
break;
|
||||
case 4:
|
||||
broadcastInGracia(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_THAT_FLIES_TO_THE_ADEN_CONTINENT_HAS_DEPARTED);
|
||||
@@ -267,7 +267,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
|
||||
case 5:
|
||||
// _ship.teleToLocation(-157261, 255664, 221, 64781, false);
|
||||
_ship.setOustLoc(OUST_GLUDIO);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 5000);
|
||||
ThreadPoolManager.schedule(this, 5000);
|
||||
break;
|
||||
case 6:
|
||||
_ship.executePath(WARPGATE_TO_GLUDIO);
|
||||
@@ -276,7 +276,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
|
||||
broadcastInGludio(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_GRACIA_CONTINENT_IN_1_MINUTE);
|
||||
_ship.setInDock(GLUDIO_DOCK_ID);
|
||||
_ship.oustPlayers();
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 60000);
|
||||
ThreadPoolManager.schedule(this, 60000);
|
||||
break;
|
||||
}
|
||||
_cycle++;
|
||||
|
||||
@@ -175,15 +175,15 @@ public class BoatGludinRune implements Runnable
|
||||
{
|
||||
case 0:
|
||||
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN5);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 240000);
|
||||
ThreadPoolManager.schedule(this, 240000);
|
||||
break;
|
||||
case 1:
|
||||
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN1);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 40000);
|
||||
ThreadPoolManager.schedule(this, 40000);
|
||||
break;
|
||||
case 2:
|
||||
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN0);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 20000);
|
||||
ThreadPoolManager.schedule(this, 20000);
|
||||
break;
|
||||
case 3:
|
||||
BoatManager.getInstance().dockShip(BoatManager.GLUDIN_HARBOR, false);
|
||||
@@ -191,19 +191,19 @@ public class BoatGludinRune implements Runnable
|
||||
_boat.broadcastPacket(GLUDIN_SOUND);
|
||||
_boat.payForRide(7905, 1, -90015, 150422, -3610);
|
||||
_boat.executePath(GLUDIN_TO_RUNE);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 250000);
|
||||
ThreadPoolManager.schedule(this, 250000);
|
||||
break;
|
||||
case 4:
|
||||
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE15);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 300000);
|
||||
ThreadPoolManager.schedule(this, 300000);
|
||||
break;
|
||||
case 5:
|
||||
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE10);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 300000);
|
||||
ThreadPoolManager.schedule(this, 300000);
|
||||
break;
|
||||
case 6:
|
||||
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE5);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 240000);
|
||||
ThreadPoolManager.schedule(this, 240000);
|
||||
break;
|
||||
case 7:
|
||||
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE1);
|
||||
@@ -222,7 +222,7 @@ public class BoatGludinRune implements Runnable
|
||||
_shoutCount = 0;
|
||||
}
|
||||
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 5000);
|
||||
ThreadPoolManager.schedule(this, 5000);
|
||||
return;
|
||||
}
|
||||
_boat.executePath(RUNE_DOCK);
|
||||
@@ -231,19 +231,19 @@ public class BoatGludinRune implements Runnable
|
||||
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
|
||||
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2);
|
||||
_boat.broadcastPacket(RUNE_SOUND);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 300000);
|
||||
ThreadPoolManager.schedule(this, 300000);
|
||||
break;
|
||||
case 10:
|
||||
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE5);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 240000);
|
||||
ThreadPoolManager.schedule(this, 240000);
|
||||
break;
|
||||
case 11:
|
||||
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE1);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 40000);
|
||||
ThreadPoolManager.schedule(this, 40000);
|
||||
break;
|
||||
case 12:
|
||||
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE0);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 20000);
|
||||
ThreadPoolManager.schedule(this, 20000);
|
||||
break;
|
||||
case 13:
|
||||
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, false);
|
||||
@@ -251,19 +251,19 @@ public class BoatGludinRune implements Runnable
|
||||
_boat.broadcastPacket(RUNE_SOUND);
|
||||
_boat.payForRide(7904, 1, 34513, -38009, -3640);
|
||||
_boat.executePath(RUNE_TO_GLUDIN);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 60000);
|
||||
ThreadPoolManager.schedule(this, 60000);
|
||||
break;
|
||||
case 14:
|
||||
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN15);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 300000);
|
||||
ThreadPoolManager.schedule(this, 300000);
|
||||
break;
|
||||
case 15:
|
||||
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN10);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 300000);
|
||||
ThreadPoolManager.schedule(this, 300000);
|
||||
break;
|
||||
case 16:
|
||||
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN5);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 240000);
|
||||
ThreadPoolManager.schedule(this, 240000);
|
||||
break;
|
||||
case 17:
|
||||
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN1);
|
||||
@@ -282,7 +282,7 @@ public class BoatGludinRune implements Runnable
|
||||
_shoutCount = 0;
|
||||
}
|
||||
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 5000);
|
||||
ThreadPoolManager.schedule(this, 5000);
|
||||
return;
|
||||
}
|
||||
_boat.executePath(GLUDIN_DOCK);
|
||||
@@ -291,7 +291,7 @@ public class BoatGludinRune implements Runnable
|
||||
BoatManager.getInstance().dockShip(BoatManager.GLUDIN_HARBOR, true);
|
||||
BoatManager.getInstance().broadcastPackets(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVED_AT_GLUDIN, ARRIVED_AT_GLUDIN_2);
|
||||
_boat.broadcastPacket(GLUDIN_SOUND);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 300000);
|
||||
ThreadPoolManager.schedule(this, 300000);
|
||||
break;
|
||||
}
|
||||
_shoutCount = 0;
|
||||
|
||||
@@ -118,44 +118,44 @@ public class BoatInnadrilTour implements Runnable
|
||||
{
|
||||
case 0:
|
||||
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL5);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 240000);
|
||||
ThreadPoolManager.schedule(this, 240000);
|
||||
break;
|
||||
case 1:
|
||||
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL1);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 40000);
|
||||
ThreadPoolManager.schedule(this, 40000);
|
||||
break;
|
||||
case 2:
|
||||
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL0);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 20000);
|
||||
ThreadPoolManager.schedule(this, 20000);
|
||||
break;
|
||||
case 3:
|
||||
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, LEAVING_INNADRIL, INNADRIL_SOUND);
|
||||
_boat.payForRide(0, 1, 107092, 219098, -3952);
|
||||
_boat.executePath(TOUR);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 650000);
|
||||
ThreadPoolManager.schedule(this, 650000);
|
||||
break;
|
||||
case 4:
|
||||
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL20);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 300000);
|
||||
ThreadPoolManager.schedule(this, 300000);
|
||||
break;
|
||||
case 5:
|
||||
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL15);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 300000);
|
||||
ThreadPoolManager.schedule(this, 300000);
|
||||
break;
|
||||
case 6:
|
||||
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL10);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 300000);
|
||||
ThreadPoolManager.schedule(this, 300000);
|
||||
break;
|
||||
case 7:
|
||||
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL5);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 240000);
|
||||
ThreadPoolManager.schedule(this, 240000);
|
||||
break;
|
||||
case 8:
|
||||
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL1);
|
||||
break;
|
||||
case 9:
|
||||
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, ARRIVED_AT_INNADRIL, INNADRIL_SOUND);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 300000);
|
||||
ThreadPoolManager.schedule(this, 300000);
|
||||
break;
|
||||
}
|
||||
_cycle++;
|
||||
|
||||
@@ -117,7 +117,7 @@ public class BoatRunePrimeval implements Runnable
|
||||
break;
|
||||
case 1:
|
||||
BoatManager.getInstance().broadcastPackets(PRIMEVAL_DOCK, RUNE_DOCK[0], ARRIVED_AT_PRIMEVAL, ARRIVED_AT_PRIMEVAL_2, PRIMEVAL_SOUND);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 180000);
|
||||
ThreadPoolManager.schedule(this, 180000);
|
||||
break;
|
||||
case 2:
|
||||
BoatManager.getInstance().broadcastPackets(PRIMEVAL_DOCK, RUNE_DOCK[0], LEAVING_PRIMEVAL, PRIMEVAL_SOUND);
|
||||
@@ -138,7 +138,7 @@ public class BoatRunePrimeval implements Runnable
|
||||
_shoutCount = 0;
|
||||
}
|
||||
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 5000);
|
||||
ThreadPoolManager.schedule(this, 5000);
|
||||
return;
|
||||
}
|
||||
_boat.executePath(RUNE_DOCK);
|
||||
@@ -146,7 +146,7 @@ public class BoatRunePrimeval implements Runnable
|
||||
case 4:
|
||||
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
|
||||
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], PRIMEVAL_DOCK, ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2, RUNE_SOUND);
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(this, 180000);
|
||||
ThreadPoolManager.schedule(this, 180000);
|
||||
break;
|
||||
}
|
||||
_shoutCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user