Threadpool refactoring.

This commit is contained in:
MobiusDev
2018-04-02 14:50:53 +00:00
parent 317478a66d
commit 0c201f75e7
1127 changed files with 5204 additions and 5174 deletions

View File

@@ -21,7 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -258,7 +258,7 @@ public final class QueenAnt extends AbstractNpcAI
{
((L2MonsterInstance) npc).getMinionList().spawnMinions(npc.getParameters().getMinionList("Privates"));
}
_task = ThreadPoolManager.scheduleAtFixedRate(new QueenAntTask(), 5 * 1000, 5 * 1000);
_task = ThreadPool.scheduleAtFixedRate(new QueenAntTask(), 5 * 1000, 5 * 1000);
break;
}
}

View File

@@ -19,7 +19,7 @@ package custom.events.Elpies;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -112,7 +112,7 @@ public final class Elpies extends Event
Broadcast.toAllOnlinePlayers("Help us exterminate them!");
Broadcast.toAllOnlinePlayers("You have " + EVENT_DURATION_MINUTES + " minutes!");
_eventTask = ThreadPoolManager.schedule(() ->
_eventTask = ThreadPool.schedule(() ->
{
Broadcast.toAllOnlinePlayers("Time is up!");
eventStop();

View File

@@ -22,7 +22,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -138,7 +138,7 @@ public final class Race extends Event
Broadcast.toAllOnlinePlayers("Visit Event Manager in Dion village and signup, you have " + _time_register + " min before Race Start...");
// Schedule Event end
_eventTask = ThreadPoolManager.schedule(() -> StartRace(), _time_register * 60 * 1000);
_eventTask = ThreadPool.schedule(() -> StartRace(), _time_register * 60 * 1000);
return true;
@@ -181,7 +181,7 @@ public final class Race extends Event
}
}
// Schedule timeup for Race
_eventTask = ThreadPoolManager.schedule(() -> timeUp(), _time_race * 60 * 1000);
_eventTask = ThreadPool.schedule(() -> timeUp(), _time_race * 60 * 1000);
}
@Override

View File

@@ -20,7 +20,7 @@ import java.util.NoSuchElementException;
import java.util.StringTokenizer;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
@@ -46,7 +46,7 @@ public class AdminTest implements IAdminCommandHandler
{
if (command.equals("admin_stats"))
{
for (String line : ThreadPoolManager.getStats())
for (String line : ThreadPool.getStats())
{
activeChar.sendMessage(line);
}

View File

@@ -16,7 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.SubclassInfoType;
import com.l2jmobius.gameserver.model.StatsSet;
@@ -56,7 +56,7 @@ public class ClassChange extends AbstractEffect
{
final L2PcInstance player = effected.getActingPlayer();
// TODO: FIX ME - Executing 1 second later otherwise interupted exception during storeCharBase()
ThreadPoolManager.schedule(() ->
ThreadPool.schedule(() ->
{
final int activeClass = player.getClassId().getId();

View File

@@ -16,7 +16,7 @@
*/
package handlers.playeractions;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.NextAction;
@@ -129,7 +129,7 @@ public final class SocialAction implements IPlayerActionHandler
player.sendPacket(sm);
if (!player.isProcessingRequest())
{
ThreadPoolManager.schedule(() -> scheduleDeny(player), 10000);
ThreadPool.schedule(() -> scheduleDeny(player), 10000);
player.blockRequest();
}
return;

View File

@@ -16,8 +16,8 @@
*/
package handlers.punishmenthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.LoginServerThread;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.handler.IPunishmentHandler;
import com.l2jmobius.gameserver.model.L2World;
@@ -162,7 +162,7 @@ public class JailHandler implements IPunishmentHandler
OlympiadManager.getInstance().removeDisconnectedCompetitor(player);
}
ThreadPoolManager.schedule(new TeleportTask(player, L2JailZone.getLocationIn()), 2000);
ThreadPool.schedule(new TeleportTask(player, L2JailZone.getLocationIn()), 2000);
// Open a Html message to inform the player
final NpcHtmlMessage msg = new NpcHtmlMessage();
@@ -198,7 +198,7 @@ public class JailHandler implements IPunishmentHandler
*/
private static void removeFromPlayer(L2PcInstance player)
{
ThreadPoolManager.schedule(new TeleportTask(player, L2JailZone.getLocationOut()), 2000);
ThreadPool.schedule(new TeleportTask(player, L2JailZone.getLocationOut()), 2000);
// Open a Html message to inform the player
final NpcHtmlMessage msg = new NpcHtmlMessage();

View File

@@ -34,10 +34,10 @@ import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameServer;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.LoginServerThread;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
import com.l2jmobius.gameserver.enums.ItemLocation;
import com.l2jmobius.gameserver.model.L2Object;
@@ -199,7 +199,7 @@ public class Debug implements ITelnetCommand
}
sb.append("\r\n## Thread Pool Manager Statistics ##\r\n");
for (String line : ThreadPoolManager.getStats())
for (String line : ThreadPool.getStats())
{
sb.append(line);
sb.append("\r\n");

View File

@@ -17,7 +17,7 @@
package handlers.telnethandlers.server;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.network.telnet.ITelnetCommand;
import io.netty.channel.ChannelHandlerContext;
@@ -44,7 +44,7 @@ public class Performance implements ITelnetCommand
{
// ThreadPoolManager.purge();
final StringBuilder sb = new StringBuilder();
for (String line : ThreadPoolManager.getStats())
for (String line : ThreadPool.getStats())
{
sb.append(line + Config.EOL);
}

View File

@@ -17,7 +17,7 @@
package handlers.telnethandlers.server;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.network.telnet.ITelnetCommand;
import io.netty.channel.ChannelHandlerContext;
@@ -42,9 +42,9 @@ public class Purge implements ITelnetCommand
@Override
public String handle(ChannelHandlerContext ctx, String[] args)
{
ThreadPoolManager.purge();
ThreadPool.purge();
final StringBuilder sb = new StringBuilder("STATUS OF THREAD POOLS AFTER PURGE COMMAND:" + Config.EOL);
for (String line : ThreadPoolManager.getStats())
for (String line : ThreadPool.getStats())
{
sb.append(line + Config.EOL);
}

View File

@@ -20,7 +20,7 @@ import java.util.HashMap;
import java.util.concurrent.Future;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.tasks.player.AutoPotionTask;
@@ -70,7 +70,7 @@ public class AutoPotion implements IVoicedCommandHandler
AUTO_POTION_TASKS.get(playerOID).cancel(true);
AUTO_POTION_TASKS.remove(playerOID);
}
AUTO_POTION_TASKS.put(activeChar.getObjectId(), ThreadPoolManager.scheduleAtFixedRate(new AutoPotionTask(activeChar), POTION_TASK_DELAY, POTION_TASK_DELAY));
AUTO_POTION_TASKS.put(activeChar.getObjectId(), ThreadPool.scheduleAtFixedRate(new AutoPotionTask(activeChar), POTION_TASK_DELAY, POTION_TASK_DELAY));
activeChar.sendMessage("Auto potions is enabled.");
return true;
}

View File

@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver;
package com.l2jmobius.commons.concurrent;
import java.util.ArrayList;
import java.util.List;
@@ -37,9 +37,9 @@ import com.l2jmobius.Config;
* <li>Instant pool handles short-life events.</li>
* </ul>
*/
public final class ThreadPoolManager
public final class ThreadPool
{
protected static final Logger LOG = Logger.getLogger(ThreadPoolManager.class.getName());
protected static final Logger LOG = Logger.getLogger(ThreadPool.class.getName());
private static final long MAX_DELAY = TimeUnit.NANOSECONDS.toMillis(Long.MAX_VALUE - System.nanoTime()) / 2;

View File

@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.Server;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.DeadLockDetector;
import com.l2jmobius.gameserver.cache.HtmCache;
@@ -179,7 +180,7 @@ public class GameServer
}
printSection("ThreadPool");
ThreadPoolManager.init();
ThreadPool.init();
EventDispatcher.getInstance();
// load script engines

View File

@@ -21,6 +21,7 @@ import java.util.LinkedList;
import java.util.List;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ItemLocation;
import com.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@@ -31,7 +32,7 @@ public final class ItemsAutoDestroy
protected ItemsAutoDestroy()
{
ThreadPoolManager.scheduleAtFixedRate(this::removeItems, 5000, 5000);
ThreadPool.scheduleAtFixedRate(this::removeItems, 5000, 5000);
}
public static ItemsAutoDestroy getInstance()

View File

@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.data.xml.impl.RecipeData;
import com.l2jmobius.gameserver.datatables.ItemTable;
@@ -109,7 +110,7 @@ public class RecipeController
if (Config.ALT_GAME_CREATION)
{
_activeMakers.put(manufacturer.getObjectId(), maker);
ThreadPoolManager.schedule(maker, 100);
ThreadPool.schedule(maker, 100);
}
else
{
@@ -158,7 +159,7 @@ public class RecipeController
if (Config.ALT_GAME_CREATION)
{
_activeMakers.put(player.getObjectId(), maker);
ThreadPoolManager.schedule(maker, 100);
ThreadPool.schedule(maker, 100);
}
else
{
@@ -354,7 +355,7 @@ public class RecipeController
_player.broadcastPacket(msk);
_player.sendPacket(new SetupGauge(_player.getObjectId(), 0, _delay));
ThreadPoolManager.schedule(this, 100 + _delay);
ThreadPool.schedule(this, 100 + _delay);
}
else
{
@@ -548,7 +549,7 @@ public class RecipeController
if (Config.ALT_GAME_CREATION && isWait)
{
_player.sendPacket(new SetupGauge(_player.getObjectId(), 0, _delay));
ThreadPoolManager.schedule(this, 100 + _delay);
ThreadPool.schedule(this, 100 + _delay);
}
else
{
@@ -570,7 +571,7 @@ public class RecipeController
if (Config.ALT_GAME_CREATION && isWait)
{
_player.sendPacket(new SetupGauge(_player.getObjectId(), 0, _delay));
ThreadPoolManager.schedule(this, 100 + _delay);
ThreadPool.schedule(this, 100 + _delay);
}
else
{

View File

@@ -20,6 +20,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
@@ -214,7 +215,7 @@ public class Shutdown extends Thread
// stop all thread pools
try
{
ThreadPoolManager.shutdown();
ThreadPool.shutdown();
LOGGER.info("Thread Pool Manager: Manager has been shut down(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
}
catch (Throwable t)

View File

@@ -23,9 +23,9 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.concurrent.Future;
import java.util.logging.Logger;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -728,7 +728,7 @@ public abstract class AbstractAI implements Ctrl
setTarget(target);
final int followRange = range == -1 ? Rnd.get(50, 100) : range;
_followTask = ThreadPoolManager.scheduleAtFixedRate(() ->
_followTask = ThreadPool.scheduleAtFixedRate(() ->
{
try
{

View File

@@ -29,9 +29,9 @@ import java.util.logging.Logger;
import java.util.stream.Stream;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.AISkillScope;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
@@ -206,7 +206,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
// If not idle - create an AI task (schedule onEvtThink repeatedly)
if (_aiTask == null)
{
_aiTask = ThreadPoolManager.scheduleAtFixedRate(this, 1000, 1000);
_aiTask = ThreadPool.scheduleAtFixedRate(this, 1000, 1000);
}
}

View File

@@ -31,7 +31,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ItemLocation;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -308,7 +308,7 @@ public class L2CharacterAI extends AbstractAI
if (_actor.isAttackingNow())
{
ThreadPoolManager.schedule(new CastTask(_actor, skill, target, item, forceUse, dontMove), _actor.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
ThreadPool.schedule(new CastTask(_actor, skill, target, item, forceUse, dontMove), _actor.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
}
else
{

View File

@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.ai;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.Location;
@@ -89,7 +89,7 @@ public class L2DoorAI extends L2CharacterAI
@Override
protected void onEvtAttacked(L2Character attacker)
{
ThreadPoolManager.execute(new onEventAttackedDoorTask((L2DoorInstance) _actor, attacker));
ThreadPool.execute(new onEventAttackedDoorTask((L2DoorInstance) _actor, attacker));
}
@Override

View File

@@ -22,8 +22,8 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.concurrent.Future;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -342,7 +342,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
{
if (_avoidTask == null)
{
_avoidTask = ThreadPoolManager.scheduleAtFixedRate(this, 100, 100);
_avoidTask = ThreadPool.scheduleAtFixedRate(this, 100, 100);
}
}

View File

@@ -20,7 +20,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
/**
@@ -33,7 +33,7 @@ public class WarehouseCacheManager
protected WarehouseCacheManager()
{
ThreadPoolManager.scheduleAtFixedRate(new CacheScheduler(), 120000, 60000);
ThreadPool.scheduleAtFixedRate(new CacheScheduler(), 120000, 60000);
}
public void addCacheTask(L2PcInstance pc)

View File

@@ -29,8 +29,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
import com.l2jmobius.gameserver.enums.UserInfoType;
@@ -335,7 +335,7 @@ public class ClanTable
public void scheduleRemoveClan(int clanId)
{
ThreadPoolManager.schedule(() ->
ThreadPool.schedule(() ->
{
if (getClan(clanId) == null)
{

View File

@@ -36,8 +36,8 @@ import org.xml.sax.Attributes;
import org.xml.sax.helpers.DefaultHandler;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;
@@ -425,11 +425,11 @@ public final class BotReportTable
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
}
ThreadPoolManager.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
}
catch (Exception e)
{
ThreadPoolManager.schedule(new ResetPointTask(), 24 * 3600 * 1000);
ThreadPool.schedule(new ResetPointTask(), 24 * 3600 * 1000);
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Could not properly schedule bot report points reset task. Scheduled in 24 hours.", e);
}
}

View File

@@ -29,8 +29,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
import com.l2jmobius.gameserver.engines.DocumentEngine;
import com.l2jmobius.gameserver.enums.ItemLocation;
@@ -222,14 +222,14 @@ public class ItemTable
if ((raid.getFirstCommandChannelAttacked() != null) && !Config.AUTO_LOOT_RAIDS)
{
item.setOwnerId(raid.getFirstCommandChannelAttacked().getLeaderObjectId());
itemLootShedule = ThreadPoolManager.schedule(new ResetOwner(item), Config.LOOT_RAIDS_PRIVILEGE_INTERVAL);
itemLootShedule = ThreadPool.schedule(new ResetOwner(item), Config.LOOT_RAIDS_PRIVILEGE_INTERVAL);
item.setItemLootShedule(itemLootShedule);
}
}
else if (!Config.AUTO_LOOT || ((reference instanceof L2EventMonsterInstance) && ((L2EventMonsterInstance) reference).eventDropOnGround()))
{
item.setOwnerId(actor.getObjectId());
itemLootShedule = ThreadPoolManager.schedule(new ResetOwner(item), 15000);
itemLootShedule = ThreadPool.schedule(new ResetOwner(item), 15000);
item.setItemLootShedule(itemLootShedule);
}
}

View File

@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.idfactory;
import java.util.BitSet;
import java.util.concurrent.atomic.AtomicInteger;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.util.PrimeFinder;
/**
@@ -53,7 +53,7 @@ public class BitSetIDFactory extends IdFactory
synchronized (BitSetIDFactory.class)
{
ThreadPoolManager.scheduleAtFixedRate(new BitSetCapacityCheck(), 30000, 30000);
ThreadPool.scheduleAtFixedRate(new BitSetCapacityCheck(), 30000, 30000);
initialize();
}
LOGGER.info(getClass().getSimpleName() + ": " + _freeIds.size() + " id's available.");

View File

@@ -38,10 +38,10 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.ManorMode;
import com.l2jmobius.gameserver.model.CropProcure;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -106,7 +106,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
// Schedule autosave
if (!Config.ALT_MANOR_SAVE_ALL_ACTIONS)
{
ThreadPoolManager.scheduleAtFixedRate(this::storeMe, Config.ALT_MANOR_SAVE_PERIOD_RATE * 60 * 60 * 1000, Config.ALT_MANOR_SAVE_PERIOD_RATE * 60 * 60 * 1000);
ThreadPool.scheduleAtFixedRate(this::storeMe, Config.ALT_MANOR_SAVE_PERIOD_RATE * 60 * 60 * 1000, Config.ALT_MANOR_SAVE_PERIOD_RATE * 60 * 60 * 1000);
}
}
else
@@ -277,7 +277,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
}
}
// Schedule mode change
ThreadPoolManager.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
}
public final void changeMode()

View File

@@ -33,9 +33,9 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.clan.entry.PledgeApplicantInfo;
import com.l2jmobius.gameserver.model.clan.entry.PledgeRecruitInfo;
import com.l2jmobius.gameserver.model.clan.entry.PledgeWaitingInfo;
@@ -390,7 +390,7 @@ public class ClanEntryManager
private static void lockPlayer(int playerId)
{
_playerLocked.put(playerId, ThreadPoolManager.schedule(() ->
_playerLocked.put(playerId, ThreadPool.schedule(() ->
{
_playerLocked.remove(playerId);
}, LOCK_TIME));
@@ -398,7 +398,7 @@ public class ClanEntryManager
private static void lockClan(int clanId)
{
_clanLocked.put(clanId, ThreadPoolManager.schedule(() ->
_clanLocked.put(clanId, ThreadPool.schedule(() ->
{
_clanLocked.remove(clanId);
}, LOCK_TIME));

View File

@@ -34,8 +34,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.ItemLocation;
import com.l2jmobius.gameserver.enums.MailType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -114,7 +114,7 @@ public final class CommissionManager
}
else
{
commissionItem.setSaleEndTask(ThreadPoolManager.schedule(() -> expireSale(commissionItem), Duration.between(Instant.now(), commissionItem.getEndTime()).toMillis()));
commissionItem.setSaleEndTask(ThreadPool.schedule(() -> expireSale(commissionItem), Duration.between(Instant.now(), commissionItem.getEndTime()).toMillis()));
}
}
}
@@ -259,7 +259,7 @@ public final class CommissionManager
if (rs.next())
{
final CommissionItem commissionItem = new CommissionItem(rs.getLong(1), itemInstance, pricePerUnit, startTime, durationInDays);
final ScheduledFuture<?> saleEndTask = ThreadPoolManager.schedule(() -> expireSale(commissionItem), Duration.between(Instant.now(), commissionItem.getEndTime()).toMillis());
final ScheduledFuture<?> saleEndTask = ThreadPool.schedule(() -> expireSale(commissionItem), Duration.between(Instant.now(), commissionItem.getEndTime()).toMillis());
commissionItem.setSaleEndTask(saleEndTask);
_commissionItems.put(commissionItem.getCommissionId(), commissionItem);
player.getLastCommissionInfos().put(itemInstance.getId(), new ExResponseCommissionInfo(itemInstance.getId(), pricePerUnit, itemCount, (byte) ((durationInDays - 1) / 2)));

View File

@@ -29,9 +29,9 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.SpawnsData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
@@ -209,7 +209,7 @@ public class DBSpawnManager
{
LOGGER.info(getClass().getSimpleName() + ": Updated " + npc.getName() + " respawn time to " + Util.formatDate(new Date(respawnTime), "dd.MM.yyyy HH:mm"));
_schedules.put(npc.getId(), ThreadPoolManager.schedule(() -> scheduleSpawn(npc.getId()), respawnDelay));
_schedules.put(npc.getId(), ThreadPool.schedule(() -> scheduleSpawn(npc.getId()), respawnDelay));
updateDb();
}
}
@@ -270,7 +270,7 @@ public class DBSpawnManager
else
{
final long spawnTime = respawnTime - System.currentTimeMillis();
_schedules.put(npcId, ThreadPoolManager.schedule(() -> scheduleSpawn(npcId), spawnTime));
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
}
_spawns.put(npcId, spawn);

View File

@@ -24,9 +24,9 @@ import java.util.logging.Logger;
import org.w3c.dom.Document;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.ChatType;
@@ -80,12 +80,12 @@ public final class FakePlayerChatManager implements IGameXmlReader
public void manageChat(L2PcInstance player, String fpcName, String message)
{
ThreadPoolManager.schedule(() -> manageResponce(player, fpcName, message), Rnd.get(MIN_DELAY, MAX_DELAY));
ThreadPool.schedule(() -> manageResponce(player, fpcName, message), Rnd.get(MIN_DELAY, MAX_DELAY));
}
public void manageChat(L2PcInstance player, String fpcName, String message, int minDelay, int maxDelay)
{
ThreadPoolManager.schedule(() -> manageResponce(player, fpcName, message), Rnd.get(minDelay, maxDelay));
ThreadPool.schedule(() -> manageResponce(player, fpcName, message), Rnd.get(minDelay, maxDelay));
}
private void manageResponce(L2PcInstance player, String fpcName, String message)

View File

@@ -20,7 +20,7 @@ import java.util.Calendar;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
import com.l2jmobius.gameserver.model.quest.Quest;
@@ -112,7 +112,7 @@ public final class GraciaSeedsManager
}
else
{
ThreadPoolManager.schedule(new UpdateSoDStateTask(), Config.SOD_STAGE_2_LENGTH - timePast);
ThreadPool.schedule(new UpdateSoDStateTask(), Config.SOD_STAGE_2_LENGTH - timePast);
}
break;
}

View File

@@ -29,8 +29,8 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.instancemanager.tasks.GrandBossManagerStoreTask;
import com.l2jmobius.gameserver.model.StatsSet;
@@ -104,7 +104,7 @@ public final class GrandBossManager implements IStorable
{
_log.log(Level.WARNING, getClass().getSimpleName() + ": Error while initializing GrandBossManager: " + e.getMessage(), e);
}
ThreadPoolManager.scheduleAtFixedRate(new GrandBossManagerStoreTask(), 5 * 60 * 1000, 5 * 60 * 1000);
ThreadPool.scheduleAtFixedRate(new GrandBossManagerStoreTask(), 5 * 60 * 1000, 5 * 60 * 1000);
}
public int getBossStatus(int bossId)

View File

@@ -23,7 +23,7 @@ import java.util.Map;
import java.util.Set;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.Team;
import com.l2jmobius.gameserver.instancemanager.tasks.PenaltyRemoveTask;
import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
@@ -86,7 +86,7 @@ public final class HandysBlockCheckerManager
{
holder.checkAndShuffle();
}
ThreadPoolManager.execute(holder.getEvent().new StartEvent());
ThreadPool.execute(holder.getEvent().new StartEvent());
}
else
{
@@ -364,7 +364,7 @@ public final class HandysBlockCheckerManager
private void schedulePenaltyRemoval(int objId)
{
ThreadPoolManager.schedule(new PenaltyRemoveTask(objId), 10000);
ThreadPool.schedule(new PenaltyRemoveTask(objId), 10000);
}
/**

View File

@@ -27,9 +27,9 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ItemsAutoDestroy;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@@ -47,7 +47,7 @@ public final class ItemsOnGroundManager implements Runnable
{
if (Config.SAVE_DROPPED_ITEM_INTERVAL > 0)
{
ThreadPoolManager.scheduleAtFixedRate(this, Config.SAVE_DROPPED_ITEM_INTERVAL, Config.SAVE_DROPPED_ITEM_INTERVAL);
ThreadPool.scheduleAtFixedRate(this, Config.SAVE_DROPPED_ITEM_INTERVAL, Config.SAVE_DROPPED_ITEM_INTERVAL);
}
load();
}

View File

@@ -29,8 +29,8 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.MailType;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.instancemanager.tasks.MessageDeletionTask;
@@ -74,11 +74,11 @@ public final class MailManager
if (expiration < System.currentTimeMillis())
{
ThreadPoolManager.schedule(new MessageDeletionTask(msgId), 10000);
ThreadPool.schedule(new MessageDeletionTask(msgId), 10000);
}
else
{
ThreadPoolManager.schedule(new MessageDeletionTask(msgId), expiration - System.currentTimeMillis());
ThreadPool.schedule(new MessageDeletionTask(msgId), expiration - System.currentTimeMillis());
}
}
}
@@ -209,7 +209,7 @@ public final class MailManager
receiver.sendPacket(new ExUnReadMailCount(receiver));
}
ThreadPoolManager.schedule(new MessageDeletionTask(msg.getId()), msg.getExpiration() - System.currentTimeMillis());
ThreadPool.schedule(new MessageDeletionTask(msg.getId()), msg.getExpiration() - System.currentTimeMillis());
}
public final void markAsReadInDb(int msgId)

View File

@@ -26,8 +26,8 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.Containers;
@@ -109,7 +109,7 @@ public class PremiumManager
*/
private void startExpireTask(L2PcInstance player, long delay)
{
ScheduledFuture<?> task = ThreadPoolManager.schedule(new PremiumExpireTask(player), delay);
ScheduledFuture<?> task = ThreadPool.schedule(new PremiumExpireTask(player), delay);
expiretasks.put(player.getAccountName(), task);
}

View File

@@ -21,8 +21,8 @@ import java.util.Calendar;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.Shutdown;
import com.l2jmobius.gameserver.ThreadPoolManager;
/**
* @author Gigi
@@ -71,7 +71,7 @@ public class ServerRestartManager
if (lastRestart != null)
{
nextRestartTime = new SimpleDateFormat("HH:mm").format(lastRestart.getTime());
ThreadPoolManager.schedule(new ServerRestartTask(), lastDelay - (Config.SERVER_RESTART_SCHEDULE_COUNTDOWN * 1000));
ThreadPool.schedule(new ServerRestartTask(), lastDelay - (Config.SERVER_RESTART_SCHEDULE_COUNTDOWN * 1000));
_log.info("Scheduled server restart at " + lastRestart.getTime() + ".");
}
}

View File

@@ -27,8 +27,8 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.enums.ChatType;
@@ -299,13 +299,13 @@ public final class WalkingManager implements IGameXmlReader
npc.setWalking();
}
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node);
walk.setWalkCheckTask(ThreadPoolManager.scheduleAtFixedRate(new StartMovingTask(npc, routeName), 60000, 60000)); // start walk check task, for resuming walk after fight
walk.setWalkCheckTask(ThreadPool.scheduleAtFixedRate(new StartMovingTask(npc, routeName), 60000, 60000)); // start walk check task, for resuming walk after fight
_activeRoutes.put(npc.getObjectId(), walk); // register route
}
else
{
ThreadPoolManager.schedule(new StartMovingTask(npc, routeName), 60000);
ThreadPool.schedule(new StartMovingTask(npc, routeName), 60000);
}
}
else
@@ -446,7 +446,7 @@ public final class WalkingManager implements IGameXmlReader
npc.broadcastSay(ChatType.NPC_GENERAL, node.getChatText());
}
ThreadPoolManager.schedule(new ArrivedTask(npc, walk), 100 + (node.getDelay() * 1000L));
ThreadPool.schedule(new ArrivedTask(npc, walk), 100 + (node.getDelay() * 1000L));
}
}
}

View File

@@ -21,7 +21,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventDispatcher;
@@ -56,7 +56,7 @@ public final class ClanWar
_startTime = System.currentTimeMillis();
_state = ClanWarState.BLOOD_DECLARATION;
_cancelTask = ThreadPoolManager.schedule(() ->
_cancelTask = ThreadPool.schedule(() ->
{
clanWarTimeout();
}, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
@@ -88,7 +88,7 @@ public final class ClanWar
if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > System.currentTimeMillis())
{
_cancelTask = ThreadPoolManager.schedule(() ->
_cancelTask = ThreadPool.schedule(() ->
{
clanWarTimeout();
}, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
@@ -104,7 +104,7 @@ public final class ClanWar
}
else
{
ThreadPoolManager.schedule(() ->
ThreadPool.schedule(() ->
{
ClanTable.getInstance().deleteclanswars(_attackerClanId, _attackedClanId);
}, endTimePeriod);
@@ -200,7 +200,7 @@ public final class ClanWar
_winnerClanId = winnerClan.getId();
_endTime = System.currentTimeMillis();
ThreadPoolManager.schedule(() ->
ThreadPool.schedule(() ->
{
ClanTable.getInstance().deleteclanswars(cancelor.getId(), winnerClan.getId());
}, (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
@@ -225,7 +225,7 @@ public final class ClanWar
_state = ClanWarState.TIE;
_endTime = System.currentTimeMillis();
ThreadPoolManager.schedule(() ->
ThreadPool.schedule(() ->
{
ClanTable.getInstance().deleteclanswars(attackerClan.getId(), attackedClan.getId());
}, (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());

View File

@@ -22,7 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import java.util.function.Predicate;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.events.EventDispatcher;
import com.l2jmobius.gameserver.model.events.impl.character.OnCreatureSee;
@@ -63,7 +63,7 @@ public class CreatureContainer
{
if ((_task == null) || _task.isDone())
{
_task = ThreadPoolManager.scheduleAtFixedRate(this::update, 1000L, 1000L);
_task = ThreadPool.scheduleAtFixedRate(this::update, 1000L, 1000L);
}
}

View File

@@ -24,9 +24,9 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import com.l2jmobius.gameserver.model.L2Party.MessageType;
@@ -350,7 +350,7 @@ public class CursedWeapon implements INamable
{
_player.stopTransformation(true);
ThreadPoolManager.schedule(() -> _player.transform(transformationId, true), 500);
ThreadPool.schedule(() -> _player.transform(transformationId, true), 500);
}
else
{
@@ -374,7 +374,7 @@ public class CursedWeapon implements INamable
}
else
{
_removeTask = ThreadPoolManager.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000L, _durationLost * 12000L);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000L, _durationLost * 12000L);
}
}
@@ -388,7 +388,7 @@ public class CursedWeapon implements INamable
// Start the Life Task
_endTime = System.currentTimeMillis() + (_duration * 60000L);
_removeTask = ThreadPoolManager.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000L, _durationLost * 12000L);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000L, _durationLost * 12000L);
return true;
}

View File

@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
@@ -104,6 +104,6 @@ public class DropProtection implements Runnable
throw new NullPointerException("Trying to protect dropped item to null owner");
}
_task = ThreadPoolManager.schedule(this, PROTECTED_MILLIS_TIME);
_task = ThreadPool.schedule(this, PROTECTED_MILLIS_TIME);
}
}

View File

@@ -21,8 +21,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FishingData;
import com.l2jmobius.gameserver.enums.ShotType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -220,10 +220,10 @@ public class Fishing
_player.rechargeShots(false, false, true);
}
_reelInTask = ThreadPoolManager.schedule(() ->
_reelInTask = ThreadPool.schedule(() ->
{
_player.getFishing().reelInWithReward();
_startFishingTask = ThreadPoolManager.schedule(() -> _player.getFishing().castLine(), Rnd.get(baitData.getWaitMin(), baitData.getWaitMax()));
_startFishingTask = ThreadPool.schedule(() -> _player.getFishing().castLine(), Rnd.get(baitData.getWaitMin(), baitData.getWaitMax()));
}, Rnd.get(baitData.getTimeMin(), baitData.getTimeMax()));
_player.stopMove(null);
_player.broadcastPacket(new ExFishingStart(_player, -1, baitData.getLevel(), _baitLocation));

View File

@@ -33,8 +33,8 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.communitybbs.BB.Forum;
import com.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
@@ -3157,7 +3157,7 @@ public class L2Clan implements IIdentifiable, INamable
_vars = new ClanVariables(getId());
if (Config.CLAN_VARIABLES_STORE_INTERVAL > 0)
{
ThreadPoolManager.scheduleAtFixedRate(this::storeVariables, Config.CLAN_VARIABLES_STORE_INTERVAL, Config.CLAN_VARIABLES_STORE_INTERVAL);
ThreadPool.scheduleAtFixedRate(this::storeVariables, Config.CLAN_VARIABLES_STORE_INTERVAL, Config.CLAN_VARIABLES_STORE_INTERVAL);
}
}
}

View File

@@ -30,9 +30,9 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.enums.PartyDistributionType;
import com.l2jmobius.gameserver.instancemanager.DuelManager;
@@ -380,7 +380,7 @@ public class L2Party extends AbstractPlayerGroup
if (_positionBroadcastTask == null)
{
_positionBroadcastTask = ThreadPoolManager.scheduleAtFixedRate(() ->
_positionBroadcastTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (_positionPacket == null)
{
@@ -1089,7 +1089,7 @@ public class L2Party extends AbstractPlayerGroup
}
_changeRequestDistributionType = partyDistributionType;
_changeDistributionTypeAnswers = new HashSet<>();
_changeDistributionTypeRequestTask = ThreadPoolManager.schedule(() -> finishLootRequest(false), PARTY_DISTRIBUTION_TYPE_REQUEST_TIMEOUT.toMillis());
_changeDistributionTypeRequestTask = ThreadPool.schedule(() -> finishLootRequest(false), PARTY_DISTRIBUTION_TYPE_REQUEST_TIMEOUT.toMillis());
broadcastToPartyMembers(getLeader(), new ExAskModifyPartyLooting(getLeader().getName(), partyDistributionType));

View File

@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.model;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -123,7 +123,7 @@ public class L2Request
{
_isRequestor = isRequestor;
_isAnswerer = !isRequestor;
ThreadPoolManager.schedule(() -> clear(), REQUEST_TIMEOUT * 1000);
ThreadPool.schedule(() -> clear(), REQUEST_TIMEOUT * 1000);
}
/**

View File

@@ -24,8 +24,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -396,7 +396,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
_scheduledCount++;
// Create a new SpawnTask to launch after the respawn Delay
ThreadPoolManager.schedule(new SpawnTask(), hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay);
ThreadPool.schedule(new SpawnTask(), hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay);
}
}

View File

@@ -24,7 +24,7 @@ import java.util.function.Predicate;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -186,7 +186,7 @@ public final class L2WorldRegion
}
// then, set a timer to activate the neighbors
_neighborsTask = ThreadPoolManager.schedule(new NeighborsTask(true), 1000 * Config.GRID_NEIGHBOR_TURNON_TIME);
_neighborsTask = ThreadPool.schedule(new NeighborsTask(true), 1000 * Config.GRID_NEIGHBOR_TURNON_TIME);
}
}
@@ -206,7 +206,7 @@ public final class L2WorldRegion
// start a timer to "suggest" a deactivate to self and neighbors.
// suggest means: first check if a neighbor has L2PcInstances in it. If not, deactivate.
_neighborsTask = ThreadPoolManager.schedule(new NeighborsTask(false), 1000 * Config.GRID_NEIGHBOR_TURNOFF_TIME);
_neighborsTask = ThreadPool.schedule(new NeighborsTask(false), 1000 * Config.GRID_NEIGHBOR_TURNOFF_TIME);
}
}

View File

@@ -20,7 +20,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicInteger;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
@@ -41,7 +41,7 @@ public class MpRewardTask
_creature = creature;
_count = new AtomicInteger(template.getMpRewardTicks());
_value = calculateBaseValue(npc, creature);
_task = ThreadPoolManager.scheduleAtFixedRate(this::run, Config.EFFECT_TICK_RATIO, Config.EFFECT_TICK_RATIO);
_task = ThreadPool.scheduleAtFixedRate(this::run, Config.EFFECT_TICK_RATIO, Config.EFFECT_TICK_RATIO);
}
/**

View File

@@ -32,8 +32,8 @@ import java.util.logging.Level;
import java.util.stream.Collectors;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.L2AttackableAI;
@@ -231,7 +231,7 @@ public class L2Attackable extends L2Npc
{
_commandChannelTimer = new CommandChannelTimer(this);
_commandChannelLastAttack = System.currentTimeMillis();
ThreadPoolManager.schedule(_commandChannelTimer, 10000); // check for last attack
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(0, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
}

View File

@@ -40,10 +40,10 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.EmptyQueue;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.L2AttackableAI;
@@ -1010,7 +1010,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
if (isPlayer())
{
ThreadPoolManager.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
sendPacket(ActionFailed.STATIC_PACKET);
}
return;
@@ -1049,7 +1049,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
if (getCurrentMp() < mpConsume)
{
// If L2PcInstance doesn't have enough MP, stop the attack
ThreadPoolManager.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET);
return;
@@ -1119,14 +1119,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Calculate and set the disable delay of the bow in function of the Attack Speed
_disableRangedAttackEndTime = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(reuse);
_hitTask = ThreadPoolManager.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
_hitTask = ThreadPool.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
break;
}
case FIST:
{
if (!isPlayer())
{
_hitTask = ThreadPoolManager.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
_hitTask = ThreadPool.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
break;
}
}
@@ -1136,12 +1136,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
case DUALDAGGER:
{
final int timeToHit2 = Formulas.calculateTimeToHit(timeAtk, weaponType, isTwoHanded, true) - timeToHit;
_hitTask = ThreadPoolManager.schedule(() -> onFirstHitTimeForDual(weaponItem, attack, timeToHit, timeAtk, timeToHit2), timeToHit);
_hitTask = ThreadPool.schedule(() -> onFirstHitTimeForDual(weaponItem, attack, timeToHit, timeAtk, timeToHit2), timeToHit);
break;
}
default:
{
_hitTask = ThreadPoolManager.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
_hitTask = ThreadPool.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
break;
}
}
@@ -2986,7 +2986,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
if (distFraction > 1)
{
ThreadPoolManager.execute(() -> getAI().notifyEvent(CtrlEvent.EVT_ARRIVED));
ThreadPool.execute(() -> getAI().notifyEvent(CtrlEvent.EVT_ARRIVED));
return true;
}
@@ -3404,7 +3404,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Create a task to notify the AI that L2Character arrives at a check point of the movement
if ((ticksToMove * GameTimeController.MILLIS_IN_TICK) > 3000)
{
ThreadPoolManager.schedule(new NotifyAITask(this, CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
}
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive to destination by GameTimeController
}
@@ -3482,7 +3482,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Create a task to notify the AI that L2Character arrives at a check point of the movement
if ((ticksToMove * GameTimeController.MILLIS_IN_TICK) > 3000)
{
ThreadPoolManager.schedule(new NotifyAITask(this, CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
}
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive
@@ -3635,7 +3635,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
}
_hitTask = ThreadPoolManager.schedule(() -> onAttackFinish(attack), attackTime - hitTime);
_hitTask = ThreadPool.schedule(() -> onAttackFinish(attack), attackTime - hitTime);
}
public void onFirstHitTimeForDual(L2Weapon weapon, Attack attack, int hitTime, int attackTime, int delayForSecondAttack)
@@ -3646,7 +3646,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return;
}
_hitTask = ThreadPoolManager.schedule(() -> onSecondHitTimeForDual(weapon, attack, hitTime, delayForSecondAttack, attackTime), delayForSecondAttack);
_hitTask = ThreadPool.schedule(() -> onSecondHitTimeForDual(weapon, attack, hitTime, delayForSecondAttack, attackTime), delayForSecondAttack);
// First dual attack is the first hit only.
final Hit hit = attack.getHits().get(0);
@@ -3696,7 +3696,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
}
_hitTask = ThreadPoolManager.schedule(() -> onAttackFinish(attack), attackTime - (hitTime1 + hitTime2));
_hitTask = ThreadPool.schedule(() -> onAttackFinish(attack), attackTime - (hitTime1 + hitTime2));
}
public void onHitTarget(L2Character target, L2Weapon weapon, Hit hit)

View File

@@ -20,9 +20,9 @@ import java.util.List;
import java.util.logging.Level;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ItemsAutoDestroy;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
import com.l2jmobius.gameserver.datatables.ItemTable;
@@ -1316,7 +1316,7 @@ public class L2Npc extends L2Character
public void scheduleDespawn(long delay)
{
ThreadPoolManager.schedule(() ->
ThreadPool.schedule(() ->
{
if (!isDecayed())
{

View File

@@ -21,8 +21,8 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -87,7 +87,7 @@ public abstract class L2Vehicle extends L2Character
{
if (_engine != null)
{
ThreadPoolManager.schedule(_engine, delay);
ThreadPool.schedule(_engine, delay);
}
}

View File

@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.concurrent.Future;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.model.actor.stat.ControllableAirShipStat;
@@ -253,8 +253,8 @@ public class L2ControllableAirShipInstance extends L2AirShipInstance
public void onSpawn()
{
super.onSpawn();
_checkTask = ThreadPoolManager.scheduleAtFixedRate(new CheckTask(), 60000, 10000);
_consumeFuelTask = ThreadPoolManager.scheduleAtFixedRate(new ConsumeFuelTask(), 60000, 60000);
_checkTask = ThreadPool.scheduleAtFixedRate(new CheckTask(), 60000, 10000);
_consumeFuelTask = ThreadPool.scheduleAtFixedRate(new ConsumeFuelTask(), 60000, 60000);
}
@Override
@@ -326,7 +326,7 @@ public class L2ControllableAirShipInstance extends L2AirShipInstance
if (isSpawned() && isEmpty() && !isInDock())
{
// deleteMe() can't be called from CheckTask because task should not cancel itself
ThreadPoolManager.execute(new DecayTask());
ThreadPool.execute(new DecayTask());
}
}
}

View File

@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.concurrent.Future;
import java.util.logging.Level;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -53,8 +53,8 @@ public class L2DecoyInstance extends L2Character
_totalLifeTime = totalLifeTime;
_timeRemaining = _totalLifeTime;
final int skilllevel = getTemplate().getDisplayId() - 13070;
_DecoyLifeTask = ThreadPoolManager.scheduleAtFixedRate(new DecoyLifetime(getOwner(), this), 1000, 1000);
_HateSpam = ThreadPoolManager.scheduleAtFixedRate(new HateSpam(this, SkillData.getInstance().getSkill(5272, skilllevel)), 2000, 5000);
_DecoyLifeTask = ThreadPool.scheduleAtFixedRate(new DecoyLifetime(getOwner(), this), 1000, 1000);
_HateSpam = ThreadPool.scheduleAtFixedRate(new HateSpam(this, SkillData.getInstance().getSkill(5272, skilllevel)), 2000, 5000);
}
@Override

View File

@@ -20,8 +20,8 @@ import java.util.Collection;
import java.util.Set;
import java.util.concurrent.Future;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.L2CharacterAI;
import com.l2jmobius.gameserver.ai.L2DoorAI;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
@@ -107,7 +107,7 @@ public final class L2DoorInstance extends L2Character
{
delay += Rnd.get(getTemplate().getRandomTime());
}
ThreadPoolManager.schedule(new TimerOpen(), delay * 1000);
ThreadPool.schedule(new TimerOpen(), delay * 1000);
}
@Override
@@ -641,7 +641,7 @@ public final class L2DoorInstance extends L2Character
_autoCloseTask = null;
oldTask.cancel(false);
}
_autoCloseTask = ThreadPoolManager.schedule(new AutoClose(), getTemplate().getCloseTime() * 1000);
_autoCloseTask = ThreadPool.schedule(new AutoClose(), getTemplate().getCloseTime() * 1000);
}
class AutoClose implements Runnable
@@ -676,7 +676,7 @@ public final class L2DoorInstance extends L2Character
{
delay += Rnd.get(getTemplate().getRandomTime());
}
ThreadPoolManager.schedule(this, delay * 1000);
ThreadPool.schedule(this, delay * 1000);
}
}

View File

@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.List;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.InstanceType;
@@ -146,7 +146,7 @@ public class L2FortCommanderInstance extends L2DefenderInstance
{
broadcastSay(ChatType.NPC_SHOUT, npcString, npcString.getParamCount() == 1 ? attacker.getName() : null);
setCanTalk(false);
ThreadPoolManager.schedule(new ScheduleTalkTask(), 10000);
ThreadPool.schedule(new ScheduleTalkTask(), 10000);
}
}
}

View File

@@ -45,13 +45,13 @@ import java.util.logging.Level;
import java.util.stream.Collectors;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ItemsAutoDestroy;
import com.l2jmobius.gameserver.LoginServerThread;
import com.l2jmobius.gameserver.RecipeController;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.L2CharacterAI;
import com.l2jmobius.gameserver.ai.L2PlayerAI;
@@ -819,7 +819,7 @@ public final class L2PcInstance extends L2Playable
if (_PvPRegTask == null)
{
_PvPRegTask = ThreadPoolManager.scheduleAtFixedRate(new PvPFlagTask(this), 1000, 1000);
_PvPRegTask = ThreadPool.scheduleAtFixedRate(new PvPFlagTask(this), 1000, 1000);
}
}
@@ -2808,7 +2808,7 @@ public final class L2PcInstance extends L2Playable
getAI().setIntention(CtrlIntention.AI_INTENTION_REST);
broadcastPacket(new ChangeWaitType(this, ChangeWaitType.WT_SITTING));
// Schedule a sit down task to wait for the animation to finish
ThreadPoolManager.schedule(new SitDownTask(this), 2500);
ThreadPool.schedule(new SitDownTask(this), 2500);
setBlockActions(true);
}
}
@@ -2831,7 +2831,7 @@ public final class L2PcInstance extends L2Playable
broadcastPacket(new ChangeWaitType(this, ChangeWaitType.WT_STANDING));
// Schedule a stand up task to wait for the animation to finish
ThreadPoolManager.schedule(new StandUpTask(this), 2500);
ThreadPool.schedule(new StandUpTask(this), 2500);
}
}
@@ -7734,7 +7734,7 @@ public final class L2PcInstance extends L2Playable
removeHenna(slot);
continue;
}
_hennaRemoveSchedules.put(slot, ThreadPoolManager.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
}
_henna[slot - 1] = henna;
@@ -7906,7 +7906,7 @@ public final class L2PcInstance extends L2Playable
if (henna.getDuration() > 0)
{
getVariables().set("HennaDuration" + i, System.currentTimeMillis() + (henna.getDuration() * 60000));
_hennaRemoveSchedules.put(i, ThreadPoolManager.schedule(new HennaDurationTask(this, i), System.currentTimeMillis() + (henna.getDuration() * 60000)));
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), System.currentTimeMillis() + (henna.getDuration() * 60000)));
}
// Reward henna skills
@@ -8018,7 +8018,7 @@ public final class L2PcInstance extends L2Playable
{
if ((Config.CHAR_DATA_STORE_INTERVAL > 0) && (_autoSaveTask == null))
{
_autoSaveTask = ThreadPoolManager.scheduleAtFixedRate(this::autoSave, 300_000L, TimeUnit.MINUTES.toMillis(Config.CHAR_DATA_STORE_INTERVAL));
_autoSaveTask = ThreadPool.scheduleAtFixedRate(this::autoSave, 300_000L, TimeUnit.MINUTES.toMillis(Config.CHAR_DATA_STORE_INTERVAL));
}
}
@@ -8620,7 +8620,7 @@ public final class L2PcInstance extends L2Playable
_inventoryDisable = val;
if (val)
{
ThreadPoolManager.schedule(new InventoryEnableTask(this), 1500);
ThreadPool.schedule(new InventoryEnableTask(this), 1500);
}
}
@@ -9432,7 +9432,7 @@ public final class L2PcInstance extends L2Playable
{
if (_skillListRefreshTask == null)
{
_skillListRefreshTask = ThreadPoolManager.schedule(() ->
_skillListRefreshTask = ThreadPool.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
@@ -9903,7 +9903,7 @@ public final class L2PcInstance extends L2Playable
{
if (_taskWarnUserTakeBreak == null)
{
_taskWarnUserTakeBreak = ThreadPoolManager.scheduleAtFixedRate(new WarnUserTakeBreakTask(this), 3600000, 3600000);
_taskWarnUserTakeBreak = ThreadPool.scheduleAtFixedRate(new WarnUserTakeBreakTask(this), 3600000, 3600000);
}
}
@@ -9929,7 +9929,7 @@ public final class L2PcInstance extends L2Playable
{
if (_taskRentPet == null)
{
_taskRentPet = ThreadPoolManager.scheduleAtFixedRate(new RentPetTask(this), seconds * 1000L, seconds * 1000L);
_taskRentPet = ThreadPool.scheduleAtFixedRate(new RentPetTask(this), seconds * 1000L, seconds * 1000L);
}
}
@@ -9960,7 +9960,7 @@ public final class L2PcInstance extends L2Playable
final int timeinwater = (int) getStat().getValue(Stats.BREATH, 60000);
sendPacket(new SetupGauge(getObjectId(), 2, timeinwater));
_taskWater = ThreadPoolManager.scheduleAtFixedRate(new WaterTask(this), timeinwater, 1000);
_taskWater = ThreadPool.scheduleAtFixedRate(new WaterTask(this), timeinwater, 1000);
}
}
@@ -10341,7 +10341,7 @@ public final class L2PcInstance extends L2Playable
{
if (_teleportWatchdog == null)
{
_teleportWatchdog = ThreadPoolManager.schedule(new TeleportWatchdogTask(this), Config.TELEPORT_WATCHDOG_TIMEOUT * 1000);
_teleportWatchdog = ThreadPool.schedule(new TeleportWatchdogTask(this), Config.TELEPORT_WATCHDOG_TIMEOUT * 1000);
}
}
}
@@ -11225,7 +11225,7 @@ public final class L2PcInstance extends L2Playable
}
if (_fameTask == null)
{
_fameTask = ThreadPoolManager.scheduleAtFixedRate(new FameTask(this, fameFixRate), delay, delay);
_fameTask = ThreadPool.scheduleAtFixedRate(new FameTask(this, fameFixRate), delay, delay);
}
}
@@ -11345,7 +11345,7 @@ public final class L2PcInstance extends L2Playable
_soulTask.cancel(false);
_soulTask = null;
}
_soulTask = ThreadPoolManager.schedule(new ResetSoulsTask(this), 600000);
_soulTask = ThreadPool.schedule(new ResetSoulsTask(this), 600000);
}
@@ -11717,7 +11717,7 @@ public final class L2PcInstance extends L2Playable
sendPacket(new SetupGauge(3, (getCurrentFeed() * 10000) / getFeedConsume(), (getMaxFeed() * 10000) / getFeedConsume()));
if (!isDead())
{
_mountFeedTask = ThreadPoolManager.scheduleAtFixedRate(new PetFeedTask(this), 10000, 10000);
_mountFeedTask = ThreadPool.scheduleAtFixedRate(new PetFeedTask(this), 10000, 10000);
}
}
else if (_canFeed)
@@ -11727,7 +11727,7 @@ public final class L2PcInstance extends L2Playable
sendPacket(sg);
if (!isDead())
{
_mountFeedTask = ThreadPoolManager.scheduleAtFixedRate(new PetFeedTask(this), 10000, 10000);
_mountFeedTask = ThreadPool.scheduleAtFixedRate(new PetFeedTask(this), 10000, 10000);
}
}
}
@@ -11804,7 +11804,7 @@ public final class L2PcInstance extends L2Playable
public void enteredNoLanding(int delay)
{
_dismountTask = ThreadPoolManager.schedule(new DismountTask(this), delay * 1000);
_dismountTask = ThreadPool.schedule(new DismountTask(this), delay * 1000);
}
public void exitedNoLanding()
@@ -11925,7 +11925,7 @@ public final class L2PcInstance extends L2Playable
_chargeTask.cancel(false);
_chargeTask = null;
}
_chargeTask = ThreadPoolManager.schedule(new ResetChargesTask(this), 600000);
_chargeTask = ThreadPool.schedule(new ResetChargesTask(this), 600000);
}
/**
@@ -12964,7 +12964,7 @@ public final class L2PcInstance extends L2Playable
public void startRecoGiveTask()
{
// Create task to give new recommendations
_recoGiveTask = ThreadPoolManager.scheduleAtFixedRate(new RecoGiveTask(this), 7200000, 3600000);
_recoGiveTask = ThreadPool.scheduleAtFixedRate(new RecoGiveTask(this), 7200000, 3600000);
// Store new data
storeRecommendations();
@@ -13906,7 +13906,7 @@ public final class L2PcInstance extends L2Playable
stopOnlineTimeUpdateTask();
}
_onlineTimeUpdateTask = ThreadPoolManager.scheduleAtFixedRate(this::updateOnlineTime, 60 * 1000L, 60 * 1000L);
_onlineTimeUpdateTask = ThreadPool.scheduleAtFixedRate(this::updateOnlineTime, 60 * 1000L, 60 * 1000L);
}
private void updateOnlineTime()

View File

@@ -29,9 +29,9 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.sql.impl.CharSummonTable;
import com.l2jmobius.gameserver.data.sql.impl.SummonEffectsTable;
@@ -1133,7 +1133,7 @@ public class L2PetInstance extends L2Summon
stopFeed();
if (!isDead() && (getOwner().getPet() == this))
{
_feedTask = ThreadPoolManager.scheduleAtFixedRate(new FeedTask(), 10000, 10000);
_feedTask = ThreadPool.scheduleAtFixedRate(new FeedTask(), 10000, 10000);
}
}

View File

@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.model.actor.instance;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
@@ -72,7 +72,7 @@ public class L2RaidBossInstance extends L2MonsterInstance
@Override
protected void startMaintenanceTask()
{
_maintenanceTask = ThreadPoolManager.scheduleAtFixedRate(() -> checkAndReturnToSpawn(), 60000, getMaintenanceInterval() + Rnd.get(5000));
_maintenanceTask = ThreadPool.scheduleAtFixedRate(() -> checkAndReturnToSpawn(), 60000, getMaintenanceInterval() + Rnd.get(5000));
}
protected void checkAndReturnToSpawn()

View File

@@ -29,8 +29,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.sql.impl.CharSummonTable;
import com.l2jmobius.gameserver.data.sql.impl.SummonEffectsTable;
@@ -85,7 +85,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
super.onSpawn();
if ((_lifeTime > 0) && (_summonLifeTask == null))
{
_summonLifeTask = ThreadPoolManager.scheduleAtFixedRate(this, 0, 5000);
_summonLifeTask = ThreadPool.scheduleAtFixedRate(this, 0, 5000);
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.model.actor.instance;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.FortSiegeManager;
@@ -163,7 +163,7 @@ public class L2SiegeFlagInstance extends L2Npc
// send warning to owners of headquarters that theirs base is under attack
_clan.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.SIEGE_CAMP_IS_UNDER_ATTACK));
setCanTalk(false);
ThreadPoolManager.schedule(new ScheduleTalkTask(), 20000);
ThreadPool.schedule(new ScheduleTalkTask(), 20000);
}
}
}

View File

@@ -22,8 +22,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Future;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
@@ -153,7 +153,7 @@ public final class L2TamedBeastInstance extends L2FeedableBeastInstance
{
_durationCheckTask.cancel(true);
}
_durationCheckTask = ThreadPoolManager.scheduleAtFixedRate(new CheckDuration(this), DURATION_CHECK_INTERVAL, DURATION_CHECK_INTERVAL);
_durationCheckTask = ThreadPool.scheduleAtFixedRate(new CheckDuration(this), DURATION_CHECK_INTERVAL, DURATION_CHECK_INTERVAL);
}
}
@@ -217,10 +217,10 @@ public final class L2TamedBeastInstance extends L2FeedableBeastInstance
int delay = 100;
for (Skill skill : _beastSkills)
{
ThreadPoolManager.schedule(new buffCast(skill), delay);
ThreadPool.schedule(new buffCast(skill), delay);
delay += (100 + skill.getHitTime());
}
ThreadPoolManager.schedule(new buffCast(null), delay);
ThreadPool.schedule(new buffCast(null), delay);
}
private class buffCast implements Runnable
@@ -284,7 +284,7 @@ public final class L2TamedBeastInstance extends L2FeedableBeastInstance
{
_buffTask.cancel(true);
}
_buffTask = ThreadPoolManager.scheduleAtFixedRate(new CheckOwnerBuffs(this, totalBuffsAvailable), BUFF_INTERVAL, BUFF_INTERVAL);
_buffTask = ThreadPool.scheduleAtFixedRate(new CheckOwnerBuffs(this, totalBuffsAvailable), BUFF_INTERVAL, BUFF_INTERVAL);
}
}
else

View File

@@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.enums.TrapAction;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -77,7 +77,7 @@ public final class L2TrapInstance extends L2Npc
_remainingTime = _lifeTime;
if (_skill != null)
{
_trapTask = ThreadPoolManager.scheduleAtFixedRate(new TrapTask(this), TICK, TICK);
_trapTask = ThreadPool.scheduleAtFixedRate(new TrapTask(this), TICK, TICK);
}
}
@@ -339,7 +339,7 @@ public final class L2TrapInstance extends L2Npc
EventDispatcher.getInstance().notifyEventAsync(new OnTrapAction(this, target, TrapAction.TRAP_TRIGGERED), this);
ThreadPoolManager.schedule(new TrapTriggerTask(this), 500);
ThreadPool.schedule(new TrapTriggerTask(this), 500);
}
public void unSummon()

View File

@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.actor.request;
import java.util.Objects;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
/**
@@ -55,7 +55,7 @@ public abstract class AbstractRequest
public void scheduleTimeout(long delay)
{
_timeOutTask = ThreadPoolManager.schedule(this::onTimeout, delay);
_timeOutTask = ThreadPool.schedule(this::onTimeout, delay);
}
public boolean isTimeout()

View File

@@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.stat.CharStat;
@@ -210,7 +210,7 @@ public class CharStatus
final int period = Formulas.getRegeneratePeriod(getActiveChar());
// Create the HP/MP/CP Regeneration task
_regTask = ThreadPoolManager.scheduleAtFixedRate(new RegenTask(), period, period);
_regTask = ThreadPool.scheduleAtFixedRate(new RegenTask(), period, period);
}
}

View File

@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.actor.tasks.attackable;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
/**
@@ -48,7 +48,7 @@ public final class CommandChannelTimer implements Runnable
}
else
{
ThreadPoolManager.schedule(this, 10000); // 10sec
ThreadPool.schedule(this, 10000); // 10sec
}
}

View File

@@ -22,8 +22,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.actor.L2Npc;
/**
@@ -91,7 +91,7 @@ public class RandomAnimationTask implements Runnable
final int interval = Rnd.get(minWait, maxWait) * 1000;
// Create a RandomAnimation Task that will be launched after the calculated delay
ThreadPoolManager.schedule(this, interval);
ThreadPool.schedule(this, interval);
}
/**

View File

@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.model.actor.tasks.npc.trap;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2TrapInstance;
/**
@@ -38,7 +38,7 @@ public class TrapTriggerTask implements Runnable
try
{
_trap.doCast(_trap.getSkill());
ThreadPoolManager.schedule(new TrapUnsummonTask(_trap), _trap.getSkill().getHitTime() + 300);
ThreadPool.schedule(new TrapUnsummonTask(_trap), _trap.getSkill().getHitTime() + 300);
}
catch (Exception e)
{

View File

@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.actor.tasks.player;
import java.util.Objects;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.request.SayuneRequest;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
@@ -51,7 +51,7 @@ public class FlyMoveStartTask implements Runnable
if (!_player.hasRequest(SayuneRequest.class))
{
_player.sendPacket(ExNotifyFlyMoveStart.STATIC_PACKET);
ThreadPoolManager.schedule(this, 1000L);
ThreadPool.schedule(this, 1000L);
}
}
}

View File

@@ -25,8 +25,8 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.util.Broadcast;
/**
@@ -160,7 +160,7 @@ public final class AutoAnnouncement extends Announcement implements Runnable
_task.cancel(false);
}
_currentState = _repeat;
_task = ThreadPoolManager.schedule(this, _initial);
_task = ThreadPool.schedule(this, _initial);
}
@Override
@@ -178,7 +178,7 @@ public final class AutoAnnouncement extends Announcement implements Runnable
_currentState--;
}
_task = ThreadPoolManager.schedule(this, _delay);
_task = ThreadPool.schedule(this, _delay);
}
}
}

View File

@@ -26,8 +26,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.type.EtcItemType;
@@ -124,7 +124,7 @@ public final class Product
}
if ((_restockTask == null) || _restockTask.isDone())
{
_restockTask = ThreadPoolManager.schedule(this::restock, getRestockDelay());
_restockTask = ThreadPool.schedule(this::restock, getRestockDelay());
}
final boolean result = _count.addAndGet(-val) >= 0;
save();
@@ -141,7 +141,7 @@ public final class Product
final long remainTime = nextRestockTime - System.currentTimeMillis();
if (remainTime > 0)
{
_restockTask = ThreadPoolManager.schedule(this::restock, remainTime);
_restockTask = ThreadPool.schedule(this::restock, remainTime);
}
else
{

View File

@@ -21,8 +21,8 @@ import java.util.concurrent.ScheduledFuture;
import java.util.stream.Stream;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
@@ -54,8 +54,8 @@ public class CubicInstance
private void activate()
{
_skillUseTask = ThreadPoolManager.scheduleAtFixedRate(this::readyToUseSkill, 0, _template.getDelay() * 1000);
_expireTask = ThreadPoolManager.schedule(this::deactivate, _template.getDuration() * 1000);
_skillUseTask = ThreadPool.scheduleAtFixedRate(this::readyToUseSkill, 0, _template.getDelay() * 1000);
_expireTask = ThreadPool.schedule(this::deactivate, _template.getDuration() * 1000);
}
public void deactivate()

View File

@@ -24,8 +24,8 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
@@ -304,7 +304,7 @@ public final class BlockCheckerEngine
_abnormalEnd = true;
ThreadPoolManager.execute(new EndEvent());
ThreadPool.execute(new EndEvent());
}
}
catch (Exception e)
@@ -422,7 +422,7 @@ public final class BlockCheckerEngine
}
_isStarted = true;
// Spawn the blocks
ThreadPoolManager.execute(new SpawnRound(16, 1));
ThreadPool.execute(new SpawnRound(16, 1));
// Start up player parameters
setUpPlayers();
// Set the started time
@@ -457,19 +457,19 @@ public final class BlockCheckerEngine
case 1:
{
// Schedule second spawn round
_task = ThreadPoolManager.schedule(new SpawnRound(20, 2), 60000);
_task = ThreadPool.schedule(new SpawnRound(20, 2), 60000);
break;
}
case 2:
{
// Schedule third spawn round
_task = ThreadPoolManager.schedule(new SpawnRound(14, 3), 60000);
_task = ThreadPool.schedule(new SpawnRound(14, 3), 60000);
break;
}
case 3:
{
// Schedule Event End Count Down
_task = ThreadPoolManager.schedule(new EndEvent(), 180000);
_task = ThreadPool.schedule(new EndEvent(), 180000);
break;
}
}
@@ -529,7 +529,7 @@ public final class BlockCheckerEngine
SpawnTable.getInstance().addNewSpawn(girlSpawn, false);
girlSpawn.init();
// Schedule his deletion after 9 secs of spawn
ThreadPoolManager.schedule(new CarryingGirlUnspawn(girlSpawn), 9000);
ThreadPool.schedule(new CarryingGirlUnspawn(girlSpawn), 9000);
}
catch (Exception e)
{

View File

@@ -29,8 +29,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.xml.impl.CastleData;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
@@ -165,11 +165,11 @@ public final class Castle extends AbstractResidence
final long currentTime = System.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPoolManager.schedule(new FunctionTask(cwh), _endDate - currentTime);
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
}
else
{
ThreadPoolManager.schedule(new FunctionTask(cwh), 0);
ThreadPool.schedule(new FunctionTask(cwh), 0);
}
}
@@ -203,7 +203,7 @@ public final class Castle extends AbstractResidence
{
ClanTable.getInstance().getClan(getOwnerId()).getWarehouse().destroyItemByItemId("CS_function_fee", Inventory.ADENA_ID, fee, null, null);
}
ThreadPoolManager.schedule(new FunctionTask(true), getRate());
ThreadPool.schedule(new FunctionTask(true), getRate());
}
else
{

View File

@@ -29,8 +29,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
import com.l2jmobius.gameserver.enums.ClanHallGrade;
@@ -263,7 +263,7 @@ public final class ClanHall extends AbstractResidence
final int failDays = getCostFailDay();
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(getPaidUntil()).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : getPaidUntil();
_checkPaymentTask = ThreadPoolManager.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
}
else
{
@@ -363,7 +363,7 @@ public final class ClanHall extends AbstractResidence
}
else
{
_checkPaymentTask = ThreadPoolManager.schedule(new CheckPaymentTask(), 24 * 60 * 60 * 1000); // 1 day
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), 24 * 60 * 60 * 1000); // 1 day
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);
sm.addInt(getLease());
clan.broadcastToOnlineMembers(sm);
@@ -373,7 +373,7 @@ public final class ClanHall extends AbstractResidence
{
clan.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, getLease(), null, null);
setPaidUntil(Instant.ofEpochMilli(getPaidUntil()).plus(Duration.ofDays(7)).toEpochMilli());
_checkPaymentTask = ThreadPoolManager.schedule(new CheckPaymentTask(), getPaidUntil() - System.currentTimeMillis());
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), getPaidUntil() - System.currentTimeMillis());
updateDB();
}
}

View File

@@ -24,8 +24,8 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.DuelResult;
import com.l2jmobius.gameserver.enums.Team;
@@ -97,7 +97,7 @@ public class Duel
broadcastToTeam2(sm);
}
// Schedule duel start
ThreadPoolManager.schedule(new ScheduleStartDuelTask(this), 3000);
ThreadPool.schedule(new ScheduleStartDuelTask(this), 3000);
}
public static class PlayerCondition
@@ -205,14 +205,14 @@ public class Duel
}
case CONTINUE:
{
ThreadPoolManager.schedule(this, 1000);
ThreadPool.schedule(this, 1000);
break;
}
default:
{
setFinished(true);
playKneelAnimation();
ThreadPoolManager.schedule(new ScheduleEndDuelTask(_duel, _duel.checkEndDuelCondition()), 5000);
ThreadPool.schedule(new ScheduleEndDuelTask(_duel, _duel.checkEndDuelCondition()), 5000);
if (getDueldInstance() != null)
{
getDueldInstance().destroy();
@@ -253,11 +253,11 @@ public class Duel
_duel.teleportPlayers();
// give players 20 seconds to complete teleport and get ready (its ought to be 30 on offical..)
ThreadPoolManager.schedule(this, 20000);
ThreadPool.schedule(this, 20000);
}
else if (count > 0) // duel not started yet - continue countdown
{
ThreadPoolManager.schedule(this, 1000);
ThreadPool.schedule(this, 1000);
}
else
{
@@ -462,7 +462,7 @@ public class Duel
broadcastToTeam2(B04_S01);
// start duelling task
ThreadPoolManager.schedule(new ScheduleDuelTask(this), 1000);
ThreadPool.schedule(new ScheduleDuelTask(this), 1000);
}
/**

View File

@@ -33,10 +33,10 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.FortUpdater;
import com.l2jmobius.gameserver.FortUpdater.UpdaterType;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.data.xml.impl.StaticObjectData;
@@ -166,11 +166,11 @@ public final class Fort extends AbstractResidence
final long currentTime = System.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPoolManager.schedule(new FunctionTask(cwh), _endDate - currentTime);
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
}
else
{
ThreadPoolManager.schedule(new FunctionTask(cwh), 0);
ThreadPool.schedule(new FunctionTask(cwh), 0);
}
}
@@ -204,7 +204,7 @@ public final class Fort extends AbstractResidence
{
getOwnerClan().getWarehouse().destroyItemByItemId("CS_function_fee", Inventory.ADENA_ID, fee, null, null);
}
ThreadPoolManager.schedule(new FunctionTask(true), getRate());
ThreadPool.schedule(new FunctionTask(true), getRate());
}
else
{
@@ -273,7 +273,7 @@ public final class Fort extends AbstractResidence
public void endOfSiege(L2Clan clan)
{
ThreadPoolManager.execute(new endFortressSiege(this, clan));
ThreadPool.execute(new endFortressSiege(this, clan));
}
/**
@@ -594,15 +594,15 @@ public final class Fort extends AbstractResidence
initial = (Config.FS_UPDATE_FRQ * 60000L) - initial;
if ((Config.FS_MAX_OWN_TIME <= 0) || (getOwnedTime() < (Config.FS_MAX_OWN_TIME * 3600)))
{
_FortUpdater[0] = ThreadPoolManager.scheduleAtFixedRate(new FortUpdater(this, clan, runCount, UpdaterType.PERIODIC_UPDATE), initial, Config.FS_UPDATE_FRQ * 60000L); // Schedule owner tasks to start running
_FortUpdater[0] = ThreadPool.scheduleAtFixedRate(new FortUpdater(this, clan, runCount, UpdaterType.PERIODIC_UPDATE), initial, Config.FS_UPDATE_FRQ * 60000L); // Schedule owner tasks to start running
if (Config.FS_MAX_OWN_TIME > 0)
{
_FortUpdater[1] = ThreadPoolManager.scheduleAtFixedRate(new FortUpdater(this, clan, runCount, UpdaterType.MAX_OWN_TIME), 3600000, 3600000); // Schedule owner tasks to remove owener
_FortUpdater[1] = ThreadPool.scheduleAtFixedRate(new FortUpdater(this, clan, runCount, UpdaterType.MAX_OWN_TIME), 3600000, 3600000); // Schedule owner tasks to remove owener
}
}
else
{
_FortUpdater[1] = ThreadPoolManager.schedule(new FortUpdater(this, clan, 0, UpdaterType.MAX_OWN_TIME), 60000); // Schedule owner tasks to remove owner
_FortUpdater[1] = ThreadPool.schedule(new FortUpdater(this, clan, 0, UpdaterType.MAX_OWN_TIME), 60000); // Schedule owner tasks to remove owner
}
}
else
@@ -836,10 +836,10 @@ public final class Fort extends AbstractResidence
{
_FortUpdater[1].cancel(false);
}
_FortUpdater[0] = ThreadPoolManager.scheduleAtFixedRate(new FortUpdater(this, clan, 0, UpdaterType.PERIODIC_UPDATE), Config.FS_UPDATE_FRQ * 60000L, Config.FS_UPDATE_FRQ * 60000L); // Schedule owner tasks to start running
_FortUpdater[0] = ThreadPool.scheduleAtFixedRate(new FortUpdater(this, clan, 0, UpdaterType.PERIODIC_UPDATE), Config.FS_UPDATE_FRQ * 60000L, Config.FS_UPDATE_FRQ * 60000L); // Schedule owner tasks to start running
if (Config.FS_MAX_OWN_TIME > 0)
{
_FortUpdater[1] = ThreadPoolManager.scheduleAtFixedRate(new FortUpdater(this, clan, 0, UpdaterType.MAX_OWN_TIME), 3600000, 3600000); // Schedule owner tasks to remove owener
_FortUpdater[1] = ThreadPool.scheduleAtFixedRate(new FortUpdater(this, clan, 0, UpdaterType.MAX_OWN_TIME), 3600000, 3600000); // Schedule owner tasks to remove owener
}
}
else

View File

@@ -30,8 +30,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.FortTeleportWhoType;
@@ -111,7 +111,7 @@ public class FortSiege implements Siegable
final SystemMessage sm;
if (_time == 3600) // 1hr remains
{
ThreadPoolManager.schedule(new ScheduleStartSiegeTask(600), 3000000); // Prepare task for 10 minutes left.
ThreadPool.schedule(new ScheduleStartSiegeTask(600), 3000000); // Prepare task for 10 minutes left.
}
else if (_time == 600) // 10min remains
{
@@ -119,49 +119,49 @@ public class FortSiege implements Siegable
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_THE_FORTRESS_BATTLE_STARTS);
sm.addInt(10);
announceToPlayer(sm);
ThreadPoolManager.schedule(new ScheduleStartSiegeTask(300), 300000); // Prepare task for 5 minutes left.
ThreadPool.schedule(new ScheduleStartSiegeTask(300), 300000); // Prepare task for 5 minutes left.
}
else if (_time == 300) // 5min remains
{
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_THE_FORTRESS_BATTLE_STARTS);
sm.addInt(5);
announceToPlayer(sm);
ThreadPoolManager.schedule(new ScheduleStartSiegeTask(60), 240000); // Prepare task for 1 minute left.
ThreadPool.schedule(new ScheduleStartSiegeTask(60), 240000); // Prepare task for 1 minute left.
}
else if (_time == 60) // 1min remains
{
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_THE_FORTRESS_BATTLE_STARTS);
sm.addInt(1);
announceToPlayer(sm);
ThreadPoolManager.schedule(new ScheduleStartSiegeTask(30), 30000); // Prepare task for 30 seconds left.
ThreadPool.schedule(new ScheduleStartSiegeTask(30), 30000); // Prepare task for 30 seconds left.
}
else if (_time == 30) // 30seconds remains
{
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SECOND_S_UNTIL_THE_FORTRESS_BATTLE_STARTS);
sm.addInt(30);
announceToPlayer(sm);
ThreadPoolManager.schedule(new ScheduleStartSiegeTask(10), 20000); // Prepare task for 10 seconds left.
ThreadPool.schedule(new ScheduleStartSiegeTask(10), 20000); // Prepare task for 10 seconds left.
}
else if (_time == 10) // 10seconds remains
{
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SECOND_S_UNTIL_THE_FORTRESS_BATTLE_STARTS);
sm.addInt(10);
announceToPlayer(sm);
ThreadPoolManager.schedule(new ScheduleStartSiegeTask(5), 5000); // Prepare task for 5 seconds left.
ThreadPool.schedule(new ScheduleStartSiegeTask(5), 5000); // Prepare task for 5 seconds left.
}
else if (_time == 5) // 5seconds remains
{
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SECOND_S_UNTIL_THE_FORTRESS_BATTLE_STARTS);
sm.addInt(5);
announceToPlayer(sm);
ThreadPoolManager.schedule(new ScheduleStartSiegeTask(1), 4000); // Prepare task for 1 seconds left.
ThreadPool.schedule(new ScheduleStartSiegeTask(1), 4000); // Prepare task for 1 seconds left.
}
else if (_time == 1) // 1seconds remains
{
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SECOND_S_UNTIL_THE_FORTRESS_BATTLE_STARTS);
sm.addInt(1);
announceToPlayer(sm);
ThreadPoolManager.schedule(new ScheduleStartSiegeTask(0), 1000); // Prepare task start siege.
ThreadPool.schedule(new ScheduleStartSiegeTask(0), 1000); // Prepare task start siege.
}
else if (_time == 0)// start siege
{
@@ -274,7 +274,7 @@ public class FortSiege implements Siegable
unspawnSiegeGuard(); // Remove all spawned siege guard from this fort
getFort().resetDoors(); // Respawn door to fort
ThreadPoolManager.schedule(new ScheduleSuspiciousMerchantSpawn(), FortSiegeManager.getInstance().getSuspiciousMerchantRespawnDelay() * 60 * 1000L); // Prepare 3hr task for suspicious merchant respawn
ThreadPool.schedule(new ScheduleSuspiciousMerchantSpawn(), FortSiegeManager.getInstance().getSuspiciousMerchantRespawnDelay() * 60 * 1000L); // Prepare 3hr task for suspicious merchant respawn
setSiegeDateTime(true); // store suspicious merchant spawn in DB
if (_siegeEnd != null)
@@ -336,7 +336,7 @@ public class FortSiege implements Siegable
getFort().getZone().updateZoneStatusForCharactersInside();
// Schedule a task to prepare auto siege end
_siegeEnd = ThreadPoolManager.schedule(new ScheduleEndSiegeTask(), FortSiegeManager.getInstance().getSiegeLength() * 60 * 1000L); // Prepare auto end task
_siegeEnd = ThreadPool.schedule(new ScheduleEndSiegeTask(), FortSiegeManager.getInstance().getSiegeLength() * 60 * 1000L); // Prepare auto end task
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_FORTRESS_BATTLE_S1_HAS_BEGUN);
sm.addCastleId(getFort().getResidenceId());
@@ -680,7 +680,7 @@ public class FortSiege implements Siegable
else if (_siegeRestore == null)
{
getFort().getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.THE_BARRACKS_HAVE_BEEN_SEIZED));
_siegeRestore = ThreadPoolManager.schedule(new ScheduleSiegeRestore(), FortSiegeManager.getInstance().getCountDownLength() * 60 * 1000L);
_siegeRestore = ThreadPool.schedule(new ScheduleSiegeRestore(), FortSiegeManager.getInstance().getCountDownLength() * 60 * 1000L);
}
else
{
@@ -838,7 +838,7 @@ public class FortSiege implements Siegable
saveFortSiege();
clearSiegeClan(); // remove all clans
// spawn suspicious merchant immediately
ThreadPoolManager.execute(new ScheduleSuspiciousMerchantSpawn());
ThreadPool.execute(new ScheduleSuspiciousMerchantSpawn());
}
else
{
@@ -846,33 +846,33 @@ public class FortSiege implements Siegable
if (getAttackerClans().isEmpty())
{
// no attackers - waiting for suspicious merchant spawn
ThreadPoolManager.schedule(new ScheduleSuspiciousMerchantSpawn(), delay);
ThreadPool.schedule(new ScheduleSuspiciousMerchantSpawn(), delay);
}
else
{
// preparing start siege task
if (delay > 3600000) // more than hour, how this can happens ? spawn suspicious merchant
{
ThreadPoolManager.execute(new ScheduleSuspiciousMerchantSpawn());
_siegeStartTask = ThreadPoolManager.schedule(new FortSiege.ScheduleStartSiegeTask(3600), delay - 3600000);
ThreadPool.execute(new ScheduleSuspiciousMerchantSpawn());
_siegeStartTask = ThreadPool.schedule(new FortSiege.ScheduleStartSiegeTask(3600), delay - 3600000);
}
if (delay > 600000) // more than 10 min, spawn suspicious merchant
{
ThreadPoolManager.execute(new ScheduleSuspiciousMerchantSpawn());
_siegeStartTask = ThreadPoolManager.schedule(new FortSiege.ScheduleStartSiegeTask(600), delay - 600000);
ThreadPool.execute(new ScheduleSuspiciousMerchantSpawn());
_siegeStartTask = ThreadPool.schedule(new FortSiege.ScheduleStartSiegeTask(600), delay - 600000);
}
else if (delay > 300000)
{
_siegeStartTask = ThreadPoolManager.schedule(new FortSiege.ScheduleStartSiegeTask(300), delay - 300000);
_siegeStartTask = ThreadPool.schedule(new FortSiege.ScheduleStartSiegeTask(300), delay - 300000);
}
else if (delay > 60000)
{
_siegeStartTask = ThreadPoolManager.schedule(new FortSiege.ScheduleStartSiegeTask(60), delay - 60000);
_siegeStartTask = ThreadPool.schedule(new FortSiege.ScheduleStartSiegeTask(60), delay - 60000);
}
else
{
// lower than 1 min, set to 1 min
_siegeStartTask = ThreadPoolManager.schedule(new FortSiege.ScheduleStartSiegeTask(60), 0);
_siegeStartTask = ThreadPool.schedule(new FortSiege.ScheduleStartSiegeTask(60), 0);
}
_log.info(getClass().getSimpleName() + ": Siege of " + getFort().getName() + " fort: " + getFort().getSiegeDate().getTime());
@@ -902,7 +902,7 @@ public class FortSiege implements Siegable
}
// Execute siege auto start
_siegeStartTask = ThreadPoolManager.schedule(new FortSiege.ScheduleStartSiegeTask(3600), 0);
_siegeStartTask = ThreadPool.schedule(new FortSiege.ScheduleStartSiegeTask(3600), 0);
}
/**

View File

@@ -33,8 +33,8 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.xml.impl.SiegeScheduleData;
import com.l2jmobius.gameserver.enums.SiegeClanType;
@@ -105,35 +105,35 @@ public class Siege implements Siegable
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HOUR_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
sm.addInt(2);
announceToPlayer(sm, true);
ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 3600000); // Prepare task for 1 hr left.
ThreadPool.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 3600000); // Prepare task for 1 hr left.
}
else if ((timeRemaining <= 3600000) && (timeRemaining > 600000))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
sm.addInt((int) timeRemaining / 60000);
announceToPlayer(sm, true);
ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 600000); // Prepare task for 10 minute left.
ThreadPool.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 600000); // Prepare task for 10 minute left.
}
else if ((timeRemaining <= 600000) && (timeRemaining > 300000))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
sm.addInt((int) timeRemaining / 60000);
announceToPlayer(sm, true);
ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 300000); // Prepare task for 5 minute left.
ThreadPool.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 300000); // Prepare task for 5 minute left.
}
else if ((timeRemaining <= 300000) && (timeRemaining > 10000))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_CASTLE_SIEGE_CONCLUSION);
sm.addInt((int) timeRemaining / 60000);
announceToPlayer(sm, true);
ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 10000); // Prepare task for 10 seconds count down
ThreadPool.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 10000); // Prepare task for 10 seconds count down
}
else if ((timeRemaining <= 10000) && (timeRemaining > 0))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THIS_CASTLE_SIEGE_WILL_END_IN_S1_SECOND_S);
sm.addInt((int) timeRemaining / 1000);
announceToPlayer(sm, true);
ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining); // Prepare task for second count down
ThreadPool.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining); // Prepare task for second count down
}
else
{
@@ -172,7 +172,7 @@ public class Siege implements Siegable
final long regTimeRemaining = getTimeRegistrationOverDate().getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
if (regTimeRemaining > 0)
{
_scheduledStartSiegeTask = ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), regTimeRemaining);
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), regTimeRemaining);
return;
}
endTimeRegistration(true);
@@ -181,7 +181,7 @@ public class Siege implements Siegable
final long timeRemaining = getSiegeDate().getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
if (timeRemaining > 86400000)
{
_scheduledStartSiegeTask = ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 86400000); // Prepare task for 24 before siege start to end registration
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 86400000); // Prepare task for 24 before siege start to end registration
}
else if ((timeRemaining <= 86400000) && (timeRemaining > 13600000))
{
@@ -190,23 +190,23 @@ public class Siege implements Siegable
Broadcast.toAllOnlinePlayers(sm);
_isRegistrationOver = true;
clearSiegeWaitingClan();
_scheduledStartSiegeTask = ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 13600000); // Prepare task for 1 hr left before siege start.
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 13600000); // Prepare task for 1 hr left before siege start.
}
else if ((timeRemaining <= 13600000) && (timeRemaining > 600000))
{
_scheduledStartSiegeTask = ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 600000); // Prepare task for 10 minute left.
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 600000); // Prepare task for 10 minute left.
}
else if ((timeRemaining <= 600000) && (timeRemaining > 300000))
{
_scheduledStartSiegeTask = ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 300000); // Prepare task for 5 minute left.
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 300000); // Prepare task for 5 minute left.
}
else if ((timeRemaining <= 300000) && (timeRemaining > 10000))
{
_scheduledStartSiegeTask = ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 10000); // Prepare task for 10 seconds count down
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 10000); // Prepare task for 10 seconds count down
}
else if ((timeRemaining <= 10000) && (timeRemaining > 0))
{
_scheduledStartSiegeTask = ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining); // Prepare task for second count down
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining); // Prepare task for second count down
}
else
{
@@ -525,7 +525,7 @@ public class Siege implements Siegable
// Schedule a task to prepare auto siege end
_siegeEndDate = Calendar.getInstance();
_siegeEndDate.add(Calendar.MINUTE, SiegeManager.getInstance().getSiegeLength());
ThreadPoolManager.schedule(new ScheduleEndSiegeTask(getCastle()), 1000); // Prepare auto end task
ThreadPool.schedule(new ScheduleEndSiegeTask(getCastle()), 1000); // Prepare auto end task
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_S1_SIEGE_HAS_STARTED);
sm.addCastleId(getCastle().getResidenceId());
@@ -1028,7 +1028,7 @@ public class Siege implements Siegable
{
_scheduledStartSiegeTask.cancel(false);
}
_scheduledStartSiegeTask = ThreadPoolManager.schedule(new Siege.ScheduleStartSiegeTask(getCastle()), 1000);
_scheduledStartSiegeTask = ThreadPool.schedule(new Siege.ScheduleStartSiegeTask(getCastle()), 1000);
}
/**
@@ -1346,7 +1346,7 @@ public class Siege implements Siegable
if (_scheduledStartSiegeTask != null)
{
_scheduledStartSiegeTask.cancel(true);
_scheduledStartSiegeTask = ThreadPoolManager.schedule(new Siege.ScheduleStartSiegeTask(getCastle()), 1000);
_scheduledStartSiegeTask = ThreadPool.schedule(new Siege.ScheduleStartSiegeTask(getCastle()), 1000);
}
try (Connection con = DatabaseFactory.getInstance().getConnection();

View File

@@ -26,8 +26,8 @@ import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.util.cron4j.PastPredictor;
import com.l2jmobius.gameserver.util.cron4j.Predictor;
@@ -115,7 +115,7 @@ public class EventScheduler
if (timeSchedule <= (30 * 1000))
{
LOGGER.warning("Wrong reschedule for " + _eventManager.getClass().getSimpleName() + " end up run in " + (timeSchedule / 1000) + " seconds!");
ThreadPoolManager.schedule(this::startScheduler, timeSchedule + 1000);
ThreadPool.schedule(this::startScheduler, timeSchedule + 1000);
return;
}
@@ -124,14 +124,14 @@ public class EventScheduler
_task.cancel(false);
}
_task = ThreadPoolManager.schedule(() ->
_task = ThreadPool.schedule(() ->
{
run();
updateLastRun();
if (isRepeating())
{
ThreadPoolManager.schedule(this::startScheduler, 1000);
ThreadPool.schedule(this::startScheduler, 1000);
}
}, timeSchedule);
}

View File

@@ -20,7 +20,7 @@ import java.util.Queue;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.events.impl.IBaseEvent;
import com.l2jmobius.gameserver.model.events.listeners.AbstractEventListener;
import com.l2jmobius.gameserver.model.events.returns.AbstractEventReturn;
@@ -115,7 +115,7 @@ public final class EventDispatcher
if (hasListeners)
{
ThreadPoolManager.execute(() -> notifyEventToMultipleContainers(event, containers, null));
ThreadPool.execute(() -> notifyEventToMultipleContainers(event, containers, null));
}
}
@@ -129,7 +129,7 @@ public final class EventDispatcher
{
if (Containers.Global().hasListener(event.getType()) || container.hasListener(event.getType()))
{
ThreadPoolManager.schedule(() -> notifyEvent(event, container, null), delay);
ThreadPool.schedule(() -> notifyEvent(event, container, null), delay);
}
}

View File

@@ -20,7 +20,7 @@ import java.util.Objects;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.TimersManager;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -58,7 +58,7 @@ public class TimerHolder<T> implements Runnable
_eventScript = eventScript;
_cancelScript = cancelScript;
_postExecutor = postExecutor;
_task = isRepeating ? ThreadPoolManager.scheduleAtFixedRate(this, _time, _time) : ThreadPoolManager.schedule(this, _time);
_task = isRepeating ? ThreadPool.scheduleAtFixedRate(this, _time, _time) : ThreadPool.schedule(this, _time);
TimersManager.getInstance().registerTimer(this);
}

View File

@@ -37,9 +37,9 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.enums.InstanceReenterType;
import com.l2jmobius.gameserver.enums.InstanceTeleportType;
@@ -284,7 +284,7 @@ public final class Instance implements IIdentifiable, INamable
}
else if ((emptyTime >= 0) && (_emptyDestroyTask == null) && (getRemainingTime() < emptyTime))
{
_emptyDestroyTask = ThreadPoolManager.schedule(this::destroy, emptyTime);
_emptyDestroyTask = ThreadPool.schedule(this::destroy, emptyTime);
}
}
}
@@ -678,11 +678,11 @@ public final class Instance implements IIdentifiable, INamable
sendWorldDestroyMessage(minutes);
if (minutes <= 5) // Message 1 minute before destroy
{
_cleanUpTask = ThreadPoolManager.schedule(this::cleanUp, millis - 60000);
_cleanUpTask = ThreadPool.schedule(this::cleanUp, millis - 60000);
}
else // Message 5 minutes before destroy
{
_cleanUpTask = ThreadPoolManager.schedule(this::cleanUp, millis - (5 * 60000));
_cleanUpTask = ThreadPool.schedule(this::cleanUp, millis - (5 * 60000));
}
}
}
@@ -896,7 +896,7 @@ public final class Instance implements IIdentifiable, INamable
player.sendPacket(sm);
// Start eject task
_ejectDeadTasks.put(player.getObjectId(), ThreadPoolManager.schedule(() ->
_ejectDeadTasks.put(player.getObjectId(), ThreadPool.schedule(() ->
{
if (player.isDead())
{
@@ -1125,12 +1125,12 @@ public final class Instance implements IIdentifiable, INamable
if (getRemainingTime() <= TimeUnit.MINUTES.toMillis(1))
{
sendWorldDestroyMessage(1);
_cleanUpTask = ThreadPoolManager.schedule(this::destroy, 60 * 1000); // 1 minute
_cleanUpTask = ThreadPool.schedule(this::destroy, 60 * 1000); // 1 minute
}
else
{
sendWorldDestroyMessage(5);
_cleanUpTask = ThreadPoolManager.schedule(this::cleanUp, 5 * 60 * 1000); // 5 minutes
_cleanUpTask = ThreadPool.schedule(this::cleanUp, 5 * 60 * 1000); // 5 minutes
}
}

View File

@@ -25,8 +25,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.instancemanager.ItemAuctionManager;
import com.l2jmobius.gameserver.model.ItemInfo;
import com.l2jmobius.gameserver.model.L2World;
@@ -402,7 +402,7 @@ public final class ItemAuction
public final void broadcastToAllBidders(IClientOutgoingPacket packet)
{
ThreadPoolManager.execute(() -> broadcastToAllBiddersInternal(packet));
ThreadPool.execute(() -> broadcastToAllBiddersInternal(packet));
}
public final void broadcastToAllBiddersInternal(IClientOutgoingPacket packet)

View File

@@ -38,9 +38,9 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
import com.l2jmobius.gameserver.enums.ItemLocation;
import com.l2jmobius.gameserver.instancemanager.ItemAuctionManager;
@@ -325,17 +325,17 @@ public final class ItemAuctionInstance
{
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
{
setStateTask(ThreadPoolManager.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0L)));
setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0L)));
}
else
{
setStateTask(ThreadPoolManager.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0L)));
setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0L)));
}
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
}
else
{
setStateTask(ThreadPoolManager.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0L)));
setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0L)));
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
}
}
@@ -421,7 +421,7 @@ public final class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
setStateTask(ThreadPoolManager.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0L)));
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0L)));
return;
}
break;
@@ -431,7 +431,7 @@ public final class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
setStateTask(ThreadPoolManager.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0L)));
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0L)));
return;
}
break;
@@ -441,7 +441,7 @@ public final class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
setStateTask(ThreadPoolManager.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0L)));
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0L)));
return;
}
break;
@@ -451,7 +451,7 @@ public final class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
setStateTask(ThreadPoolManager.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0L)));
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0L)));
return;
}
}

View File

@@ -36,8 +36,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.AppearanceItemData;
import com.l2jmobius.gameserver.data.xml.impl.EnchantItemOptionsData;
import com.l2jmobius.gameserver.data.xml.impl.EnsoulData;
@@ -1451,7 +1451,7 @@ public final class L2ItemInstance extends L2Object
return;
}
_consumingMana = true;
ThreadPoolManager.schedule(new ScheduleConsumeManaTask(this), MANA_CONSUMPTION_RATE);
ThreadPool.schedule(new ScheduleConsumeManaTask(this), MANA_CONSUMPTION_RATE);
}
/**
@@ -1584,7 +1584,7 @@ public final class L2ItemInstance extends L2Object
public final void dropMe(L2Character dropper, int x, int y, int z)
{
ThreadPoolManager.execute(new ItemDropTask(this, dropper, x, y, z));
ThreadPool.execute(new ItemDropTask(this, dropper, x, y, z));
if ((dropper != null) && dropper.isPlayer())
{
// Notify to scripts
@@ -1873,7 +1873,7 @@ public final class L2ItemInstance extends L2Object
{
_lifeTimeTask.cancel(true);
}
_lifeTimeTask = ThreadPoolManager.schedule(new ScheduleLifeTimeTask(this), getRemainingTime());
_lifeTimeTask = ThreadPool.schedule(new ScheduleLifeTimeTask(this), getRemainingTime());
}
}
@@ -2406,11 +2406,11 @@ public final class L2ItemInstance extends L2Object
final long time = getVisualLifeTime() - System.currentTimeMillis();
if (time > 0)
{
_appearanceLifeTimeTask = ThreadPoolManager.schedule(this::onVisualLifeTimeEnd, time);
_appearanceLifeTimeTask = ThreadPool.schedule(this::onVisualLifeTimeEnd, time);
}
else
{
ThreadPoolManager.execute(this::onVisualLifeTimeEnd);
ThreadPool.execute(this::onVisualLifeTimeEnd);
}
}
}

View File

@@ -38,8 +38,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.CategoryData;
import com.l2jmobius.gameserver.enums.CategoryType;
import com.l2jmobius.gameserver.instancemanager.AntiFeedManager;
@@ -203,7 +203,7 @@ public class Olympiad extends ListenersContainer
if (_validationEnd > Calendar.getInstance().getTimeInMillis())
{
loadNoblesRank();
_scheduledValdationTask = ThreadPoolManager.schedule(new ValidationEndTask(), getMillisToValidationEnd());
_scheduledValdationTask = ThreadPool.schedule(new ValidationEndTask(), getMillisToValidationEnd());
}
else
{
@@ -393,7 +393,7 @@ public class Olympiad extends ListenersContainer
_scheduledOlympiadEnd.cancel(true);
}
_scheduledOlympiadEnd = ThreadPoolManager.schedule(new OlympiadEndTask(), getMillisToOlympiadEnd());
_scheduledOlympiadEnd = ThreadPool.schedule(new OlympiadEndTask(), getMillisToOlympiadEnd());
updateCompStatus();
}
@@ -427,7 +427,7 @@ public class Olympiad extends ListenersContainer
_validationEnd = validationEnd.getTimeInMillis() + VALIDATION_PERIOD;
loadNoblesRank();
_scheduledValdationTask = ThreadPoolManager.schedule(new ValidationEndTask(), getMillisToValidationEnd());
_scheduledValdationTask = ThreadPool.schedule(new ValidationEndTask(), getMillisToValidationEnd());
}
}
@@ -475,7 +475,7 @@ public class Olympiad extends ListenersContainer
LOGGER.info(getClass().getSimpleName() + ": Event starts/started: " + _compStart.getTime());
}
_scheduledCompStart = ThreadPoolManager.schedule(() ->
_scheduledCompStart = ThreadPool.schedule(() ->
{
if (isOlympiadEnd())
{
@@ -488,19 +488,19 @@ public class Olympiad extends ListenersContainer
LOGGER.info(getClass().getSimpleName() + ": Olympiad Games have started.");
_logResults.info("Result,Player1,Player2,Player1 HP,Player2 HP,Player1 Damage,Player2 Damage,Points,Classed");
_gameManager = ThreadPoolManager.scheduleAtFixedRate(OlympiadGameManager.getInstance(), 30000, 30000);
_gameManager = ThreadPool.scheduleAtFixedRate(OlympiadGameManager.getInstance(), 30000, 30000);
if (Config.ALT_OLY_ANNOUNCE_GAMES)
{
_gameAnnouncer = ThreadPoolManager.scheduleAtFixedRate(new OlympiadAnnouncer(), 30000, 500);
_gameAnnouncer = ThreadPool.scheduleAtFixedRate(new OlympiadAnnouncer(), 30000, 500);
}
final long regEnd = getMillisToCompEnd() - 600000;
if (regEnd > 0)
{
ThreadPoolManager.schedule(() -> Broadcast.toAllOnlinePlayers(SystemMessage.getSystemMessage(SystemMessageId.THE_OLYMPIAD_REGISTRATION_PERIOD_HAS_ENDED)), regEnd);
ThreadPool.schedule(() -> Broadcast.toAllOnlinePlayers(SystemMessage.getSystemMessage(SystemMessageId.THE_OLYMPIAD_REGISTRATION_PERIOD_HAS_ENDED)), regEnd);
}
_scheduledCompEnd = ThreadPoolManager.schedule(() ->
_scheduledCompEnd = ThreadPool.schedule(() ->
{
if (isOlympiadEnd())
{
@@ -555,7 +555,7 @@ public class Olympiad extends ListenersContainer
_scheduledOlympiadEnd.cancel(true);
}
_scheduledOlympiadEnd = ThreadPoolManager.schedule(new OlympiadEndTask(), 0);
_scheduledOlympiadEnd = ThreadPool.schedule(new OlympiadEndTask(), 0);
}
protected long getMillisToValidationEnd()
@@ -734,7 +734,7 @@ public class Olympiad extends ListenersContainer
private void scheduleWeeklyChange()
{
_scheduledWeeklyTask = ThreadPoolManager.scheduleAtFixedRate(() ->
_scheduledWeeklyTask = ThreadPool.scheduleAtFixedRate(() ->
{
addWeeklyPoints();
LOGGER.info(getClass().getSimpleName() + ": Added weekly points to nobles");

View File

@@ -20,7 +20,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
@@ -170,7 +170,7 @@ public final class OlympiadGameTask implements Runnable
_game = game;
_state = GameState.BEGIN;
_needAnnounce = false;
ThreadPoolManager.execute(this);
ThreadPool.execute(this);
}
@Override
@@ -341,7 +341,7 @@ public final class OlympiadGameTask implements Runnable
return;
}
}
ThreadPoolManager.schedule(this, delay * 1000);
ThreadPool.schedule(this, delay * 1000);
}
catch (Exception e)
{
@@ -361,7 +361,7 @@ public final class OlympiadGameTask implements Runnable
_log.log(Level.WARNING, "Exception in " + _state + ", trying to port players back: " + e.getMessage(), e);
_state = GameState.GAME_STOPPED;
ThreadPoolManager.schedule(this, 1000);
ThreadPool.schedule(this, 1000);
}
}

View File

@@ -25,8 +25,8 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.handler.IPunishmentHandler;
import com.l2jmobius.gameserver.handler.PunishmentHandler;
import com.l2jmobius.gameserver.instancemanager.PunishmentManager;
@@ -147,7 +147,7 @@ public class PunishmentTask implements Runnable
onStart();
if (_expirationTime > 0) // Has expiration?
{
_task = ThreadPoolManager.schedule(this, (_expirationTime - System.currentTimeMillis()));
_task = ThreadPool.schedule(this, (_expirationTime - System.currentTimeMillis()));
}
}

View File

@@ -27,8 +27,8 @@ import java.util.logging.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.AnnouncementsTable;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.datatables.EventDroplist;
@@ -91,7 +91,7 @@ public class LongTimeEvent extends Quest
else if (_eventPeriod.getStartDate().after(new Date()))
{
final long delay = _eventPeriod.getStartDate().getTime() - System.currentTimeMillis();
ThreadPoolManager.schedule(new ScheduleStart(), delay);
ThreadPool.schedule(new ScheduleStart(), delay);
_log.info("Event " + _eventName + " will be started at " + _eventPeriod.getEndDate());
}
else
@@ -301,7 +301,7 @@ public class LongTimeEvent extends Quest
AnnouncementsTable.getInstance().addAnnouncement(new EventAnnouncement(_eventPeriod, _onEnterMsg));
// Schedule event end (now only for message sending)
ThreadPoolManager.schedule(new ScheduleEnd(), millisToEventEnd);
ThreadPool.schedule(new ScheduleEnd(), millisToEventEnd);
}
/**

View File

@@ -20,7 +20,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -68,7 +68,7 @@ public class QuestTimer
_player = player;
_npc = npc;
_isRepeating = repeating;
_schedular = repeating ? ThreadPoolManager.scheduleAtFixedRate(new ScheduleTimerTask(), time, time) : ThreadPoolManager.schedule(new ScheduleTimerTask(), time);
_schedular = repeating ? ThreadPool.scheduleAtFixedRate(new ScheduleTimerTask(), time, time) : ThreadPool.schedule(new ScheduleTimerTask(), time);
}
public QuestTimer(Quest quest, String name, long time, L2Npc npc, L2PcInstance player)

View File

@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.residences;
import java.time.Instant;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.xml.impl.ResidenceFunctionsData;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -65,7 +65,7 @@ public class ResidenceFunction
final ResidenceFunctionTemplate template = getTemplate();
if ((template != null) && (_expiration > System.currentTimeMillis()))
{
_task = ThreadPoolManager.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
_task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
}
}

View File

@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.shuttle;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2ShuttleInstance;
@@ -64,7 +64,7 @@ public class L2ShuttleEngine implements Runnable
_shuttle.openDoor(0);
_shuttle.closeDoor(1);
_shuttle.broadcastShuttleInfo();
ThreadPoolManager.schedule(this, DELAY);
ThreadPool.schedule(this, DELAY);
break;
}
case 1:
@@ -74,7 +74,7 @@ public class L2ShuttleEngine implements Runnable
_shuttle.closeDoor(0);
_shuttle.closeDoor(1);
_shuttle.broadcastShuttleInfo();
ThreadPoolManager.schedule(this, 1000);
ThreadPool.schedule(this, 1000);
break;
}
case 2:
@@ -89,7 +89,7 @@ public class L2ShuttleEngine implements Runnable
_shuttle.openDoor(1);
_shuttle.closeDoor(0);
_shuttle.broadcastShuttleInfo();
ThreadPoolManager.schedule(this, DELAY);
ThreadPool.schedule(this, DELAY);
break;
}
case 4:
@@ -99,7 +99,7 @@ public class L2ShuttleEngine implements Runnable
_shuttle.closeDoor(0);
_shuttle.closeDoor(1);
_shuttle.broadcastShuttleInfo();
ThreadPoolManager.schedule(this, 1000);
ThreadPool.schedule(this, 1000);
break;
}
case 5:

View File

@@ -23,8 +23,8 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.CharEffectList;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Summon;
@@ -322,7 +322,7 @@ public final class BuffInfo
// Creates a task that will stop all the effects.
if (_abnormalTime > 0)
{
_scheduledFutureTimeTask = ThreadPoolManager.scheduleAtFixedRate(new BuffTimeTask(this), 0, 1000L);
_scheduledFutureTimeTask = ThreadPool.scheduleAtFixedRate(new BuffTimeTask(this), 0, 1000L);
}
for (AbstractEffect effect : _effects)
@@ -340,7 +340,7 @@ public final class BuffInfo
{
// The task for the effect ticks.
final EffectTickTask effectTask = new EffectTickTask(this, effect);
final ScheduledFuture<?> scheduledFuture = ThreadPoolManager.scheduleAtFixedRate(effectTask, effect.getTicks() * Config.EFFECT_TICK_RATIO, effect.getTicks() * Config.EFFECT_TICK_RATIO);
final ScheduledFuture<?> scheduledFuture = ThreadPool.scheduleAtFixedRate(effectTask, effect.getTicks() * Config.EFFECT_TICK_RATIO, effect.getTicks() * Config.EFFECT_TICK_RATIO);
// Adds the task for ticking.
addTask(effect, new EffectTaskInfo(effectTask, scheduledFuture));
}
@@ -449,7 +449,7 @@ public final class BuffInfo
{
_scheduledFutureTimeTask.cancel(true);
}
_scheduledFutureTimeTask = ThreadPoolManager.scheduleAtFixedRate(new BuffTimeTask(this), 0, 1000L);
_scheduledFutureTimeTask = ThreadPool.scheduleAtFixedRate(new BuffTimeTask(this), 0, 1000L);
}
}

View File

@@ -28,8 +28,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.ActionData;
@@ -218,7 +218,7 @@ public class SkillCaster implements Runnable
// Reschedule next task if we have such.
if (hasNextPhase)
{
_task = ThreadPoolManager.schedule(this, nextTaskDelay);
_task = ThreadPool.schedule(this, nextTaskDelay);
}
else
{
@@ -755,7 +755,7 @@ public class SkillCaster implements Runnable
if (queuedSkill != null)
{
ThreadPoolManager.execute(() ->
ThreadPool.execute(() ->
{
currPlayer.setQueuedSkill(null, null, false, false);
currPlayer.useMagic(queuedSkill.getSkill(), queuedSkill.getItem(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed());

View File

@@ -22,7 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.ShotType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -78,7 +78,7 @@ public class SkillChannelizer implements Runnable
// Start channeling.
_skill = skill;
_task = ThreadPoolManager.scheduleAtFixedRate(this, skill.getChannelingTickInitialDelay(), skill.getChannelingTickInterval());
_task = ThreadPool.scheduleAtFixedRate(this, skill.getChannelingTickInitialDelay(), skill.getChannelingTickInterval());
}
public void stopChanneling()

View File

@@ -24,7 +24,7 @@ import java.util.Map;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -108,7 +108,7 @@ public abstract class VoteSystem implements Runnable
this.rewards = rewards;
this.checkMins = checkMins;
ThreadPoolManager.scheduleAtFixedRate(this, checkMins * 1000 * 60, checkMins * 1000 * 60);
ThreadPool.scheduleAtFixedRate(this, checkMins * 1000 * 60, checkMins * 1000 * 60);
}
protected void reward()

View File

@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -121,7 +121,7 @@ public class L2DamageZone extends L2ZoneType
{
if (getSettings().getTask() == null)
{
getSettings().setTask(ThreadPoolManager.scheduleAtFixedRate(new ApplyDamage(this), _startTask, _reuseTask));
getSettings().setTask(ThreadPool.scheduleAtFixedRate(new ApplyDamage(this), _startTask, _reuseTask));
}
}
}

Some files were not shown because too many files have changed in this diff Show More