From 0c201f75e7810650e7c8419e52f9d4a8c274cc19 Mon Sep 17 00:00:00 2001
From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Mon, 2 Apr 2018 14:50:53 +0000
Subject: [PATCH] Threadpool refactoring.
---
.../ai/areas/DenOfDevil/DenOfEvil.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 10 +-
.../FourSepulchers/FourSepulchers.java | 6 +-
.../AltarOfSacrifice/AltarOfSacrifice.java | 4 +-
.../AwakeningMaster/AwakeningMaster.java | 4 +-
.../HarnakUndergroundRuinsZone.java | 8 +-
.../scripts/ai/bosses/Lindvior/Lindvior.java | 34 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 4 +-
.../scripts/ai/bosses/Trasken/Trasken.java | 16 +-
.../data/scripts/ai/others/EnergySeeds.java | 4 +-
.../ai/others/NpcBuffers/NpcBufferAI.java | 4 +-
.../ai/others/NpcBuffers/NpcBuffers.java | 4 +-
.../scripts/custom/events/Elpies/Elpies.java | 4 +-
.../data/scripts/custom/events/Race/Race.java | 6 +-
.../AdminMonsterRace.java | 6 +-
.../admincommandhandlers/AdminTest.java | 4 +-
.../handlers/effecthandlers/ClassChange.java | 4 +-
.../handlers/playeractions/SocialAction.java | 4 +-
.../punishmenthandlers/JailHandler.java | 6 +-
.../handlers/telnethandlers/server/Debug.java | 4 +-
.../telnethandlers/server/Performance.java | 4 +-
.../handlers/telnethandlers/server/Purge.java | 6 +-
.../voicedcommandhandlers/AutoPotion.java | 4 +-
.../CastleDungeon/CastleDungeon.java | 4 +-
.../ChambersOfDelusion/ChamberOfDelusion.java | 6 +-
.../FortressDungeon/FortressDungeon.java | 4 +-
.../Q10292_SevenSignsGirlOfDoubt.java | 4 +-
.../Q10742_AFurryFriend.java | 4 +-
.../scripts/vehicles/AirShipController.java | 6 +-
.../AirShipGludioGracia.java | 10 +-
.../data/scripts/vehicles/BoatGludinRune.java | 38 +--
.../scripts/vehicles/BoatInnadrilTour.java | 20 +-
.../scripts/vehicles/BoatRunePrimeval.java | 8 +-
.../concurrent/ThreadPool.java} | 6 +-
.../com/l2jmobius/gameserver/GameServer.java | 3 +-
.../gameserver/ItemsAutoDestroy.java | 3 +-
.../gameserver/RecipeController.java | 11 +-
.../com/l2jmobius/gameserver/Shutdown.java | 3 +-
.../l2jmobius/gameserver/ai/AbstractAI.java | 4 +-
.../gameserver/ai/L2AttackableAI.java | 4 +-
.../gameserver/ai/L2CharacterAI.java | 4 +-
.../com/l2jmobius/gameserver/ai/L2DoorAI.java | 4 +-
.../l2jmobius/gameserver/ai/L2SummonAI.java | 4 +-
.../cache/WarehouseCacheManager.java | 4 +-
.../gameserver/data/sql/impl/ClanTable.java | 4 +-
.../gameserver/datatables/BotReportTable.java | 6 +-
.../gameserver/datatables/ItemTable.java | 6 +-
.../gameserver/idfactory/BitSetIDFactory.java | 4 +-
.../instancemanager/CastleManorManager.java | 6 +-
.../instancemanager/ClanEntryManager.java | 6 +-
.../instancemanager/CommissionManager.java | 6 +-
.../instancemanager/DBSpawnManager.java | 6 +-
.../FakePlayerChatManager.java | 6 +-
.../instancemanager/GraciaSeedsManager.java | 4 +-
.../instancemanager/GrandBossManager.java | 4 +-
.../HandysBlockCheckerManager.java | 6 +-
.../instancemanager/ItemsOnGroundManager.java | 4 +-
.../instancemanager/MailManager.java | 8 +-
.../instancemanager/PremiumManager.java | 4 +-
.../instancemanager/ServerRestartManager.java | 4 +-
.../instancemanager/WalkingManager.java | 8 +-
.../l2jmobius/gameserver/model/ClanWar.java | 12 +-
.../gameserver/model/CreatureContainer.java | 4 +-
.../gameserver/model/CursedWeapon.java | 8 +-
.../gameserver/model/DropProtection.java | 4 +-
.../l2jmobius/gameserver/model/Fishing.java | 6 +-
.../l2jmobius/gameserver/model/L2Clan.java | 4 +-
.../l2jmobius/gameserver/model/L2Party.java | 6 +-
.../l2jmobius/gameserver/model/L2Request.java | 4 +-
.../l2jmobius/gameserver/model/L2Spawn.java | 4 +-
.../gameserver/model/L2WorldRegion.java | 6 +-
.../gameserver/model/MpRewardTask.java | 4 +-
.../gameserver/model/actor/L2Attackable.java | 4 +-
.../gameserver/model/actor/L2Character.java | 26 +-
.../gameserver/model/actor/L2Npc.java | 4 +-
.../gameserver/model/actor/L2Vehicle.java | 4 +-
.../L2ControllableAirShipInstance.java | 8 +-
.../model/actor/instance/L2DecoyInstance.java | 6 +-
.../model/actor/instance/L2DoorInstance.java | 8 +-
.../instance/L2FortCommanderInstance.java | 4 +-
.../model/actor/instance/L2PcInstance.java | 42 +--
.../model/actor/instance/L2PetInstance.java | 4 +-
.../actor/instance/L2RaceManagerInstance.java | 46 +--
.../actor/instance/L2RaidBossInstance.java | 4 +-
.../actor/instance/L2ServitorInstance.java | 4 +-
.../actor/instance/L2SiegeFlagInstance.java | 4 +-
.../actor/instance/L2TamedBeastInstance.java | 10 +-
.../model/actor/instance/L2TrapInstance.java | 6 +-
.../model/actor/request/AbstractRequest.java | 4 +-
.../model/actor/status/CharStatus.java | 4 +-
.../tasks/attackable/CommandChannelTimer.java | 4 +-
.../actor/tasks/npc/RandomAnimationTask.java | 4 +-
.../actor/tasks/npc/trap/TrapTriggerTask.java | 4 +-
.../actor/tasks/player/FlyMoveStartTask.java | 4 +-
.../model/announce/AutoAnnouncement.java | 6 +-
.../gameserver/model/buylist/Product.java | 6 +-
.../gameserver/model/cubic/CubicInstance.java | 6 +-
.../model/entity/BlockCheckerEngine.java | 14 +-
.../gameserver/model/entity/Castle.java | 8 +-
.../gameserver/model/entity/ClanHall.java | 8 +-
.../gameserver/model/entity/Duel.java | 14 +-
.../gameserver/model/entity/Fort.java | 20 +-
.../gameserver/model/entity/FortSiege.java | 44 +--
.../gameserver/model/entity/Siege.java | 32 +-
.../model/eventengine/EventScheduler.java | 8 +-
.../model/events/EventDispatcher.java | 6 +-
.../model/events/timers/TimerHolder.java | 4 +-
.../model/instancezone/Instance.java | 14 +-
.../model/itemauction/ItemAuction.java | 4 +-
.../itemauction/ItemAuctionInstance.java | 16 +-
.../model/items/instance/L2ItemInstance.java | 12 +-
.../gameserver/model/olympiad/Olympiad.java | 22 +-
.../model/olympiad/OlympiadGameTask.java | 8 +-
.../model/punishment/PunishmentTask.java | 4 +-
.../gameserver/model/quest/LongTimeEvent.java | 6 +-
.../gameserver/model/quest/QuestTimer.java | 4 +-
.../model/residences/ResidenceFunction.java | 4 +-
.../model/shuttle/L2ShuttleEngine.java | 10 +-
.../gameserver/model/skills/BuffInfo.java | 8 +-
.../gameserver/model/skills/SkillCaster.java | 6 +-
.../model/skills/SkillChannelizer.java | 4 +-
.../model/votereward/VoteSystem.java | 4 +-
.../model/zone/type/L2DamageZone.java | 4 +-
.../model/zone/type/L2EffectZone.java | 4 +-
.../model/zone/type/L2FishingZone.java | 6 +-
.../model/zone/type/L2JailZone.java | 4 +-
.../zone/type/L2OlympiadStadiumZone.java | 4 +-
.../type/L2ResidenceHallTeleportZone.java | 4 +-
.../model/zone/type/L2SayuneZone.java | 4 +-
.../gameserver/network/Disconnection.java | 4 +-
.../network/clientpackets/EnterWorld.java | 4 +-
.../clientpackets/RequestDuelStart.java | 4 +-
.../clientpackets/RequestJoinParty.java | 4 +-
.../clientpackets/RequestJoinPledge.java | 4 +-
.../clientpackets/RequestPreviewItem.java | 4 +-
.../clientpackets/RequestRestartPoint.java | 4 +-
.../network/clientpackets/TradeRequest.java | 4 +-
.../network/clientpackets/UseItem.java | 4 +-
.../friend/RequestFriendInvite.java | 4 +-
.../serverpackets/ExAlterSkillRequest.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 4 +-
.../taskmanager/DecayTaskManager.java | 4 +-
.../gameserver/taskmanager/TaskManager.java | 10 +-
.../com/l2jmobius/gameserver/util/Evolve.java | 10 +-
.../l2jmobius/gameserver/util/MinionList.java | 4 +-
.../com/l2jmobius/gameserver/util/Util.java | 4 +-
.../ai/areas/DenOfDevil/DenOfEvil.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 10 +-
.../areas/GainakUnderground/GainakSiege.java | 4 +-
.../FourSepulchers/FourSepulchers.java | 6 +-
.../AltarOfSacrifice/AltarOfSacrifice.java | 4 +-
.../AwakeningMaster/AwakeningMaster.java | 4 +-
.../HarnakUndergroundRuinsZone.java | 8 +-
.../scripts/ai/bosses/Lindvior/Lindvior.java | 34 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 4 +-
.../scripts/ai/bosses/Trasken/Trasken.java | 16 +-
.../data/scripts/ai/others/EnergySeeds.java | 4 +-
.../ai/others/NpcBuffers/NpcBufferAI.java | 4 +-
.../ai/others/NpcBuffers/NpcBuffers.java | 4 +-
.../scripts/custom/events/Elpies/Elpies.java | 4 +-
.../data/scripts/custom/events/Race/Race.java | 6 +-
.../AdminMonsterRace.java | 6 +-
.../admincommandhandlers/AdminTest.java | 4 +-
.../handlers/effecthandlers/ClassChange.java | 4 +-
.../handlers/playeractions/SocialAction.java | 4 +-
.../punishmenthandlers/JailHandler.java | 6 +-
.../handlers/telnethandlers/server/Debug.java | 4 +-
.../telnethandlers/server/Performance.java | 4 +-
.../handlers/telnethandlers/server/Purge.java | 6 +-
.../voicedcommandhandlers/AutoPotion.java | 4 +-
.../CastleDungeon/CastleDungeon.java | 4 +-
.../ChambersOfDelusion/ChamberOfDelusion.java | 6 +-
.../FortressDungeon/FortressDungeon.java | 4 +-
.../Q10292_SevenSignsGirlOfDoubt.java | 4 +-
.../Q10742_AFurryFriend.java | 4 +-
.../scripts/vehicles/AirShipController.java | 6 +-
.../AirShipGludioGracia.java | 10 +-
.../data/scripts/vehicles/BoatGludinRune.java | 38 +--
.../scripts/vehicles/BoatInnadrilTour.java | 20 +-
.../scripts/vehicles/BoatRunePrimeval.java | 8 +-
.../concurrent/ThreadPool.java} | 6 +-
.../com/l2jmobius/gameserver/GameServer.java | 3 +-
.../gameserver/ItemsAutoDestroy.java | 3 +-
.../gameserver/RecipeController.java | 11 +-
.../com/l2jmobius/gameserver/Shutdown.java | 3 +-
.../l2jmobius/gameserver/ai/AbstractAI.java | 4 +-
.../gameserver/ai/L2AttackableAI.java | 4 +-
.../gameserver/ai/L2CharacterAI.java | 4 +-
.../com/l2jmobius/gameserver/ai/L2DoorAI.java | 4 +-
.../l2jmobius/gameserver/ai/L2SummonAI.java | 4 +-
.../cache/WarehouseCacheManager.java | 4 +-
.../gameserver/data/sql/impl/ClanTable.java | 4 +-
.../gameserver/datatables/BotReportTable.java | 6 +-
.../gameserver/datatables/ItemTable.java | 6 +-
.../gameserver/idfactory/BitSetIDFactory.java | 4 +-
.../instancemanager/CastleManorManager.java | 6 +-
.../instancemanager/ClanEntryManager.java | 6 +-
.../instancemanager/CommissionManager.java | 6 +-
.../instancemanager/DBSpawnManager.java | 6 +-
.../FakePlayerChatManager.java | 6 +-
.../instancemanager/GraciaSeedsManager.java | 4 +-
.../instancemanager/GrandBossManager.java | 4 +-
.../HandysBlockCheckerManager.java | 6 +-
.../instancemanager/ItemsOnGroundManager.java | 4 +-
.../instancemanager/MailManager.java | 8 +-
.../instancemanager/PremiumManager.java | 4 +-
.../instancemanager/ServerRestartManager.java | 4 +-
.../instancemanager/WalkingManager.java | 8 +-
.../l2jmobius/gameserver/model/ClanWar.java | 12 +-
.../gameserver/model/CreatureContainer.java | 4 +-
.../gameserver/model/CursedWeapon.java | 8 +-
.../gameserver/model/DropProtection.java | 4 +-
.../l2jmobius/gameserver/model/Fishing.java | 6 +-
.../l2jmobius/gameserver/model/L2Clan.java | 4 +-
.../l2jmobius/gameserver/model/L2Party.java | 6 +-
.../l2jmobius/gameserver/model/L2Request.java | 4 +-
.../l2jmobius/gameserver/model/L2Spawn.java | 4 +-
.../gameserver/model/L2WorldRegion.java | 6 +-
.../gameserver/model/MpRewardTask.java | 4 +-
.../gameserver/model/actor/L2Attackable.java | 4 +-
.../gameserver/model/actor/L2Character.java | 26 +-
.../gameserver/model/actor/L2Npc.java | 4 +-
.../gameserver/model/actor/L2Vehicle.java | 4 +-
.../L2ControllableAirShipInstance.java | 8 +-
.../model/actor/instance/L2DecoyInstance.java | 6 +-
.../model/actor/instance/L2DoorInstance.java | 8 +-
.../instance/L2FortCommanderInstance.java | 4 +-
.../model/actor/instance/L2PcInstance.java | 42 +--
.../model/actor/instance/L2PetInstance.java | 4 +-
.../actor/instance/L2RaceManagerInstance.java | 46 +--
.../actor/instance/L2RaidBossInstance.java | 4 +-
.../actor/instance/L2ServitorInstance.java | 4 +-
.../actor/instance/L2SiegeFlagInstance.java | 4 +-
.../actor/instance/L2TamedBeastInstance.java | 10 +-
.../model/actor/instance/L2TrapInstance.java | 6 +-
.../model/actor/request/AbstractRequest.java | 4 +-
.../model/actor/status/CharStatus.java | 4 +-
.../tasks/attackable/CommandChannelTimer.java | 4 +-
.../actor/tasks/npc/RandomAnimationTask.java | 4 +-
.../actor/tasks/npc/trap/TrapTriggerTask.java | 4 +-
.../actor/tasks/player/FlyMoveStartTask.java | 4 +-
.../model/announce/AutoAnnouncement.java | 6 +-
.../gameserver/model/buylist/Product.java | 6 +-
.../gameserver/model/cubic/CubicInstance.java | 6 +-
.../model/entity/BlockCheckerEngine.java | 14 +-
.../gameserver/model/entity/Castle.java | 8 +-
.../gameserver/model/entity/ClanHall.java | 8 +-
.../gameserver/model/entity/Duel.java | 14 +-
.../gameserver/model/entity/Fort.java | 20 +-
.../gameserver/model/entity/FortSiege.java | 44 +--
.../gameserver/model/entity/Siege.java | 32 +-
.../model/eventengine/EventScheduler.java | 8 +-
.../model/events/EventDispatcher.java | 6 +-
.../model/events/timers/TimerHolder.java | 4 +-
.../model/instancezone/Instance.java | 14 +-
.../model/itemauction/ItemAuction.java | 4 +-
.../itemauction/ItemAuctionInstance.java | 16 +-
.../model/items/instance/L2ItemInstance.java | 12 +-
.../gameserver/model/olympiad/Olympiad.java | 22 +-
.../model/olympiad/OlympiadGameTask.java | 8 +-
.../model/punishment/PunishmentTask.java | 4 +-
.../gameserver/model/quest/LongTimeEvent.java | 6 +-
.../gameserver/model/quest/QuestTimer.java | 4 +-
.../model/residences/ResidenceFunction.java | 4 +-
.../model/shuttle/L2ShuttleEngine.java | 10 +-
.../gameserver/model/skills/BuffInfo.java | 8 +-
.../gameserver/model/skills/SkillCaster.java | 6 +-
.../model/skills/SkillChannelizer.java | 4 +-
.../model/votereward/VoteSystem.java | 4 +-
.../model/zone/type/L2DamageZone.java | 4 +-
.../model/zone/type/L2EffectZone.java | 4 +-
.../model/zone/type/L2FishingZone.java | 6 +-
.../model/zone/type/L2JailZone.java | 4 +-
.../zone/type/L2OlympiadStadiumZone.java | 4 +-
.../type/L2ResidenceHallTeleportZone.java | 4 +-
.../model/zone/type/L2SayuneZone.java | 4 +-
.../gameserver/network/Disconnection.java | 4 +-
.../network/clientpackets/EnterWorld.java | 6 +-
.../clientpackets/RequestDuelStart.java | 4 +-
.../clientpackets/RequestJoinParty.java | 4 +-
.../clientpackets/RequestJoinPledge.java | 4 +-
.../clientpackets/RequestPreviewItem.java | 4 +-
.../clientpackets/RequestRestartPoint.java | 4 +-
.../network/clientpackets/TradeRequest.java | 4 +-
.../network/clientpackets/UseItem.java | 4 +-
.../friend/RequestFriendInvite.java | 4 +-
.../serverpackets/ExAlterSkillRequest.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 4 +-
.../taskmanager/DecayTaskManager.java | 4 +-
.../gameserver/taskmanager/TaskManager.java | 10 +-
.../com/l2jmobius/gameserver/util/Evolve.java | 10 +-
.../l2jmobius/gameserver/util/MinionList.java | 4 +-
.../com/l2jmobius/gameserver/util/Util.java | 4 +-
.../ai/areas/DenOfDevil/DenOfEvil.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 10 +-
.../areas/GainakUnderground/GainakSiege.java | 4 +-
.../FourSepulchers/FourSepulchers.java | 6 +-
.../AltarOfSacrifice/AltarOfSacrifice.java | 4 +-
.../AwakeningMaster/AwakeningMaster.java | 4 +-
.../HarnakUndergroundRuinsZone.java | 8 +-
.../scripts/ai/bosses/Lindvior/Lindvior.java | 34 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 4 +-
.../scripts/ai/bosses/Trasken/Trasken.java | 16 +-
.../data/scripts/ai/others/EnergySeeds.java | 4 +-
.../ai/others/NpcBuffers/NpcBufferAI.java | 4 +-
.../ai/others/NpcBuffers/NpcBuffers.java | 4 +-
.../scripts/custom/events/Elpies/Elpies.java | 4 +-
.../data/scripts/custom/events/Race/Race.java | 6 +-
.../AdminMonsterRace.java | 6 +-
.../admincommandhandlers/AdminTest.java | 4 +-
.../handlers/effecthandlers/ClassChange.java | 4 +-
.../handlers/playeractions/SocialAction.java | 4 +-
.../punishmenthandlers/JailHandler.java | 6 +-
.../handlers/telnethandlers/server/Debug.java | 4 +-
.../telnethandlers/server/Performance.java | 4 +-
.../handlers/telnethandlers/server/Purge.java | 6 +-
.../voicedcommandhandlers/AutoPotion.java | 4 +-
.../CastleDungeon/CastleDungeon.java | 4 +-
.../ChambersOfDelusion/ChamberOfDelusion.java | 6 +-
.../FortressDungeon/FortressDungeon.java | 4 +-
.../Q10292_SevenSignsGirlOfDoubt.java | 4 +-
.../Q10742_AFurryFriend.java | 4 +-
.../scripts/vehicles/AirShipController.java | 6 +-
.../AirShipGludioGracia.java | 10 +-
.../data/scripts/vehicles/BoatGludinRune.java | 38 +--
.../scripts/vehicles/BoatInnadrilTour.java | 20 +-
.../scripts/vehicles/BoatRunePrimeval.java | 8 +-
.../concurrent/ThreadPool.java} | 6 +-
.../com/l2jmobius/gameserver/GameServer.java | 3 +-
.../gameserver/ItemsAutoDestroy.java | 3 +-
.../gameserver/RecipeController.java | 11 +-
.../com/l2jmobius/gameserver/Shutdown.java | 3 +-
.../l2jmobius/gameserver/ai/AbstractAI.java | 4 +-
.../gameserver/ai/L2AttackableAI.java | 4 +-
.../gameserver/ai/L2CharacterAI.java | 4 +-
.../com/l2jmobius/gameserver/ai/L2DoorAI.java | 4 +-
.../l2jmobius/gameserver/ai/L2SummonAI.java | 4 +-
.../cache/WarehouseCacheManager.java | 4 +-
.../gameserver/data/sql/impl/ClanTable.java | 4 +-
.../gameserver/datatables/BotReportTable.java | 6 +-
.../gameserver/datatables/ItemTable.java | 6 +-
.../gameserver/idfactory/BitSetIDFactory.java | 4 +-
.../instancemanager/CastleManorManager.java | 6 +-
.../instancemanager/ClanEntryManager.java | 6 +-
.../instancemanager/CommissionManager.java | 6 +-
.../instancemanager/DBSpawnManager.java | 6 +-
.../FakePlayerChatManager.java | 6 +-
.../instancemanager/GraciaSeedsManager.java | 4 +-
.../instancemanager/GrandBossManager.java | 4 +-
.../HandysBlockCheckerManager.java | 6 +-
.../instancemanager/ItemsOnGroundManager.java | 4 +-
.../instancemanager/MailManager.java | 8 +-
.../instancemanager/PremiumManager.java | 4 +-
.../instancemanager/ServerRestartManager.java | 4 +-
.../instancemanager/WalkingManager.java | 8 +-
.../l2jmobius/gameserver/model/ClanWar.java | 12 +-
.../gameserver/model/CreatureContainer.java | 4 +-
.../gameserver/model/CursedWeapon.java | 8 +-
.../gameserver/model/DropProtection.java | 4 +-
.../l2jmobius/gameserver/model/Fishing.java | 6 +-
.../l2jmobius/gameserver/model/L2Clan.java | 4 +-
.../l2jmobius/gameserver/model/L2Party.java | 6 +-
.../l2jmobius/gameserver/model/L2Request.java | 4 +-
.../l2jmobius/gameserver/model/L2Spawn.java | 4 +-
.../gameserver/model/L2WorldRegion.java | 6 +-
.../gameserver/model/MpRewardTask.java | 4 +-
.../gameserver/model/actor/L2Attackable.java | 4 +-
.../gameserver/model/actor/L2Character.java | 26 +-
.../gameserver/model/actor/L2Npc.java | 4 +-
.../gameserver/model/actor/L2Vehicle.java | 4 +-
.../L2ControllableAirShipInstance.java | 8 +-
.../model/actor/instance/L2DecoyInstance.java | 6 +-
.../model/actor/instance/L2DoorInstance.java | 8 +-
.../instance/L2FortCommanderInstance.java | 4 +-
.../model/actor/instance/L2PcInstance.java | 42 +--
.../model/actor/instance/L2PetInstance.java | 4 +-
.../actor/instance/L2RaceManagerInstance.java | 46 +--
.../actor/instance/L2RaidBossInstance.java | 4 +-
.../actor/instance/L2ServitorInstance.java | 4 +-
.../actor/instance/L2SiegeFlagInstance.java | 4 +-
.../actor/instance/L2TamedBeastInstance.java | 10 +-
.../model/actor/instance/L2TrapInstance.java | 6 +-
.../model/actor/request/AbstractRequest.java | 4 +-
.../model/actor/status/CharStatus.java | 4 +-
.../tasks/attackable/CommandChannelTimer.java | 4 +-
.../actor/tasks/npc/RandomAnimationTask.java | 4 +-
.../actor/tasks/npc/trap/TrapTriggerTask.java | 4 +-
.../actor/tasks/player/FlyMoveStartTask.java | 4 +-
.../model/announce/AutoAnnouncement.java | 6 +-
.../gameserver/model/buylist/Product.java | 6 +-
.../gameserver/model/cubic/CubicInstance.java | 6 +-
.../model/entity/BlockCheckerEngine.java | 14 +-
.../gameserver/model/entity/Castle.java | 8 +-
.../gameserver/model/entity/ClanHall.java | 8 +-
.../gameserver/model/entity/Duel.java | 14 +-
.../gameserver/model/entity/Fort.java | 20 +-
.../gameserver/model/entity/FortSiege.java | 44 +--
.../gameserver/model/entity/Siege.java | 32 +-
.../model/eventengine/EventScheduler.java | 8 +-
.../model/events/EventDispatcher.java | 6 +-
.../model/events/timers/TimerHolder.java | 4 +-
.../model/instancezone/Instance.java | 14 +-
.../model/itemauction/ItemAuction.java | 4 +-
.../itemauction/ItemAuctionInstance.java | 16 +-
.../model/items/instance/L2ItemInstance.java | 12 +-
.../gameserver/model/olympiad/Olympiad.java | 22 +-
.../model/olympiad/OlympiadGameTask.java | 8 +-
.../model/punishment/PunishmentTask.java | 4 +-
.../gameserver/model/quest/LongTimeEvent.java | 6 +-
.../gameserver/model/quest/QuestTimer.java | 4 +-
.../model/residences/ResidenceFunction.java | 4 +-
.../model/shuttle/L2ShuttleEngine.java | 10 +-
.../gameserver/model/skills/BuffInfo.java | 8 +-
.../gameserver/model/skills/SkillCaster.java | 6 +-
.../model/skills/SkillChannelizer.java | 4 +-
.../model/votereward/VoteSystem.java | 4 +-
.../model/zone/type/L2DamageZone.java | 4 +-
.../model/zone/type/L2EffectZone.java | 4 +-
.../model/zone/type/L2FishingZone.java | 6 +-
.../model/zone/type/L2JailZone.java | 4 +-
.../zone/type/L2OlympiadStadiumZone.java | 4 +-
.../type/L2ResidenceHallTeleportZone.java | 4 +-
.../model/zone/type/L2SayuneZone.java | 4 +-
.../gameserver/network/Disconnection.java | 4 +-
.../network/clientpackets/EnterWorld.java | 6 +-
.../clientpackets/RequestDuelStart.java | 4 +-
.../clientpackets/RequestJoinParty.java | 4 +-
.../clientpackets/RequestJoinPledge.java | 4 +-
.../clientpackets/RequestPreviewItem.java | 4 +-
.../clientpackets/RequestRestartPoint.java | 4 +-
.../network/clientpackets/TradeRequest.java | 4 +-
.../network/clientpackets/UseItem.java | 4 +-
.../friend/RequestFriendInvite.java | 4 +-
.../serverpackets/ExAlterSkillRequest.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 4 +-
.../taskmanager/DecayTaskManager.java | 4 +-
.../gameserver/taskmanager/TaskManager.java | 10 +-
.../com/l2jmobius/gameserver/util/Evolve.java | 10 +-
.../l2jmobius/gameserver/util/MinionList.java | 4 +-
.../com/l2jmobius/gameserver/util/Util.java | 4 +-
.../ai/areas/DenOfDevil/DenOfEvil.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 10 +-
.../areas/GainakUnderground/GainakSiege.java | 4 +-
.../FourSepulchers/FourSepulchers.java | 6 +-
.../AltarOfSacrifice/AltarOfSacrifice.java | 4 +-
.../AwakeningMaster/AwakeningMaster.java | 4 +-
.../HarnakUndergroundRuinsZone.java | 8 +-
.../scripts/ai/bosses/Lindvior/Lindvior.java | 34 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 4 +-
.../scripts/ai/bosses/Trasken/Trasken.java | 16 +-
.../data/scripts/ai/others/EnergySeeds.java | 4 +-
.../ai/others/NpcBuffers/NpcBufferAI.java | 4 +-
.../ai/others/NpcBuffers/NpcBuffers.java | 4 +-
.../scripts/custom/events/Elpies/Elpies.java | 4 +-
.../data/scripts/custom/events/Race/Race.java | 6 +-
.../AdminMonsterRace.java | 6 +-
.../admincommandhandlers/AdminTest.java | 4 +-
.../handlers/effecthandlers/ClassChange.java | 4 +-
.../handlers/playeractions/SocialAction.java | 4 +-
.../punishmenthandlers/JailHandler.java | 6 +-
.../handlers/telnethandlers/server/Debug.java | 4 +-
.../telnethandlers/server/Performance.java | 4 +-
.../handlers/telnethandlers/server/Purge.java | 6 +-
.../voicedcommandhandlers/AutoPotion.java | 4 +-
.../CastleDungeon/CastleDungeon.java | 4 +-
.../ChambersOfDelusion/ChamberOfDelusion.java | 6 +-
.../FortressDungeon/FortressDungeon.java | 4 +-
.../Q10292_SevenSignsGirlOfDoubt.java | 4 +-
.../Q10742_AFurryFriend.java | 4 +-
.../scripts/vehicles/AirShipController.java | 6 +-
.../AirShipGludioGracia.java | 10 +-
.../data/scripts/vehicles/BoatGludinRune.java | 38 +--
.../scripts/vehicles/BoatInnadrilTour.java | 20 +-
.../scripts/vehicles/BoatRunePrimeval.java | 8 +-
.../concurrent/ThreadPool.java} | 6 +-
.../com/l2jmobius/gameserver/GameServer.java | 3 +-
.../gameserver/ItemsAutoDestroy.java | 3 +-
.../com/l2jmobius/gameserver/Shutdown.java | 3 +-
.../l2jmobius/gameserver/ai/AbstractAI.java | 4 +-
.../gameserver/ai/L2AttackableAI.java | 4 +-
.../gameserver/ai/L2CharacterAI.java | 4 +-
.../com/l2jmobius/gameserver/ai/L2DoorAI.java | 4 +-
.../l2jmobius/gameserver/ai/L2SummonAI.java | 4 +-
.../cache/WarehouseCacheManager.java | 4 +-
.../gameserver/data/sql/impl/ClanTable.java | 4 +-
.../gameserver/datatables/BotReportTable.java | 6 +-
.../gameserver/datatables/ItemTable.java | 6 +-
.../gameserver/idfactory/BitSetIDFactory.java | 4 +-
.../instancemanager/CastleManorManager.java | 6 +-
.../instancemanager/ClanEntryManager.java | 6 +-
.../instancemanager/CommissionManager.java | 6 +-
.../instancemanager/DBSpawnManager.java | 6 +-
.../FakePlayerChatManager.java | 6 +-
.../instancemanager/GraciaSeedsManager.java | 4 +-
.../instancemanager/GrandBossManager.java | 4 +-
.../HandysBlockCheckerManager.java | 6 +-
.../instancemanager/ItemsOnGroundManager.java | 4 +-
.../instancemanager/MailManager.java | 8 +-
.../instancemanager/PremiumManager.java | 4 +-
.../instancemanager/ServerRestartManager.java | 4 +-
.../instancemanager/WalkingManager.java | 8 +-
.../l2jmobius/gameserver/model/ClanWar.java | 12 +-
.../gameserver/model/CreatureContainer.java | 4 +-
.../gameserver/model/CursedWeapon.java | 8 +-
.../gameserver/model/DropProtection.java | 4 +-
.../l2jmobius/gameserver/model/Fishing.java | 6 +-
.../l2jmobius/gameserver/model/L2Clan.java | 4 +-
.../l2jmobius/gameserver/model/L2Party.java | 6 +-
.../l2jmobius/gameserver/model/L2Request.java | 4 +-
.../l2jmobius/gameserver/model/L2Spawn.java | 4 +-
.../gameserver/model/L2WorldRegion.java | 6 +-
.../gameserver/model/MpRewardTask.java | 4 +-
.../gameserver/model/actor/L2Attackable.java | 4 +-
.../gameserver/model/actor/L2Character.java | 26 +-
.../gameserver/model/actor/L2Npc.java | 4 +-
.../gameserver/model/actor/L2Vehicle.java | 4 +-
.../L2ControllableAirShipInstance.java | 8 +-
.../model/actor/instance/L2DecoyInstance.java | 6 +-
.../model/actor/instance/L2DoorInstance.java | 8 +-
.../instance/L2FortCommanderInstance.java | 4 +-
.../model/actor/instance/L2PcInstance.java | 42 +--
.../model/actor/instance/L2PetInstance.java | 4 +-
.../actor/instance/L2RaceManagerInstance.java | 46 +--
.../actor/instance/L2RaidBossInstance.java | 4 +-
.../actor/instance/L2ServitorInstance.java | 4 +-
.../actor/instance/L2SiegeFlagInstance.java | 4 +-
.../actor/instance/L2TamedBeastInstance.java | 10 +-
.../model/actor/instance/L2TrapInstance.java | 6 +-
.../model/actor/request/AbstractRequest.java | 4 +-
.../model/actor/status/CharStatus.java | 4 +-
.../tasks/attackable/CommandChannelTimer.java | 4 +-
.../actor/tasks/npc/RandomAnimationTask.java | 4 +-
.../actor/tasks/npc/trap/TrapTriggerTask.java | 4 +-
.../actor/tasks/player/FlyMoveStartTask.java | 4 +-
.../model/announce/AutoAnnouncement.java | 6 +-
.../gameserver/model/buylist/Product.java | 6 +-
.../gameserver/model/cubic/CubicInstance.java | 6 +-
.../model/entity/BlockCheckerEngine.java | 14 +-
.../gameserver/model/entity/Castle.java | 8 +-
.../gameserver/model/entity/ClanHall.java | 8 +-
.../gameserver/model/entity/Duel.java | 14 +-
.../gameserver/model/entity/Fort.java | 20 +-
.../gameserver/model/entity/FortSiege.java | 44 +--
.../gameserver/model/entity/Siege.java | 32 +-
.../model/eventengine/EventScheduler.java | 8 +-
.../model/events/EventDispatcher.java | 6 +-
.../model/events/timers/TimerHolder.java | 4 +-
.../model/instancezone/Instance.java | 14 +-
.../model/itemauction/ItemAuction.java | 4 +-
.../itemauction/ItemAuctionInstance.java | 16 +-
.../model/items/instance/L2ItemInstance.java | 12 +-
.../gameserver/model/olympiad/Olympiad.java | 22 +-
.../model/olympiad/OlympiadGameTask.java | 8 +-
.../model/punishment/PunishmentTask.java | 4 +-
.../gameserver/model/quest/LongTimeEvent.java | 6 +-
.../gameserver/model/quest/QuestTimer.java | 4 +-
.../model/residences/ResidenceFunction.java | 4 +-
.../model/shuttle/L2ShuttleEngine.java | 10 +-
.../gameserver/model/skills/BuffInfo.java | 8 +-
.../gameserver/model/skills/SkillCaster.java | 6 +-
.../model/skills/SkillChannelizer.java | 4 +-
.../model/votereward/VoteSystem.java | 4 +-
.../model/zone/type/L2DamageZone.java | 4 +-
.../model/zone/type/L2EffectZone.java | 4 +-
.../model/zone/type/L2FishingZone.java | 6 +-
.../model/zone/type/L2JailZone.java | 4 +-
.../zone/type/L2OlympiadStadiumZone.java | 4 +-
.../type/L2ResidenceHallTeleportZone.java | 4 +-
.../model/zone/type/L2SayuneZone.java | 4 +-
.../gameserver/network/Disconnection.java | 4 +-
.../network/clientpackets/EnterWorld.java | 6 +-
.../clientpackets/RequestDuelStart.java | 4 +-
.../clientpackets/RequestJoinParty.java | 4 +-
.../clientpackets/RequestJoinPledge.java | 4 +-
.../clientpackets/RequestPreviewItem.java | 4 +-
.../clientpackets/RequestRestartPoint.java | 4 +-
.../network/clientpackets/TradeRequest.java | 4 +-
.../network/clientpackets/UseItem.java | 4 +-
.../friend/RequestFriendInvite.java | 4 +-
.../serverpackets/ExAlterSkillRequest.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 4 +-
.../taskmanager/DecayTaskManager.java | 4 +-
.../gameserver/taskmanager/TaskManager.java | 10 +-
.../com/l2jmobius/gameserver/util/Evolve.java | 10 +-
.../l2jmobius/gameserver/util/MinionList.java | 4 +-
.../com/l2jmobius/gameserver/util/Util.java | 4 +-
.../game/data/scripts/ai/bosses/Antharas.java | 40 +--
.../game/data/scripts/ai/bosses/Baium.java | 8 +-
.../game/data/scripts/ai/bosses/Valakas.java | 6 +-
.../data/scripts/ai/bosses/VanHalter.java | 64 ++--
.../game/data/scripts/ai/bosses/Zaken.java | 6 +-
...ThreadPoolManager.java => ThreadPool.java} | 4 +-
.../com/l2jmobius/gameserver/GameServer.java | 8 +-
.../gameserver/GameTimeController.java | 8 +-
.../gameserver/RecipeController.java | 10 +-
.../l2jmobius/gameserver/ServerStatus.java | 4 +-
.../com/l2jmobius/gameserver/Shutdown.java | 4 +-
.../l2jmobius/gameserver/TradeController.java | 12 +-
.../l2jmobius/gameserver/ai/AbstractAI.java | 6 +-
.../gameserver/ai/L2AttackableAI.java | 4 +-
.../com/l2jmobius/gameserver/ai/L2DoorAI.java | 4 +-
.../gameserver/ai/L2FortSiegeGuardAI.java | 4 +-
.../gameserver/ai/L2NpcWalkerAI.java | 4 +-
.../l2jmobius/gameserver/ai/L2PlayerAI.java | 4 +-
.../gameserver/ai/L2SiegeGuardAI.java | 4 +-
.../cache/WarehouseCacheManager.java | 4 +-
.../gameserver/datatables/sql/ClanTable.java | 4 +-
.../datatables/sql/TradeListTable.java | 8 +-
.../gameserver/datatables/xml/ItemTable.java | 4 +-
.../handler/AutoAnnouncementHandler.java | 4 +-
.../gameserver/handler/AutoChatHandler.java | 8 +-
.../AdminMonsterRace.java | 6 +-
.../admincommandhandlers/AdminTest.java | 4 +-
.../handler/itemhandlers/ChristmasTree.java | 4 +-
.../handler/itemhandlers/MysteryPotion.java | 4 +-
.../handler/itemhandlers/Potions.java | 4 +-
.../handler/itemhandlers/ScrollOfEscape.java | 4 +-
.../handler/itemhandlers/SoulCrystals.java | 4 +-
.../handler/itemhandlers/SummonItems.java | 6 +-
.../handler/skillhandlers/ClanGate.java | 4 +-
.../handler/usercommandhandlers/Escape.java | 4 +-
.../voicedcommandhandlers/FarmPvpCmd.java | 4 +-
.../voicedcommandhandlers/Wedding.java | 4 +-
.../gameserver/idfactory/BitSetIDFactory.java | 4 +-
.../instancemanager/AutoSaveManager.java | 8 +-
.../instancemanager/AwayManager.java | 6 +-
.../instancemanager/CastleManorManager.java | 4 +-
.../instancemanager/ChristmasManager.java | 18 +-
.../FishingChampionshipManager.java | 8 +-
.../FourSepulchersManager.java | 26 +-
.../instancemanager/ItemsOnGroundManager.java | 6 +-
.../instancemanager/MercTicketManager.java | 4 +-
.../instancemanager/RaidBossSpawnManager.java | 6 +-
.../gameserver/model/CursedWeapon.java | 6 +-
.../gameserver/model/DropProtection.java | 4 +-
.../l2jmobius/gameserver/model/L2Effect.java | 8 +-
.../l2jmobius/gameserver/model/L2Fishing.java | 4 +-
.../l2jmobius/gameserver/model/L2Party.java | 4 +-
.../l2jmobius/gameserver/model/L2Potion.java | 4 +-
.../l2jmobius/gameserver/model/L2Radar.java | 4 +-
.../l2jmobius/gameserver/model/L2Request.java | 4 +-
.../gameserver/model/L2WorldRegion.java | 6 +-
.../gameserver/model/actor/L2Attackable.java | 6 +-
.../gameserver/model/actor/L2Character.java | 46 +--
.../actor/instance/L2BabyPetInstance.java | 6 +-
.../model/actor/instance/L2BoatInstance.java | 24 +-
.../instance/L2CabaleBufferInstance.java | 4 +-
.../instance/L2CastleTeleporterInstance.java | 4 +-
.../model/actor/instance/L2CubicInstance.java | 8 +-
.../model/actor/instance/L2DoorInstance.java | 6 +-
.../actor/instance/L2GrandBossInstance.java | 4 +-
.../model/actor/instance/L2GuardInstance.java | 4 +-
.../actor/instance/L2GuardNoHTMLInstance.java | 4 +-
.../model/actor/instance/L2ItemInstance.java | 4 +-
.../actor/instance/L2MonsterInstance.java | 6 +-
.../model/actor/instance/L2NpcInstance.java | 4 +-
.../model/actor/instance/L2PcInstance.java | 48 +--
.../model/actor/instance/L2PetInstance.java | 4 +-
.../actor/instance/L2ProtectorInstance.java | 4 +-
.../actor/instance/L2RaceManagerInstance.java | 46 +--
.../actor/instance/L2RaidBossInstance.java | 4 +-
.../instance/L2SepulcherMonsterInstance.java | 18 +-
.../instance/L2SepulcherNpcInstance.java | 8 +-
.../actor/instance/L2SummonInstance.java | 4 +-
.../actor/instance/L2TamedBeastInstance.java | 6 +-
.../actor/instance/L2TownPetInstance.java | 4 +-
.../actor/instance/L2XmassTreeInstance.java | 4 +-
.../model/actor/status/CharStatus.java | 4 +-
.../gameserver/model/entity/Auction.java | 6 +-
.../gameserver/model/entity/ClanHall.java | 24 +-
.../gameserver/model/entity/Duel.java | 14 +-
.../gameserver/model/entity/event/CTF.java | 10 +-
.../gameserver/model/entity/event/DM.java | 6 +-
.../model/entity/event/Lottery.java | 12 +-
.../gameserver/model/entity/event/TvT.java | 8 +-
.../gameserver/model/entity/event/VIP.java | 12 +-
.../event/manager/EventsGlobalTask.java | 6 +-
.../model/entity/olympiad/Olympiad.java | 20 +-
.../model/entity/sevensigns/SevenSigns.java | 6 +-
.../entity/sevensigns/SevenSignsFestival.java | 6 +-
.../gameserver/model/entity/siege/Castle.java | 6 +-
.../gameserver/model/entity/siege/Fort.java | 4 +-
.../model/entity/siege/FortSiege.java | 28 +-
.../gameserver/model/entity/siege/Siege.java | 28 +-
.../clanhalls/BanditStrongholdSiege.java | 10 +-
.../siege/clanhalls/DevastatedCastle.java | 20 +-
.../siege/clanhalls/FortressOfResistance.java | 12 +-
.../siege/clanhalls/WildBeastFarmSiege.java | 10 +-
.../gameserver/model/quest/QuestSpawn.java | 4 +-
.../model/quest/QuestStateManager.java | 6 +-
.../gameserver/model/quest/QuestTimer.java | 6 +-
.../gameserver/model/scripts/L2RBManager.java | 16 +-
.../gameserver/model/spawn/AutoSpawn.java | 10 +-
.../gameserver/model/spawn/L2Spawn.java | 4 +-
.../model/zone/type/L2DamageZone.java | 4 +-
.../model/zone/type/L2DynamicZone.java | 4 +-
.../model/zone/type/L2EffectZone.java | 4 +-
.../model/zone/type/L2JailZone.java | 4 +-
.../model/zone/type/L2PoisonZone.java | 4 +-
.../gameserver/network/L2GameClient.java | 12 +-
.../network/clientpackets/EnterWorld.java | 4 +-
.../clientpackets/RequestRestartPoint.java | 4 +-
.../clientpackets/RequestWearItem.java | 4 +-
.../script/faenor/FaenorEventParser.java | 4 +-
.../scripting/L2ScriptEngineManager.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 4 +-
.../taskmanager/DecayTaskManager.java | 4 +-
.../gameserver/taskmanager/ExclusiveTask.java | 8 +-
.../KnownListUpdateTaskManager.java | 4 +-
.../gameserver/taskmanager/TaskManager.java | 10 +-
.../thread/daemons/ItemsAutoDestroy.java | 4 +-
.../gameserver/updaters/CastleUpdater.java | 4 +-
.../com/l2jmobius/gameserver/util/Util.java | 4 +-
.../l2jmobius/status/GameStatusThread.java | 10 +-
.../java/com/l2jmobius/status/Status.java | 6 +-
.../data/scripts/ai/fantasy_isle/Parade.java | 10 +-
.../scripts/ai/group_template/DenOfEvil.java | 8 +-
.../ai/group_template/RandomSpawn.java | 4 +-
.../data/scripts/ai/individual/QueenAnt.java | 4 +-
.../ai/npc/ForgeOfTheGods/TarBeetleSpawn.java | 6 +-
.../ai/npc/NpcBuffers/NpcBufferAI.java | 4 +-
.../scripts/ai/npc/NpcBuffers/NpcBuffers.java | 4 +-
.../ai/npc/NpcBuffers/impl/CabaleBuffer.java | 10 +-
.../FortressOfTheDead/FortressOfTheDead.java | 4 +-
.../RainbowSpringsChateau.java | 20 +-
.../conquerablehalls/flagwar/FlagWar.java | 8 +-
.../scripts/custom/events/Elpies/Elpies.java | 4 +-
.../data/scripts/custom/events/Race/Race.java | 6 +-
.../data/scripts/gracia/AI/EnergySeeds.java | 4 +-
.../HallOfErosionAttack.java | 6 +-
.../HallOfErosionDefence.java | 10 +-
.../HeartInfinityAttack.java | 14 +-
.../HeartInfinityDefence.java | 16 +-
.../gracia/vehicles/AirShipController.java | 6 +-
.../AirShipGludioGracia.java | 10 +-
.../admincommandhandlers/AdminEditChar.java | 6 +-
.../AdminMonsterRace.java | 6 +-
.../admincommandhandlers/AdminPForge.java | 4 +-
.../admincommandhandlers/AdminTest.java | 4 +-
.../effecthandlers/ServitorShare.java | 4 +-
.../punishmenthandlers/JailHandler.java | 6 +-
.../handlers/telnethandlers/DebugHandler.java | 4 +-
.../telnethandlers/ThreadHandler.java | 8 +-
.../handlers/usercommandhandlers/Unstuck.java | 4 +-
.../voicedcommandhandlers/AutoPotion.java | 4 +-
.../voicedcommandhandlers/Wedding.java | 4 +-
.../data/scripts/hellbound/AI/Chimeras.java | 4 +-
.../AI/Zones/TowerOfNaia/TowerOfNaia.java | 6 +-
.../AI/Zones/TullyWorkshop/TullyWorkshop.java | 16 +-
.../Instances/UrbanArea/UrbanArea.java | 10 +-
.../instances/ChambersOfDelusion/Chamber.java | 6 +-
.../FinalEmperialTomb/FinalEmperialTomb.java | 102 +++---
.../Q00511_AwlUnderFoot.java | 6 +-
.../Q00726_LightWithinTheDarkness.java | 10 +-
.../Q00727_HopeWithinTheDarkness.java | 16 +-
.../scripts/vehicles/BoatGiranTalking.java | 36 +--
.../data/scripts/vehicles/BoatGludinRune.java | 38 +--
.../scripts/vehicles/BoatInnadrilTour.java | 20 +-
.../scripts/vehicles/BoatRunePrimeval.java | 8 +-
.../scripts/vehicles/BoatTalkingGludin.java | 34 +-
.../commons/concurrent/ThreadPool.java | 299 ++++++++++++++++++
.../com/l2jmobius/gameserver/GameServer.java | 3 +-
.../gameserver/GameTimeController.java | 5 +-
.../gameserver/ItemsAutoDestroy.java | 3 +-
.../gameserver/RecipeController.java | 11 +-
.../com/l2jmobius/gameserver/SevenSigns.java | 5 +-
.../gameserver/SevenSignsFestival.java | 3 +-
.../com/l2jmobius/gameserver/Shutdown.java | 3 +-
.../gameserver/ThreadPoolManager.java | 299 ------------------
.../l2jmobius/gameserver/ai/AbstractAI.java | 6 +-
.../gameserver/ai/L2AttackableAI.java | 6 +-
.../gameserver/ai/L2CharacterAI.java | 4 +-
.../com/l2jmobius/gameserver/ai/L2DoorAI.java | 4 +-
.../gameserver/ai/L2FortSiegeGuardAI.java | 4 +-
.../gameserver/ai/L2SiegeGuardAI.java | 4 +-
.../l2jmobius/gameserver/ai/L2SummonAI.java | 4 +-
.../cache/WarehouseCacheManager.java | 4 +-
.../gameserver/data/sql/impl/ClanTable.java | 4 +-
.../gameserver/datatables/BotReportTable.java | 6 +-
.../gameserver/datatables/ItemTable.java | 6 +-
.../gameserver/idfactory/BitSetIDFactory.java | 4 +-
.../instancemanager/CastleManorManager.java | 6 +-
.../FishingChampionshipManager.java | 8 +-
.../FourSepulchersManager.java | 10 +-
.../instancemanager/GrandBossManager.java | 4 +-
.../HandysBlockCheckerManager.java | 6 +-
.../instancemanager/ItemsOnGroundManager.java | 4 +-
.../instancemanager/MailManager.java | 8 +-
.../instancemanager/PremiumManager.java | 4 +-
.../instancemanager/RaidBossSpawnManager.java | 6 +-
.../instancemanager/ServerRestartManager.java | 4 +-
.../instancemanager/SoDManager.java | 4 +-
.../instancemanager/SoIManager.java | 4 +-
.../instancemanager/TerritoryWarManager.java | 34 +-
.../instancemanager/WalkingManager.java | 8 +-
.../instancemanager/games/Lottery.java | 12 +-
.../FourSepulchersChangeAttackTimeTask.java | 8 +-
.../FourSepulchersChangeCoolDownTimeTask.java | 4 +-
.../FourSepulchersChangeEntryTimeTask.java | 6 +-
.../FourSepulchersChangeWarmUpTimeTask.java | 4 +-
.../tasks/FourSepulchersManagerSayTask.java | 4 +-
.../gameserver/model/AutoSpawnHandler.java | 8 +-
.../gameserver/model/CharEffectList.java | 4 +-
.../gameserver/model/CursedWeapon.java | 8 +-
.../gameserver/model/DropProtection.java | 4 +-
.../l2jmobius/gameserver/model/L2Party.java | 6 +-
.../l2jmobius/gameserver/model/L2Request.java | 4 +-
.../l2jmobius/gameserver/model/L2Spawn.java | 4 +-
.../gameserver/model/L2WorldRegion.java | 6 +-
.../gameserver/model/actor/L2Attackable.java | 4 +-
.../gameserver/model/actor/L2Character.java | 40 +--
.../gameserver/model/actor/L2Npc.java | 6 +-
.../gameserver/model/actor/L2Vehicle.java | 4 +-
.../actor/instance/L2BabyPetInstance.java | 4 +-
.../L2ControllableAirShipInstance.java | 8 +-
.../model/actor/instance/L2CubicInstance.java | 8 +-
.../model/actor/instance/L2DecoyInstance.java | 6 +-
.../model/actor/instance/L2DoorInstance.java | 8 +-
.../instance/L2FortCommanderInstance.java | 4 +-
.../model/actor/instance/L2PcInstance.java | 40 +--
.../model/actor/instance/L2PetInstance.java | 4 +-
.../actor/instance/L2RaceManagerInstance.java | 46 +--
.../actor/instance/L2RaidBossInstance.java | 4 +-
.../instance/L2SepulcherMonsterInstance.java | 18 +-
.../instance/L2SepulcherNpcInstance.java | 8 +-
.../actor/instance/L2ServitorInstance.java | 4 +-
.../actor/instance/L2SiegeFlagInstance.java | 4 +-
.../actor/instance/L2TamedBeastInstance.java | 10 +-
.../model/actor/instance/L2TrapInstance.java | 6 +-
.../model/actor/knownlist/NpcKnownList.java | 4 +-
.../model/actor/status/CharStatus.java | 4 +-
.../tasks/attackable/CommandChannelTimer.java | 4 +-
.../actor/tasks/npc/trap/TrapTriggerTask.java | 4 +-
.../model/announce/AutoAnnouncement.java | 6 +-
.../gameserver/model/buylist/Product.java | 6 +-
.../gameserver/model/entity/Auction.java | 6 +-
.../model/entity/BlockCheckerEngine.java | 14 +-
.../gameserver/model/entity/Castle.java | 8 +-
.../gameserver/model/entity/ClanHall.java | 8 +-
.../model/entity/DimensionalRift.java | 4 +-
.../gameserver/model/entity/Duel.java | 14 +-
.../gameserver/model/entity/Fort.java | 20 +-
.../gameserver/model/entity/FortSiege.java | 44 +--
.../gameserver/model/entity/Instance.java | 12 +-
.../gameserver/model/entity/Message.java | 8 +-
.../gameserver/model/entity/NevitSystem.java | 6 +-
.../gameserver/model/entity/Siege.java | 32 +-
.../model/entity/TvTEventTeleporter.java | 4 +-
.../gameserver/model/entity/TvTManager.java | 12 +-
.../entity/clanhall/AuctionableHall.java | 20 +-
.../entity/clanhall/ClanHallSiegeEngine.java | 14 +-
.../gameserver/model/event/LongTimeEvent.java | 6 +-
.../model/events/EventDispatcher.java | 6 +-
.../gameserver/model/fishing/L2Fishing.java | 4 +-
.../model/itemauction/ItemAuction.java | 4 +-
.../itemauction/ItemAuctionInstance.java | 16 +-
.../model/items/instance/L2ItemInstance.java | 8 +-
.../gameserver/model/olympiad/Olympiad.java | 22 +-
.../model/olympiad/OlympiadGameTask.java | 8 +-
.../model/olympiad/OlympiadManager.java | 6 +-
.../model/punishment/PunishmentTask.java | 4 +-
.../gameserver/model/quest/QuestTimer.java | 4 +-
.../gameserver/model/skills/BuffInfo.java | 6 +-
.../model/skills/SkillChannelizer.java | 4 +-
.../model/zone/type/L2DamageZone.java | 4 +-
.../model/zone/type/L2DynamicZone.java | 4 +-
.../model/zone/type/L2EffectZone.java | 4 +-
.../model/zone/type/L2JailZone.java | 4 +-
.../zone/type/L2OlympiadStadiumZone.java | 4 +-
.../type/L2ResidenceHallTeleportZone.java | 4 +-
.../gameserver/network/L2GameClient.java | 14 +-
.../clientpackets/RequestPreviewItem.java | 4 +-
.../clientpackets/RequestRestartPoint.java | 4 +-
.../network/clientpackets/UseItem.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 4 +-
.../taskmanager/DecayTaskManager.java | 4 +-
.../KnownListUpdateTaskManager.java | 4 +-
.../gameserver/taskmanager/TaskManager.java | 10 +-
.../com/l2jmobius/gameserver/util/Evolve.java | 10 +-
.../l2jmobius/gameserver/util/MinionList.java | 4 +-
.../com/l2jmobius/gameserver/util/Util.java | 4 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 4 +-
.../scripts/custom/events/Elpies/Elpies.java | 4 +-
.../data/scripts/custom/events/Race/Race.java | 6 +-
.../admincommandhandlers/AdminTest.java | 4 +-
.../handlers/effecthandlers/ClassChange.java | 4 +-
.../handlers/playeractions/SocialAction.java | 4 +-
.../punishmenthandlers/JailHandler.java | 6 +-
.../handlers/telnethandlers/server/Debug.java | 4 +-
.../telnethandlers/server/Performance.java | 4 +-
.../handlers/telnethandlers/server/Purge.java | 6 +-
.../voicedcommandhandlers/AutoPotion.java | 4 +-
.../commons/concurrent/ThreadPool.java | 299 ++++++++++++++++++
.../com/l2jmobius/gameserver/GameServer.java | 3 +-
.../gameserver/ItemsAutoDestroy.java | 3 +-
.../gameserver/RecipeController.java | 11 +-
.../com/l2jmobius/gameserver/Shutdown.java | 3 +-
.../gameserver/ThreadPoolManager.java | 299 ------------------
.../l2jmobius/gameserver/ai/AbstractAI.java | 4 +-
.../gameserver/ai/L2AttackableAI.java | 4 +-
.../gameserver/ai/L2CharacterAI.java | 4 +-
.../com/l2jmobius/gameserver/ai/L2DoorAI.java | 4 +-
.../l2jmobius/gameserver/ai/L2SummonAI.java | 4 +-
.../cache/WarehouseCacheManager.java | 4 +-
.../gameserver/data/sql/impl/ClanTable.java | 4 +-
.../gameserver/datatables/BotReportTable.java | 6 +-
.../gameserver/datatables/ItemTable.java | 6 +-
.../gameserver/idfactory/BitSetIDFactory.java | 4 +-
.../instancemanager/CastleManorManager.java | 6 +-
.../instancemanager/ClanEntryManager.java | 6 +-
.../instancemanager/CommissionManager.java | 6 +-
.../instancemanager/DBSpawnManager.java | 6 +-
.../FakePlayerChatManager.java | 6 +-
.../instancemanager/GraciaSeedsManager.java | 4 +-
.../instancemanager/GrandBossManager.java | 4 +-
.../HandysBlockCheckerManager.java | 6 +-
.../instancemanager/ItemsOnGroundManager.java | 4 +-
.../instancemanager/MailManager.java | 8 +-
.../instancemanager/PremiumManager.java | 4 +-
.../instancemanager/ServerRestartManager.java | 4 +-
.../instancemanager/WalkingManager.java | 8 +-
.../l2jmobius/gameserver/model/ClanWar.java | 12 +-
.../gameserver/model/CreatureContainer.java | 4 +-
.../gameserver/model/CursedWeapon.java | 8 +-
.../gameserver/model/DropProtection.java | 4 +-
.../l2jmobius/gameserver/model/Fishing.java | 6 +-
.../l2jmobius/gameserver/model/L2Clan.java | 4 +-
.../l2jmobius/gameserver/model/L2Party.java | 6 +-
.../l2jmobius/gameserver/model/L2Request.java | 4 +-
.../l2jmobius/gameserver/model/L2Spawn.java | 4 +-
.../gameserver/model/L2WorldRegion.java | 6 +-
.../gameserver/model/MpRewardTask.java | 4 +-
.../gameserver/model/actor/L2Attackable.java | 4 +-
.../gameserver/model/actor/L2Character.java | 26 +-
.../gameserver/model/actor/L2Npc.java | 4 +-
.../gameserver/model/actor/L2Vehicle.java | 4 +-
.../L2ControllableAirShipInstance.java | 8 +-
.../model/actor/instance/L2DecoyInstance.java | 6 +-
.../model/actor/instance/L2DoorInstance.java | 8 +-
.../instance/L2FortCommanderInstance.java | 4 +-
.../model/actor/instance/L2PcInstance.java | 42 +--
.../model/actor/instance/L2PetInstance.java | 4 +-
.../actor/instance/L2RaidBossInstance.java | 4 +-
.../actor/instance/L2ServitorInstance.java | 4 +-
.../actor/instance/L2SiegeFlagInstance.java | 4 +-
.../actor/instance/L2TamedBeastInstance.java | 10 +-
.../model/actor/instance/L2TrapInstance.java | 6 +-
.../model/actor/request/AbstractRequest.java | 4 +-
.../model/actor/status/CharStatus.java | 4 +-
.../tasks/attackable/CommandChannelTimer.java | 4 +-
.../actor/tasks/npc/RandomAnimationTask.java | 4 +-
.../actor/tasks/npc/trap/TrapTriggerTask.java | 4 +-
.../actor/tasks/player/FlyMoveStartTask.java | 4 +-
.../model/announce/AutoAnnouncement.java | 6 +-
.../gameserver/model/buylist/Product.java | 6 +-
.../gameserver/model/cubic/CubicInstance.java | 6 +-
.../model/entity/BlockCheckerEngine.java | 14 +-
.../gameserver/model/entity/Castle.java | 8 +-
.../gameserver/model/entity/ClanHall.java | 8 +-
.../gameserver/model/entity/Duel.java | 14 +-
.../gameserver/model/entity/Fort.java | 20 +-
.../gameserver/model/entity/FortSiege.java | 44 +--
.../gameserver/model/entity/Siege.java | 32 +-
.../model/eventengine/EventScheduler.java | 8 +-
.../model/events/EventDispatcher.java | 6 +-
.../model/events/timers/TimerHolder.java | 4 +-
.../model/instancezone/Instance.java | 14 +-
.../model/itemauction/ItemAuction.java | 4 +-
.../itemauction/ItemAuctionInstance.java | 16 +-
.../model/items/instance/L2ItemInstance.java | 12 +-
.../gameserver/model/olympiad/Olympiad.java | 22 +-
.../model/olympiad/OlympiadGameTask.java | 8 +-
.../model/punishment/PunishmentTask.java | 4 +-
.../gameserver/model/quest/LongTimeEvent.java | 6 +-
.../gameserver/model/quest/QuestTimer.java | 4 +-
.../model/residences/ResidenceFunction.java | 4 +-
.../model/shuttle/L2ShuttleEngine.java | 10 +-
.../gameserver/model/skills/BuffInfo.java | 8 +-
.../gameserver/model/skills/SkillCaster.java | 6 +-
.../model/skills/SkillChannelizer.java | 4 +-
.../model/votereward/VoteSystem.java | 4 +-
.../model/zone/type/L2DamageZone.java | 4 +-
.../model/zone/type/L2EffectZone.java | 4 +-
.../model/zone/type/L2FishingZone.java | 6 +-
.../model/zone/type/L2JailZone.java | 4 +-
.../zone/type/L2OlympiadStadiumZone.java | 4 +-
.../type/L2ResidenceHallTeleportZone.java | 4 +-
.../model/zone/type/L2SayuneZone.java | 4 +-
.../gameserver/network/Disconnection.java | 4 +-
.../network/clientpackets/EnterWorld.java | 6 +-
.../clientpackets/RequestDuelStart.java | 4 +-
.../clientpackets/RequestJoinParty.java | 4 +-
.../clientpackets/RequestJoinPledge.java | 4 +-
.../clientpackets/RequestPreviewItem.java | 4 +-
.../clientpackets/RequestRestartPoint.java | 4 +-
.../network/clientpackets/TradeRequest.java | 4 +-
.../network/clientpackets/UseItem.java | 4 +-
.../friend/RequestFriendInvite.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 4 +-
.../taskmanager/DecayTaskManager.java | 4 +-
.../gameserver/taskmanager/TaskManager.java | 10 +-
.../com/l2jmobius/gameserver/util/Evolve.java | 10 +-
.../l2jmobius/gameserver/util/MinionList.java | 4 +-
.../com/l2jmobius/gameserver/util/Util.java | 4 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 4 +-
.../scripts/custom/events/Elpies/Elpies.java | 4 +-
.../data/scripts/custom/events/Race/Race.java | 6 +-
.../admincommandhandlers/AdminTest.java | 4 +-
.../handlers/effecthandlers/ClassChange.java | 4 +-
.../handlers/playeractions/SocialAction.java | 4 +-
.../punishmenthandlers/JailHandler.java | 6 +-
.../handlers/telnethandlers/server/Debug.java | 4 +-
.../telnethandlers/server/Performance.java | 4 +-
.../handlers/telnethandlers/server/Purge.java | 6 +-
.../voicedcommandhandlers/AutoPotion.java | 4 +-
.../commons/concurrent/ThreadPool.java | 299 ++++++++++++++++++
.../com/l2jmobius/gameserver/GameServer.java | 3 +-
.../gameserver/ItemsAutoDestroy.java | 3 +-
.../gameserver/RecipeController.java | 11 +-
.../com/l2jmobius/gameserver/Shutdown.java | 3 +-
.../gameserver/ThreadPoolManager.java | 299 ------------------
.../l2jmobius/gameserver/ai/AbstractAI.java | 4 +-
.../gameserver/ai/L2AttackableAI.java | 4 +-
.../gameserver/ai/L2CharacterAI.java | 4 +-
.../com/l2jmobius/gameserver/ai/L2DoorAI.java | 4 +-
.../l2jmobius/gameserver/ai/L2SummonAI.java | 4 +-
.../cache/WarehouseCacheManager.java | 4 +-
.../gameserver/data/sql/impl/ClanTable.java | 4 +-
.../gameserver/datatables/BotReportTable.java | 6 +-
.../gameserver/datatables/ItemTable.java | 6 +-
.../gameserver/idfactory/BitSetIDFactory.java | 4 +-
.../instancemanager/CastleManorManager.java | 6 +-
.../instancemanager/ClanEntryManager.java | 6 +-
.../instancemanager/CommissionManager.java | 6 +-
.../instancemanager/DBSpawnManager.java | 6 +-
.../FakePlayerChatManager.java | 6 +-
.../instancemanager/GraciaSeedsManager.java | 4 +-
.../instancemanager/GrandBossManager.java | 4 +-
.../HandysBlockCheckerManager.java | 6 +-
.../instancemanager/ItemsOnGroundManager.java | 4 +-
.../instancemanager/MailManager.java | 8 +-
.../instancemanager/PremiumManager.java | 4 +-
.../instancemanager/ServerRestartManager.java | 4 +-
.../instancemanager/WalkingManager.java | 8 +-
.../l2jmobius/gameserver/model/ClanWar.java | 12 +-
.../gameserver/model/CreatureContainer.java | 4 +-
.../gameserver/model/CursedWeapon.java | 8 +-
.../gameserver/model/DropProtection.java | 4 +-
.../l2jmobius/gameserver/model/Fishing.java | 6 +-
.../l2jmobius/gameserver/model/L2Clan.java | 4 +-
.../l2jmobius/gameserver/model/L2Party.java | 6 +-
.../l2jmobius/gameserver/model/L2Request.java | 4 +-
.../l2jmobius/gameserver/model/L2Spawn.java | 4 +-
.../gameserver/model/L2WorldRegion.java | 6 +-
.../gameserver/model/MpRewardTask.java | 4 +-
.../gameserver/model/actor/L2Attackable.java | 4 +-
.../gameserver/model/actor/L2Character.java | 26 +-
.../gameserver/model/actor/L2Npc.java | 4 +-
.../gameserver/model/actor/L2Vehicle.java | 4 +-
.../L2ControllableAirShipInstance.java | 8 +-
.../model/actor/instance/L2DecoyInstance.java | 6 +-
.../model/actor/instance/L2DoorInstance.java | 8 +-
.../instance/L2FortCommanderInstance.java | 4 +-
.../model/actor/instance/L2PcInstance.java | 42 +--
.../model/actor/instance/L2PetInstance.java | 4 +-
.../actor/instance/L2RaidBossInstance.java | 4 +-
.../actor/instance/L2ServitorInstance.java | 4 +-
.../actor/instance/L2SiegeFlagInstance.java | 4 +-
.../actor/instance/L2TamedBeastInstance.java | 10 +-
.../model/actor/instance/L2TrapInstance.java | 6 +-
.../model/actor/request/AbstractRequest.java | 4 +-
.../model/actor/status/CharStatus.java | 4 +-
.../tasks/attackable/CommandChannelTimer.java | 4 +-
.../actor/tasks/npc/RandomAnimationTask.java | 4 +-
.../actor/tasks/npc/trap/TrapTriggerTask.java | 4 +-
.../actor/tasks/player/FlyMoveStartTask.java | 4 +-
.../model/announce/AutoAnnouncement.java | 6 +-
.../gameserver/model/buylist/Product.java | 6 +-
.../gameserver/model/cubic/CubicInstance.java | 6 +-
.../model/entity/BlockCheckerEngine.java | 14 +-
.../gameserver/model/entity/Castle.java | 8 +-
.../gameserver/model/entity/ClanHall.java | 8 +-
.../gameserver/model/entity/Duel.java | 14 +-
.../gameserver/model/entity/Fort.java | 20 +-
.../gameserver/model/entity/FortSiege.java | 44 +--
.../gameserver/model/entity/Siege.java | 32 +-
.../model/eventengine/EventScheduler.java | 8 +-
.../model/events/EventDispatcher.java | 6 +-
.../model/events/timers/TimerHolder.java | 4 +-
.../model/instancezone/Instance.java | 14 +-
.../model/itemauction/ItemAuction.java | 4 +-
.../itemauction/ItemAuctionInstance.java | 16 +-
.../model/items/instance/L2ItemInstance.java | 12 +-
.../gameserver/model/olympiad/Olympiad.java | 22 +-
.../model/olympiad/OlympiadGameTask.java | 8 +-
.../model/punishment/PunishmentTask.java | 4 +-
.../gameserver/model/quest/LongTimeEvent.java | 6 +-
.../gameserver/model/quest/QuestTimer.java | 4 +-
.../model/residences/ResidenceFunction.java | 4 +-
.../model/shuttle/L2ShuttleEngine.java | 10 +-
.../gameserver/model/skills/BuffInfo.java | 8 +-
.../gameserver/model/skills/SkillCaster.java | 6 +-
.../model/skills/SkillChannelizer.java | 4 +-
.../model/votereward/VoteSystem.java | 4 +-
.../model/zone/type/L2DamageZone.java | 4 +-
.../model/zone/type/L2EffectZone.java | 4 +-
.../model/zone/type/L2FishingZone.java | 6 +-
.../model/zone/type/L2JailZone.java | 4 +-
.../zone/type/L2OlympiadStadiumZone.java | 4 +-
.../type/L2ResidenceHallTeleportZone.java | 4 +-
.../model/zone/type/L2SayuneZone.java | 4 +-
.../gameserver/network/Disconnection.java | 4 +-
.../network/clientpackets/EnterWorld.java | 6 +-
.../clientpackets/RequestDuelStart.java | 4 +-
.../clientpackets/RequestJoinParty.java | 4 +-
.../clientpackets/RequestJoinPledge.java | 4 +-
.../clientpackets/RequestPreviewItem.java | 4 +-
.../clientpackets/RequestRestartPoint.java | 4 +-
.../network/clientpackets/TradeRequest.java | 4 +-
.../network/clientpackets/UseItem.java | 4 +-
.../friend/RequestFriendInvite.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 4 +-
.../taskmanager/DecayTaskManager.java | 4 +-
.../gameserver/taskmanager/TaskManager.java | 10 +-
.../com/l2jmobius/gameserver/util/Evolve.java | 10 +-
.../l2jmobius/gameserver/util/MinionList.java | 4 +-
.../com/l2jmobius/gameserver/util/Util.java | 4 +-
1127 files changed, 5204 insertions(+), 5174 deletions(-)
rename L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/{gameserver/ThreadPoolManager.java => commons/concurrent/ThreadPool.java} (98%)
rename L2J_Mobius_2.5_Underground/java/com/l2jmobius/{gameserver/ThreadPoolManager.java => commons/concurrent/ThreadPool.java} (98%)
rename L2J_Mobius_3.0_Helios/java/com/l2jmobius/{gameserver/ThreadPoolManager.java => commons/concurrent/ThreadPool.java} (98%)
rename L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/{gameserver/ThreadPoolManager.java => commons/concurrent/ThreadPool.java} (98%)
rename L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/concurrent/{ThreadPoolManager.java => ThreadPool.java} (99%)
create mode 100644 L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/commons/concurrent/ThreadPool.java
delete mode 100644 L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ThreadPoolManager.java
create mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/concurrent/ThreadPool.java
delete mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ThreadPoolManager.java
create mode 100644 L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/commons/concurrent/ThreadPool.java
delete mode 100644 L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ThreadPoolManager.java
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
index 3619de52a6..b21c9b9df7 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
@@ -16,8 +16,8 @@
*/
package ai.areas.DenOfDevil;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
@@ -127,7 +127,7 @@ public final class DenOfEvil extends AbstractNpcAI
zone.addSkill(skillId, skillLevel + 1);
if (skillLevel == 3) // 3+1=4
{
- ThreadPoolManager.schedule(new KashaDestruction(zone), 2 * 60 * 1000l);
+ ThreadPool.schedule(new KashaDestruction(zone), 2 * 60 * 1000l);
zone.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.DEFEAT_KASHA_S_EYES_TO_LIFT_THE_GREAT_CURSE));
}
else if (skillLevel == 2)
@@ -140,7 +140,7 @@ public final class DenOfEvil extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
- ThreadPoolManager.schedule(new RespawnNewEye(npc.getLocation()), 15000);
+ ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
if (zone == null)
{
@@ -213,7 +213,7 @@ public final class DenOfEvil extends AbstractNpcAI
final L2Npc npc = (L2Npc) character;
if (CommonUtil.contains(EYE_IDS, npc.getId()))
{
- ThreadPoolManager.schedule(new RespawnNewEye(npc.getLocation()), 15000);
+ ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
index 21f7d8c4cb..23514e5981 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
@@ -20,8 +20,8 @@ import java.text.SimpleDateFormat;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
+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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -129,7 +129,7 @@ public final class Parade extends AbstractNpcAI
{
// Starts at 8:00 and repeats every 6 hours.
final long diff = timeLeftMilli(8, 0, 0), cycle = 3600000L;
- ThreadPoolManager.scheduleAtFixedRate(new Start(), diff, cycle);
+ ThreadPool.scheduleAtFixedRate(new Start(), diff, cycle);
// Test - Starts 3 minutes after server startup and repeats every 20 minutes.
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000L;
@@ -167,9 +167,9 @@ public final class Parade extends AbstractNpcAI
public void run()
{
load();
- spawnTask = ThreadPoolManager.scheduleAtFixedRate(new Spawn(), 0, 5000);
- deleteTask = ThreadPoolManager.scheduleAtFixedRate(new Delete(), 10000, 1000);
- cleanTask = ThreadPoolManager.schedule(new Clean(), 420000);
+ spawnTask = ThreadPool.scheduleAtFixedRate(new Spawn(), 0, 5000);
+ deleteTask = ThreadPool.scheduleAtFixedRate(new Delete(), 10000, 1000);
+ cleanTask = ThreadPool.schedule(new Clean(), 420000);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
index 954afd0819..e67e5ea74d 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
@@ -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.enums.ChatType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -256,7 +256,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
if ((doorInfo[0] == sepulcherId) && (doorInfo[1] == currentWave))
{
openDoor(doorInfo[2], 0);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
closeDoor(doorInfo[2], 0);
}, 15000);
@@ -578,7 +578,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
showHtmlFile(player, npcId + "-OK.html", npc, null);
// Kick all players when/if time is over
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers();
}, TIME_ATTACK * 60 * 1000);
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
index b1a37e194f..627cf622d0 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
@@ -16,7 +16,7 @@
*/
package ai.areas.Rune.AltarOfSacrifice;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -109,7 +109,7 @@ public class AltarOfSacrifice extends AbstractNpcAI
private void sendMessage(L2Npc npc, NpcStringId npcString, int delay)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (npc != null)
{
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
index 1a41e95122..e795fad37e 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
@@ -20,7 +20,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.enums.CategoryType;
@@ -340,7 +340,7 @@ public final class AwakeningMaster extends AbstractNpcAI
player.sendSkillList();
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
player.sendPacket(ExShowUsm.AWAKENING_END);
}, 10000);
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
index 58750ad197..569eff3cfe 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
@@ -22,7 +22,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -174,7 +174,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic")), null));
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
currentInfo.setZoneStage(7);
- ThreadPoolManager.schedule(new changeZoneStage(zone), 600000); // 10min
+ ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min
}
else
{
@@ -202,7 +202,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (currentInfo.getZoneStage() < 6)
{
currentInfo.setZoneStage(currentInfo.getZoneStage() + 1);
- ThreadPoolManager.schedule(new changeZoneStage(zone), 5000);
+ ThreadPool.schedule(new changeZoneStage(zone), 5000);
}
}
catch (Exception e)
@@ -248,7 +248,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (calcPoints >= 300)
{
calcPoints = 300;
- ThreadPoolManager.schedule(new changeZoneStage(currentZone.getKey()), 1000);
+ ThreadPool.schedule(new changeZoneStage(currentZone.getKey()), 1000);
}
currentInfo.setCurrentPoint(calcPoints);
for (L2PcInstance player : currentZone.getKey().getPlayersInside())
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
index 7e11d3b4d1..33344e3f16 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
@@ -21,8 +21,8 @@ import java.util.List;
import java.util.concurrent.ScheduledFuture;
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.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.ChatType;
@@ -303,7 +303,7 @@ public class Lindvior extends AbstractNpcAI
}
else if ((percent <= 75) && (_status == 1))
{
- _bigVortexesTask = ThreadPoolManager.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
+ _bigVortexesTask = ThreadPool.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
addSpawn(LINDVIOR_SERVITOR[1], loc, true);
@@ -324,7 +324,7 @@ public class Lindvior extends AbstractNpcAI
{
addSpawn(LINDVIOR_SERVITOR[2], loc, true);
}
- _skillCastTask = ThreadPoolManager.scheduleAtFixedRate(() -> _lindvior.doCast(SKILL_REFLECT.getSkill()), 5000, 80000);
+ _skillCastTask = ThreadPool.scheduleAtFixedRate(() -> _lindvior.doCast(SKILL_REFLECT.getSkill()), 5000, 80000);
_status = 3;
}
else if ((percent <= 40) && (_status == 3))
@@ -348,7 +348,7 @@ public class Lindvior extends AbstractNpcAI
}
else if ((percent <= 35) && (_status == 4))
{
- _smallVortexesTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _smallVortexesTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
@@ -372,14 +372,14 @@ public class Lindvior extends AbstractNpcAI
_lindvior.deleteMe();
_lindvior = (L2GrandBossInstance) addSpawn(LINDVIOR_RAID, _lindvior.getLocation(), false, 0, false);
_lindvior.setCurrentHp(_lindvior.getMaxHp() * 0.2);
- _bigVortexesTask = ThreadPoolManager.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
+ _bigVortexesTask = ThreadPool.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
addSpawn(NPC_ATTACKER_SMALL_VORTEX, loc, true);
addSpawn(LINDVIOR_SERVITOR[4], loc, true);
addSpawn(LINDVIOR_SERVITOR[3], loc, true);
}
- _collapseTask = ThreadPoolManager.schedule(Lindvior.this::Clean, 600000);
+ _collapseTask = ThreadPool.schedule(Lindvior.this::Clean, 600000);
_status = 6;
}
return super.onAttack(npc, attacker, damage, isSummon);
@@ -580,7 +580,7 @@ public class Lindvior extends AbstractNpcAI
_guardSpawn.add(npc);
}
- _mobsSpawnTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : ATTACKER_GENERATOR_SPAWNS)
{
@@ -596,7 +596,7 @@ public class Lindvior extends AbstractNpcAI
}, 30000, 80000);
_dummyLindvior = addSpawn(LINDVIOR_CAMERA, 45259, -27115, -638, 41325, false, 0, false);
- _announceTask = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_MUST_ACTIVATE_THE_4_GENERATORS, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 20000);
+ _announceTask = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_MUST_ACTIVATE_THE_4_GENERATORS, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 20000);
break;
}
case 2: // After activation of 4 generators, we wait to be charged
@@ -621,7 +621,7 @@ public class Lindvior extends AbstractNpcAI
{
guard.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ALL_4_GENERATORS_MUST_BE_ACTIVATED);
});
- _announceProtect = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> player.sendPacket(new ExShowScreenMessage(NpcStringId.PROTECT_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 18000);
+ _announceProtect = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> player.sendPacket(new ExShowScreenMessage(NpcStringId.PROTECT_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 18000);
_zoneLair.broadcastPacket(new SpecialCamera(_dummyLindvior, 3300, 200, 20, 11000, 10500, 0, 8, 1, 0, 0));
_generatorSpawn.forEach(npc -> npc.sendInfo(player));
startQuestTimer("show_movie", 13000, null, null);
@@ -696,7 +696,7 @@ public class Lindvior extends AbstractNpcAI
_zoneLair.broadcastPacket(new SocialAction(_lindvior.getObjectId(), 1));
_zoneLair.getPlayersInside().forEach(_lindvior::sendInfo);
_zoneLair.broadcastPacket(new ExShowScreenMessage(NpcStringId.LINDVIOR_HAS_FALLEN_FROM_THE_SKY, ExShowScreenMessage.TOP_CENTER, 7000));
- _mobsSpawnTask = ThreadPoolManager.scheduleAtFixedRate(() -> spawnServitor(2, 1000, _lindvior.getLocation(), LINDVIOR_SERVITOR), 60000, 180000);
+ _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(() -> spawnServitor(2, 1000, _lindvior.getLocation(), LINDVIOR_SERVITOR), 60000, 180000);
break;
}
}
@@ -749,12 +749,12 @@ public class Lindvior extends AbstractNpcAI
_dummyLindvior.deleteMe();
_lindvior2 = addSpawn(LINDVIOR_FAKE, CENTER_LOCATION, false, 0, false);
_lindvior2.setTargetable(false);
- _announceTask = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> p.sendPacket(new ExShowScreenMessage(NpcStringId.CHARGE_THE_CANNON_USING_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 40000, 20000);
+ _announceTask = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> p.sendPacket(new ExShowScreenMessage(NpcStringId.CHARGE_THE_CANNON_USING_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 40000, 20000);
break;
}
case "start_charge":
{
- _skillCastTask = ThreadPoolManager.scheduleAtFixedRate(() -> _generatorSpawn.forEach(generators ->
+ _skillCastTask = ThreadPool.scheduleAtFixedRate(() -> _generatorSpawn.forEach(generators ->
{
int index = generators.getScriptValue();
if (!generators.isCastingNow() && (generators.getEffectList().getBuffInfoBySkillId(SKILL_RECHARGE_POSIBLE.getSkillId()) == null) && !hasFlag(_chargedMask, 1 << index))
@@ -780,7 +780,7 @@ public class Lindvior extends AbstractNpcAI
});
}
}), 10000, 20000);
- _LynDracoTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _LynDracoTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : LYN_DRACO_SPAWNS)
{
@@ -830,7 +830,7 @@ public class Lindvior extends AbstractNpcAI
_mobsSpawnTask = null;
}
_zoneLair.getCharactersInside().stream().filter(L2Character::isNpc).forEach(mob -> mob.deleteMe());
- ThreadPoolManager.schedule(() -> npc.decayMe(), 10000);
+ ThreadPool.schedule(() -> npc.decayMe(), 10000);
_zoneLair.broadcastPacket(new OnEventTrigger(SECOND_STAGE_EVENT_TRIGGER, false));
_zoneLair.broadcastPacket(new OnEventTrigger(FIRST_STAGE_EVENT_TRIGGER, true));
_lionel.deleteMe();
@@ -846,7 +846,7 @@ public class Lindvior extends AbstractNpcAI
{
_zoneLair.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_GENERATOR_HAS_BEEN_DESTROYED, ExShowScreenMessage.TOP_CENTER, 5000, true));
Clean();
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(false), 20000);
+ _collapseTask = ThreadPool.schedule(() -> Fail(false), 20000);
}
return super.onKill(npc, killer, isSummon);
}
@@ -882,7 +882,7 @@ public class Lindvior extends AbstractNpcAI
{
if (zone.getPlayersInside().isEmpty())
{
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(true), 900000);
+ _collapseTask = ThreadPool.schedule(() -> Fail(true), 900000);
}
}
return super.onExitZone(character, zone);
@@ -940,7 +940,7 @@ public class Lindvior extends AbstractNpcAI
{
if (_socialTask == null)
{
- _socialTask = ThreadPoolManager.schedule(() -> nextStage(1), 3000);
+ _socialTask = ThreadPool.schedule(() -> nextStage(1), 3000);
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index 6c0a28cefe..d66ecbb53e 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -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;
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
index 6e8a0db865..9e42c69098 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
@@ -20,8 +20,8 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicInteger;
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.DoorData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.Movie;
@@ -429,7 +429,7 @@ public class Trasken extends AbstractNpcAI
doom.setTarget(doom);
doom.isCastingNow();
doom.doCast(SKILL_1.getSkill());
- ThreadPoolManager.schedule(() -> doom.deleteMe(), 15000);
+ ThreadPool.schedule(() -> doom.deleteMe(), 15000);
}
final double percent = ((npc.getCurrentHp() - damage) / npc.getMaxHp()) * 100.0;
if ((percent <= 30) && (_statusZone == 4))
@@ -616,7 +616,7 @@ public class Trasken extends AbstractNpcAI
_zoneLair.getCharactersInside().stream().filter(L2Object::isMonster).forEach(cha -> ((L2MonsterInstance) cha).getSpawn().stopRespawn());
_zoneLair2.getCharactersInside().stream().filter(L2Character::isNpc).forEach(mob -> mob.deleteMe());
_zoneLair2.getCharactersInside().stream().filter(L2Object::isMonster).forEach(cha -> ((L2MonsterInstance) cha).getSpawn().stopRespawn());
- ThreadPoolManager.schedule(() -> npc.decayMe(), 10000);
+ ThreadPool.schedule(() -> npc.decayMe(), 10000);
cancelQuestTimer("finish", npc, null);
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
@@ -642,7 +642,7 @@ public class Trasken extends AbstractNpcAI
final int[] spawn = Rnd_Spawn_Tail[Rnd.get(Rnd_Spawn_Tail.length)];
if (SpawnTable.getInstance().getSpawns(TAIL_TRASKEN) == null)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
tie_trasken = addSpawn(TAIL_TRASKEN, spawn[0], spawn[1], spawn[2], 0, false, 0, true);
tie_trasken.setCurrentHp(hp_tail);
@@ -663,7 +663,7 @@ public class Trasken extends AbstractNpcAI
final int[] spawn1 = Rnd_Spawn_Trasken[Rnd.get(Rnd_Spawn_Trasken.length)];
if (SpawnTable.getInstance().getSpawns(TRASKEN) == null)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
trasken = addSpawn(TRASKEN, spawn1[0], spawn1[1], spawn1[2], 0, false, 0, true);
trasken.doCast(SKILL_TRASKEN_UP.getSkill());
@@ -774,7 +774,7 @@ public class Trasken extends AbstractNpcAI
}
final int time = 540000;
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 540, 0, NpcStringId.REMAINING_TIME)));
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(true), time);
+ _collapseTask = ThreadPool.schedule(() -> Fail(true), time);
}
return super.onEnterZone(character, zone);
}
@@ -784,7 +784,7 @@ public class Trasken extends AbstractNpcAI
{
if ((zone.getId() == ZONE_ID_HEART) && zone.getPlayersInside().isEmpty())
{
- _collapseTask = ThreadPoolManager.schedule(() ->
+ _collapseTask = ThreadPool.schedule(() ->
{
Fail(true);
for (int info : eventTriggers)
@@ -890,7 +890,7 @@ public class Trasken extends AbstractNpcAI
character.getEffectList().stopSkillEffects(true, traskenBuff.getSkill());
}
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
character.broadcastPacket(new ExShowScreenMessage(NpcStringId.YOU_VE_EXCEEDED_THE_MAXIMUM_NUMBER_OF_PERSONNEL, 5, 24000, true));
character.doCast(SKILL_TRASKEN_SLEEP.getSkill());
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/EnergySeeds.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/EnergySeeds.java
index 546f3b3cc0..30db4dff20 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/EnergySeeds.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/EnergySeeds.java
@@ -20,8 +20,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
@@ -721,7 +721,7 @@ public final class EnergySeeds extends AbstractNpcAI
public void scheduleRespawn(long waitTime)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// if the AI is inactive, do not spawn the NPC
if (isSeedActive(_seedId))
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
index 9cef571b2a..819ba28b77 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
@@ -18,7 +18,7 @@ package ai.others.NpcBuffers;
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.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -90,6 +90,6 @@ public class NpcBufferAI implements Runnable
_npc.doCast(skill);
- ThreadPoolManager.schedule(this, skill.getReuseDelay());
+ ThreadPool.schedule(this, skill.getReuseDelay());
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
index faf003a11c..a8f7bcc23f 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
@@ -16,7 +16,7 @@
*/
package ai.others.NpcBuffers;
-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;
@@ -53,7 +53,7 @@ public final class NpcBuffers extends AbstractNpcAI
final NpcBufferData data = _npcBuffers.getNpcBuffer(npc.getId());
for (NpcBufferSkillData skill : data.getSkills())
{
- ThreadPoolManager.schedule(new NpcBufferAI(npc, skill), skill.getInitialDelay());
+ ThreadPool.schedule(new NpcBufferAI(npc, skill), skill.getInitialDelay());
}
return super.onSpawn(npc);
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/events/Elpies/Elpies.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/events/Elpies/Elpies.java
index 604b5bcff8..4ca3d1df97 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/events/Elpies/Elpies.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/events/Elpies/Elpies.java
@@ -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();
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/events/Race/Race.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/events/Race/Race.java
index 8af01c7b29..19f2f42bae 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/events/Race/Race.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/events/Race/Race.java
@@ -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
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
index b986361b8c..51fee14634 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
@@ -16,8 +16,8 @@
*/
package handlers.admincommandhandlers;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.MonsterRace;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -107,7 +107,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunRace(codes, activeChar), 5000);
+ ThreadPool.schedule(new RunRace(codes, activeChar), 5000);
}
}
@@ -137,7 +137,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
final MonRaceInfo spk = new MonRaceInfo(codes[2][0], codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunEnd(activeChar), 30000);
+ ThreadPool.schedule(new RunEnd(activeChar), 30000);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
index b64a8a1504..0bcd0b583d 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
@@ -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);
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
index bd3295b928..ecfde52eff 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
@@ -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;
@@ -57,7 +57,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();
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/playeractions/SocialAction.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/playeractions/SocialAction.java
index 63f58d424d..f7db8c36f7 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/playeractions/SocialAction.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/playeractions/SocialAction.java
@@ -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;
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 6618f26888..db9e7a1a83 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -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();
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
index 612ca5cdc7..50a74f01fa 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
@@ -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");
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
index 4ca843967c..c165b2658d 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
@@ -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);
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
index 0ae4d70bdf..f0e18f6b8d 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
@@ -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);
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
index 7f2ed62f90..856942597c 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
@@ -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;
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
index 4baa7c3145..6e86e46b09 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
@@ -23,8 +23,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -202,7 +202,7 @@ public final class CastleDungeon extends AbstractInstance
*/
private void spawnRaid(Instance instance)
{
- final ScheduledFuture> spawnTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> spawnTask = ThreadPool.schedule(() ->
{
// Get template id of raid
final int npcId;
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
index 517ae46248..87fe82da43 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
@@ -25,8 +25,8 @@ import java.util.logging.Level;
import java.util.stream.IntStream;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
@@ -111,7 +111,7 @@ public final class ChamberOfDelusion extends AbstractInstance
changeRoom(instance);
// Start banish task
- final ScheduledFuture> banishTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ final ScheduledFuture> banishTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (instance.getRemainingTime() < 60000)
{
@@ -414,7 +414,7 @@ public final class ChamberOfDelusion extends AbstractInstance
final long nextInterval = (bossRoom) ? 60000L : (ROOM_CHANGE_INTERVAL + getRandom(ROOM_CHANGE_RANDOM_TIME)) * 1000L;
if (world.getRemainingTime() > nextInterval)
{
- final ScheduledFuture> roomChangeTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> roomChangeTask = ThreadPool.schedule(() ->
{
try
{
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
index 591730785d..a77b62959c 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
@@ -23,8 +23,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -225,7 +225,7 @@ public final class FortressDungeon extends AbstractInstance
*/
private void spawnRaid(Instance instance)
{
- final ScheduledFuture> spawnTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> spawnTask = ThreadPool.schedule(() ->
{
// Get template id of raid
final int npcId;
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
index bfc2a993c2..b186e52726 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
@@ -16,8 +16,8 @@
*/
package quests.Q10292_SevenSignsGirlOfDoubt;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -168,7 +168,7 @@ public final class Q10292_SevenSignsGirlOfDoubt extends Quest
creature1.setRandomWalking(true);
final L2Npc creature2 = addSpawn(CREATURE_OF_THE_DUSK2, 89524, -238131, -9632, 56, false, 0, false, player.getInstanceId());
creature2.setRandomWalking(true);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
creature1.deleteMe();
creature2.deleteMe();
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
index 0d98846433..b2f7557291 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
@@ -16,7 +16,7 @@
*/
package quests.Q10742_AFurryFriend;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -228,6 +228,6 @@ public final class Q10742_AFurryFriend extends Quest
public void onRouteFinished(L2Npc npc)
{
WalkingManager.getInstance().cancelMoving(npc);
- ThreadPoolManager.schedule(() -> npc.deleteMe(), 1000);
+ ThreadPool.schedule(() -> npc.deleteMe(), 1000);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/AirShipController.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/AirShipController.java
index bd5264cfe0..bcd888210f 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/AirShipController.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/AirShipController.java
@@ -19,7 +19,7 @@ package vehicles;
import java.util.concurrent.Future;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.Movie;
import com.l2jmobius.gameserver.instancemanager.AirShipManager;
@@ -291,11 +291,11 @@ public abstract class AirShipController extends AbstractNpcAI
playMovie(_dockedShip.getPassengers(), _movie);
}
- ThreadPoolManager.schedule(_decayTask, 1000);
+ ThreadPool.schedule(_decayTask, 1000);
}
else
{
- _departSchedule = ThreadPoolManager.schedule(_departTask, DEPART_INTERVAL);
+ _departSchedule = ThreadPool.schedule(_departTask, DEPART_INTERVAL);
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
index 8f320c15d9..699a792202 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
@@ -16,7 +16,7 @@
*/
package vehicles.AirShipGludioGracia;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.AirShipManager;
import com.l2jmobius.gameserver.model.L2World;
@@ -251,7 +251,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
{
// _ship.teleToLocation(-167874, 256731, -509, 41035, false);
_ship.setOustLoc(OUST_GRACIA);
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
break;
}
case 2:
@@ -264,7 +264,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
broadcastInGracia(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_ADEN_CONTINENT_IN_1_MINUTE);
_ship.setInDock(GRACIA_DOCK_ID);
_ship.oustPlayers();
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
case 4:
@@ -278,7 +278,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
{
// _ship.teleToLocation(-157261, 255664, 221, 64781, false);
_ship.setOustLoc(OUST_GLUDIO);
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
break;
}
case 6:
@@ -291,7 +291,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
broadcastInGludio(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_GRACIA_CONTINENT_IN_1_MINUTE);
_ship.setInDock(GLUDIO_DOCK_ID);
_ship.oustPlayers();
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatGludinRune.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatGludinRune.java
index b03d55dc79..c162606bf1 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatGludinRune.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatGludinRune.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -176,19 +176,19 @@ public class BoatGludinRune implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -198,25 +198,25 @@ public class BoatGludinRune implements Runnable
_boat.broadcastPacket(GLUDIN_SOUND);
_boat.payForRide(7905, 1, -90015, 150422, -3610);
_boat.executePath(GLUDIN_TO_RUNE);
- ThreadPoolManager.schedule(this, 250000);
+ ThreadPool.schedule(this, 250000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 6:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 7:
@@ -239,7 +239,7 @@ public class BoatGludinRune implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(RUNE_DOCK);
@@ -250,25 +250,25 @@ public class BoatGludinRune implements Runnable
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2);
_boat.broadcastPacket(RUNE_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 10:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 11:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 12:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 13:
@@ -278,25 +278,25 @@ public class BoatGludinRune implements Runnable
_boat.broadcastPacket(RUNE_SOUND);
_boat.payForRide(7904, 1, 34513, -38009, -3640);
_boat.executePath(RUNE_TO_GLUDIN);
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
case 14:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 15:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 16:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 17:
@@ -319,7 +319,7 @@ public class BoatGludinRune implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(GLUDIN_DOCK);
@@ -330,7 +330,7 @@ public class BoatGludinRune implements Runnable
BoatManager.getInstance().dockShip(BoatManager.GLUDIN_HARBOR, true);
BoatManager.getInstance().broadcastPackets(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVED_AT_GLUDIN, ARRIVED_AT_GLUDIN_2);
_boat.broadcastPacket(GLUDIN_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatInnadrilTour.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
index b2462e8c54..1805617eaf 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -119,19 +119,19 @@ public class BoatInnadrilTour implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -139,31 +139,31 @@ public class BoatInnadrilTour implements Runnable
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, LEAVING_INNADRIL, INNADRIL_SOUND);
_boat.payForRide(0, 1, 107092, 219098, -3952);
_boat.executePath(TOUR);
- ThreadPoolManager.schedule(this, 650000);
+ ThreadPool.schedule(this, 650000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL20);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 6:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 7:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 8:
@@ -174,7 +174,7 @@ public class BoatInnadrilTour implements Runnable
case 9:
{
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, ARRIVED_AT_INNADRIL, INNADRIL_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatRunePrimeval.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
index fee83279f1..c04177df76 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -120,7 +120,7 @@ public class BoatRunePrimeval implements Runnable
case 1:
{
BoatManager.getInstance().broadcastPackets(PRIMEVAL_DOCK, RUNE_DOCK[0], ARRIVED_AT_PRIMEVAL, ARRIVED_AT_PRIMEVAL_2, PRIMEVAL_SOUND);
- ThreadPoolManager.schedule(this, 180000);
+ ThreadPool.schedule(this, 180000);
break;
}
case 2:
@@ -145,7 +145,7 @@ public class BoatRunePrimeval implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(RUNE_DOCK);
@@ -155,7 +155,7 @@ public class BoatRunePrimeval implements Runnable
{
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], PRIMEVAL_DOCK, ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2, RUNE_SOUND);
- ThreadPoolManager.schedule(this, 180000);
+ ThreadPool.schedule(this, 180000);
break;
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ThreadPoolManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/concurrent/ThreadPool.java
similarity index 98%
rename from L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ThreadPoolManager.java
rename to L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/concurrent/ThreadPool.java
index c9777e9c56..63b620ce4e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ThreadPoolManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/concurrent/ThreadPool.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-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;
*
Instant pool handles short-life events.
*
*/
-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;
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java
index f1d6736c11..a8829d3a57 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java
@@ -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
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
index 777bcbbd43..a4fc1b00a2 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -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()
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/RecipeController.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/RecipeController.java
index 0bd69dc604..06c67d16e2 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/RecipeController.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/RecipeController.java
@@ -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
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/Shutdown.java
index 2878a9df1b..2e99f8f99f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/Shutdown.java
@@ -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)
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/AbstractAI.java
index b0de12e3a7..1955d24a1b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/AbstractAI.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/AbstractAI.java
@@ -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
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
index 6fc8e2db7b..e39af75c7a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
index d75219e0a7..852194d0e7 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
@@ -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
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2DoorAI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
index 1c536565b1..863a88a54e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
@@ -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
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2SummonAI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
index d0d6ef1cc4..fa06b60c27 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index 258e120fa2..9005a7c1ec 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -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)
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
index 93625c6b3c..df544c991d 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
@@ -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;
@@ -331,7 +331,7 @@ public class ClanTable
public void scheduleRemoveClan(int clanId)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (getClan(clanId) == null)
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/BotReportTable.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
index d525c02a6a..555223ce4f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/ItemTable.java
index 1723520fa2..c8f34ed812 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/ItemTable.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/datatables/ItemTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
index b81189c6db..3965ca6cbf 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
@@ -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.");
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index d2b606a72a..6a9dff749b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -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()
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
index 62d750ea6e..4f8594ee49 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
@@ -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));
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
index d15bee76d5..e16e1eb679 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
@@ -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)));
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index f4d39d153f..af7835fe63 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -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);
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
index 16a0da92bc..65b7775e2f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
@@ -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)
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index c6537d2d80..14f412ec48 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -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;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
index c06464b525..9c43355936 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
@@ -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)
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
index dbcfdb4423..2f33b08a7b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 926b637642..e8b430a5df 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -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();
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/MailManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
index 9a562ecf61..58b75f592d 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
@@ -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)
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 1a6bdcfebb..a29ed155fc 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -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);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
index 478e1f78f5..c1df0ca78b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
@@ -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() + ".");
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
index e9c54b975a..a7a85e7181 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/ClanWar.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/ClanWar.java
index 61a97fa208..eea3375661 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/ClanWar.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/ClanWar.java
@@ -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());
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CreatureContainer.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CreatureContainer.java
index da2d7bcc94..91d8c1f632 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CreatureContainer.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CreatureContainer.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CursedWeapon.java
index d6c5f1374b..d579628d09 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CursedWeapon.java
@@ -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;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/DropProtection.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/DropProtection.java
index 50a3cc2145..a6aef4bdc4 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/DropProtection.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/DropProtection.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/Fishing.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/Fishing.java
index 42fc869286..d4098ed013 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/Fishing.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/Fishing.java
@@ -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));
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Clan.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Clan.java
index 419107c527..1d1f8c517b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Clan.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Clan.java
@@ -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;
@@ -3177,7 +3177,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);
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Party.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Party.java
index 5b6e9281fe..5f14864046 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Party.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Party.java
@@ -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));
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Request.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Request.java
index a65b9b6a50..dafa0f378e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Request.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Request.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java
index 06b8d89b88..723bae6bfd 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 693ba7ad57..6bfaf3a33d 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/MpRewardTask.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/MpRewardTask.java
index cf4458c3a4..827e7e936f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/MpRewardTask.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/MpRewardTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
index a49ea96d75..fbfa059528 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
@@ -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;
@@ -235,7 +235,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
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index e39c93014d..af22b8d62e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -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)
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
index 033caf07bf..44d799a80a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
@@ -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())
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
index 3f2fcfb5dc..94fe6bb6b5 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
index 3d61e79b4e..8bdacda8a8 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
@@ -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());
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
index 8f14bf5519..6c554e10e0 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
@@ -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
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
index f47eab9638..4fb7bbb976 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
index b982a00c9f..a1606ac209 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
index bbb05d8c61..f94c70c9ba 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
@@ -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;
@@ -821,7 +821,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);
}
}
@@ -2832,7 +2832,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);
}
}
@@ -2855,7 +2855,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);
}
}
@@ -7759,7 +7759,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;
@@ -7950,7 +7950,7 @@ public final class L2PcInstance extends L2Playable
final long currentTime = System.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
- _hennaRemoveSchedules.put(i, ThreadPoolManager.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
+ _hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
}
// Reward henna skills
@@ -8062,7 +8062,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));
}
}
@@ -8671,7 +8671,7 @@ public final class L2PcInstance extends L2Playable
_inventoryDisable = val;
if (val)
{
- ThreadPoolManager.schedule(new InventoryEnableTask(this), 1500);
+ ThreadPool.schedule(new InventoryEnableTask(this), 1500);
}
}
@@ -9487,7 +9487,7 @@ public final class L2PcInstance extends L2Playable
{
if (_skillListRefreshTask == null)
{
- _skillListRefreshTask = ThreadPoolManager.schedule(() ->
+ _skillListRefreshTask = ThreadPool.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
@@ -9958,7 +9958,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);
}
}
@@ -9984,7 +9984,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);
}
}
@@ -10015,7 +10015,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);
}
}
@@ -10396,7 +10396,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);
}
}
}
@@ -11290,7 +11290,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);
}
}
@@ -11410,7 +11410,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);
}
@@ -11782,7 +11782,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)
@@ -11792,7 +11792,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);
}
}
}
@@ -11869,7 +11869,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()
@@ -11990,7 +11990,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);
}
/**
@@ -13029,7 +13029,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();
@@ -13970,7 +13970,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()
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
index 652a1ca0fa..5718895451 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
index d398e89c03..cdca1b721f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.MonsterRace;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -106,26 +106,26 @@ public class L2RaceManagerInstance extends L2Npc
_managers = new CopyOnWriteArrayList<>();
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
}
_managers.add(this);
}
@@ -253,7 +253,7 @@ public class L2RaceManagerInstance extends L2Npc
_packet = new MonRaceInfo(_codes[1][0], _codes[1][1], race.getMonsters(), race.getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunRace(), 5000);
+ ThreadPool.schedule(new RunRace(), 5000);
}
else
{
@@ -558,7 +558,7 @@ public class L2RaceManagerInstance extends L2Npc
{
_packet = new MonRaceInfo(_codes[2][0], _codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunEnd(), 30000);
+ ThreadPool.schedule(new RunEnd(), 30000);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
index 7b95a8d218..4b4f6d1f00 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
@@ -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()
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
index bbe7fd3e89..2c113f3992 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
index eb169af1ce..d5549be287 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
@@ -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.YOUR_BASE_IS_BEING_ATTACKED));
setCanTalk(false);
- ThreadPoolManager.schedule(new ScheduleTalkTask(), 20000);
+ ThreadPool.schedule(new ScheduleTalkTask(), 20000);
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
index 0a04416d20..3d3a67f2b9 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
@@ -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
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
index 60e018bb0f..32b74ba8eb 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
@@ -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()
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
index 7950d61315..5e68cb589e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
@@ -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()
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
index 9af40f494e..352a7719ae 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 6f37725f33..dc787cbc19 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -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
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
index a6ffb508f1..3fa6773fd2 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
index b15e938ffe..192da08f4e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
@@ -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)
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
index 4dff07f0c4..5c5e479600 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
@@ -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);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
index 7d2ed5035b..a47ba1a0a5 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/buylist/Product.java
index 0da19f8ec7..97571235ed 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/buylist/Product.java
@@ -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
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
index a5c90d0c95..f2fb12dc19 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
@@ -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()
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
index 58eab32cb0..d77bf6af86 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
@@ -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)
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Castle.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Castle.java
index f1aa77737c..a6faf0b0df 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Castle.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Castle.java
@@ -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
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/ClanHall.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
index 2cfbef3323..d41afdb68a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
@@ -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();
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Duel.java
index 09536b2aef..d601203f8d 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Duel.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Duel.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Fort.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Fort.java
index d892c13f8c..e9b3160a50 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Fort.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Fort.java
@@ -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
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/FortSiege.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
index 43e89644c5..053af69e9d 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Siege.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Siege.java
index 664be1c395..0c7d996da0 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Siege.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Siege.java
@@ -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();
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index 8f25107013..f09be6765f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -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);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
index 2e551991b6..c25f5189f6 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
index 2fdc072c9f..2e334ae7ed 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
@@ -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 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);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
index 70464afd7c..65d29d5c01 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -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
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index 34c893a2b6..c538e405ae 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -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)
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 17a9b42f56..5c81ea0b72 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -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;
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 51431290ec..5e586bd78f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -34,8 +34,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.OptionData;
@@ -1444,7 +1444,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);
}
/**
@@ -1577,7 +1577,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
@@ -1862,7 +1862,7 @@ public final class L2ItemInstance extends L2Object
{
_lifeTimeTask.cancel(true);
}
- _lifeTimeTask = ThreadPoolManager.schedule(new ScheduleLifeTimeTask(this), getRemainingTime());
+ _lifeTimeTask = ThreadPool.schedule(new ScheduleLifeTimeTask(this), getRemainingTime());
}
}
@@ -2205,11 +2205,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);
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
index 724b7229fc..38d0fa7c13 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -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");
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index 06c89cb134..d18e278286 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index bc8f5d0bc3..d4720828f5 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -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()));
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 5e7ed370d3..cae533ba54 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
index 0eb81e0589..64f6afb219 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
@@ -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)
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index 9b93abc89c..497bcd5aec 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -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());
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
index 6fb07987fe..64f04389a2 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
@@ -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:
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index 9696330565..9ac2dd32b5 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -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);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
index 451d9a575b..7758ffe098 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
@@ -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());
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
index 0f57c18729..66b9f7e4b2 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
@@ -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()
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
index dd4d99799e..bccb1a9fdb 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
@@ -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()
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
index 9801290712..38c9a63329 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
index f9ff489d33..043a66b6f4 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
@@ -20,8 +20,8 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +150,7 @@ public final class L2EffectZone extends L2ZoneType
{
if (getSettings().getTask() == null)
{
- getSettings().setTask(ThreadPoolManager.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
+ getSettings().setTask(ThreadPool.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
index 6814af7a3a..71d8f10b3e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.lang.ref.WeakReference;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.PcCondOverride;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -47,7 +47,7 @@ public class L2FishingZone extends L2ZoneType
if ((Config.ALLOW_FISHING || character.canOverrideCond(PcCondOverride.ZONE_CONDITIONS)) && !character.isInsideZone(ZoneId.FISHING))
{
final WeakReference weakPlayer = new WeakReference<>(character.getActingPlayer());
- ThreadPoolManager.execute(new Runnable()
+ ThreadPool.execute(new Runnable()
{
@Override
public void run()
@@ -69,7 +69,7 @@ public class L2FishingZone extends L2ZoneType
player.sendPacket(ExAutoFishAvailable.NO);
}
}
- ThreadPoolManager.schedule(this, 1500);
+ ThreadPool.schedule(this, 1500);
}
else
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
index 13e3744d6c..6511752492 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -77,7 +77,7 @@ public class L2JailZone extends L2ZoneType
if (player.isJailed())
{
// when a player wants to exit jail even if he is still jailed, teleport him back to jail
- ThreadPoolManager.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
+ ThreadPool.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
character.sendMessage("You cannot cheat your way out of here. You must wait until your jail time is over.");
}
if (Config.JAIL_DISABLE_TRANSACTION)
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
index 94b5594d11..c0ffa52989 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.ArrayList;
import java.util.List;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.Location;
@@ -130,7 +130,7 @@ public class L2OlympiadStadiumZone extends L2ZoneRespawn
// only participants, observers and GMs allowed
if (!player.canOverrideCond(PcCondOverride.ZONE_CONDITIONS) && !player.isInOlympiadMode() && !player.inObserverMode())
{
- ThreadPoolManager.execute(new KickPlayer(player));
+ ThreadPool.execute(new KickPlayer(player));
}
else
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
index 063cd551e6..cb7760aee0 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
@@ -18,8 +18,8 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -62,7 +62,7 @@ public class L2ResidenceHallTeleportZone extends L2ResidenceTeleportZone
{
if ((_teleTask == null) || _teleTask.isDone())
{
- _teleTask = ThreadPoolManager.schedule(new TeleportTask(), 30000);
+ _teleTask = ThreadPool.schedule(new TeleportTask(), 30000);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
index ca1ec6ed1a..3d7911ed2a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.CategoryType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.tasks.player.FlyMoveStartTask;
@@ -59,7 +59,7 @@ public class L2SayuneZone extends L2ZoneType
if (character.isPlayer() && (character.isInCategory(CategoryType.SIXTH_CLASS_GROUP) || Config.FREE_JUMPS_FOR_ALL) && !character.getActingPlayer().isMounted() && !character.isTransformed())
{
character.setInsideZone(ZoneId.SAYUNE, true);
- ThreadPoolManager.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
+ ThreadPool.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/Disconnection.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/Disconnection.java
index 8c839bb573..dd0aefae85 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/Disconnection.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/Disconnection.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.network;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventDispatcher;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogout;
@@ -183,7 +183,7 @@ public final class Disconnection
{
if (_activeChar != null)
{
- ThreadPoolManager.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
+ ThreadPool.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index d04cb02aff..51a0e763ba 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -17,9 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.LoginServerThread;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.sql.impl.AnnouncementsTable;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
@@ -645,7 +645,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.HARDWARE_INFO_ENABLED)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (client.getHardwareInfo() == null)
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
index c1d19b5e5b..274d425f02 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
@@ -101,7 +101,7 @@ public final class RequestDuelStart implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_BEEN_CHALLENGED_TO_A_DUEL);
sm.addString(name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, name), 10000);
activeChar.blockRequest();
return;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
index aa110b024b..817c5d9296 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.enums.PartyDistributionType;
import com.l2jmobius.gameserver.model.BlockList;
@@ -82,7 +82,7 @@ public final class RequestJoinParty implements IClientIncomingPacket
requestor.sendPacket(sm);
if (!requestor.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(requestor), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(requestor), 10000);
requestor.blockRequest();
}
else
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
index 37c539556f..9e6d7ce7be 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2World;
@@ -80,7 +80,7 @@ public final class RequestJoinPledge implements IClientIncomingPacket
{
if (!activeChar.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
index d9cc2097df..7e97a40c3f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
@@ -21,8 +21,8 @@ import java.util.Map;
import java.util.logging.Level;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.L2Object;
@@ -241,7 +241,7 @@ public final class RequestPreviewItem implements IClientIncomingPacket
{
activeChar.sendPacket(new ShopPreviewInfo(itemList));
// Schedule task
- ThreadPoolManager.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
+ ThreadPool.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 31e80f64fb..7ba8a189b4 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.FortManager;
@@ -114,7 +114,7 @@ public final class RequestRestartPoint implements IClientIncomingPacket
if ((activeChar.getClan() != null) && castle.getSiege().checkIsAttacker(activeChar.getClan()))
{
// Schedule respawn delay for attacker
- ThreadPoolManager.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
+ ThreadPool.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
if (castle.getSiege().getAttackerRespawnDelay() > 0)
{
activeChar.sendMessage("You will be re-spawned in " + (castle.getSiege().getAttackerRespawnDelay() / 1000) + " seconds");
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
index 7675b1221d..27dadd4973 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.datatables.BotReportTable;
import com.l2jmobius.gameserver.enums.PrivateStoreType;
@@ -129,7 +129,7 @@ public final class TradeRequest implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_REQUESTED_A_TRADE_WITH_C1);
sm.addString(name);
player.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(player, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(player, name), 10000);
player.blockRequest();
}
else
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
index de78415a4b..5999d7d02c 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.NextAction;
@@ -247,7 +247,7 @@ public final class UseItem implements IClientIncomingPacket
}
else if (activeChar.isAttackingNow())
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Removed for preventing retail behavior.
// if (activeChar.isAttackingNow()) // If character is still engaged in strike we should not change weapon
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
index f14c3fa651..5c0b6915bc 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets.friend;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.L2World;
@@ -65,7 +65,7 @@ public final class RequestFriendInvite implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_VE_REQUESTED_C1_TO_BE_ON_YOUR_FRIENDS_LIST);
sm.addString(_name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
index 4fe79bf68d..b6e739add1 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.serverpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketWriter;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.OutgoingPackets;
@@ -56,7 +56,7 @@ public class ExAlterSkillRequest implements IClientOutgoingPacket
if (_alterTime > 0)
{
_player.setAlterSkillActive(true);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
_player.sendPacket(new ExAlterSkillRequest(null, -1, -1, -1));
_player.setAlterSkillActive(false);
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9cd2ebed02..9f26c91ac6 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
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.L2Summon;
import com.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -45,7 +45,7 @@ public class AttackStanceTaskManager
*/
protected AttackStanceTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
+ ThreadPool.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 9e9dde878c..942d4215db 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
@@ -65,7 +65,7 @@ public final class DecayTaskManager
if (!_decayTasks.containsKey(character))
{
- _decayTasks.put(character, ThreadPoolManager.schedule(new DecayTask(character), delay * 1000));
+ _decayTasks.put(character, ThreadPool.schedule(new DecayTask(character), delay * 1000));
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
index 5d9816577a..7f86a2bfb3 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -35,8 +35,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.taskmanager.tasks.TaskBirthday;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskRestart;
@@ -235,14 +235,14 @@ public final class TaskManager
case TYPE_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
- task.scheduled = ThreadPoolManager.schedule(task, delay);
+ task.scheduled = ThreadPool.schedule(task, delay);
return true;
}
case TYPE_FIXED_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
interval = Long.valueOf(task.getParams()[1]);
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
case TYPE_TIME:
@@ -253,7 +253,7 @@ public final class TaskManager
final long diff = desired.getTime() - System.currentTimeMillis();
if (diff >= 0)
{
- task.scheduled = ThreadPoolManager.schedule(task, diff);
+ task.scheduled = ThreadPool.schedule(task, diff);
return true;
}
LOGGER.info("Task " + task.getId() + " is obsoleted.");
@@ -306,7 +306,7 @@ public final class TaskManager
{
delay += interval;
}
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
default:
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Evolve.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Evolve.java
index 80a1c892c6..7fae394d24 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Evolve.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Evolve.java
@@ -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.database.DatabaseFactory;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.PetDataTable;
import com.l2jmobius.gameserver.model.L2PetData;
@@ -142,11 +142,11 @@ public final class Evolve
petSummon.startFeed();
item.setEnchantLevel(petSummon.getLevel());
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
@@ -236,11 +236,11 @@ public final class Evolve
player.broadcastUserInfo();
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/MinionList.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/MinionList.java
index fda128217e..271b3ea3d9 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/MinionList.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/MinionList.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -141,7 +141,7 @@ public class MinionList
final int time = respawnTime < 0 ? _master.isRaid() ? (int) Config.RAID_MINION_RESPAWN_TIMER : 0 : respawnTime;
if ((time > 0) && !_master.isAlikeDead())
{
- ThreadPoolManager.schedule(new MinionRespawnTask(minion), time);
+ ThreadPool.schedule(new MinionRespawnTask(minion), time);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Util.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Util.java
index 0508148f16..b075bfc1d2 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Util.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/util/Util.java
@@ -38,9 +38,9 @@ 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.Rnd;
import com.l2jmobius.commons.util.file.filter.ExtFilter;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.HtmlActionScope;
import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import com.l2jmobius.gameserver.model.L2Object;
@@ -64,7 +64,7 @@ public final class Util
public static void handleIllegalPlayerAction(L2PcInstance actor, String message, IllegalActionPunishmentType punishment)
{
- ThreadPoolManager.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
+ ThreadPool.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
}
/**
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
index 3619de52a6..b21c9b9df7 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
@@ -16,8 +16,8 @@
*/
package ai.areas.DenOfDevil;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
@@ -127,7 +127,7 @@ public final class DenOfEvil extends AbstractNpcAI
zone.addSkill(skillId, skillLevel + 1);
if (skillLevel == 3) // 3+1=4
{
- ThreadPoolManager.schedule(new KashaDestruction(zone), 2 * 60 * 1000l);
+ ThreadPool.schedule(new KashaDestruction(zone), 2 * 60 * 1000l);
zone.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.DEFEAT_KASHA_S_EYES_TO_LIFT_THE_GREAT_CURSE));
}
else if (skillLevel == 2)
@@ -140,7 +140,7 @@ public final class DenOfEvil extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
- ThreadPoolManager.schedule(new RespawnNewEye(npc.getLocation()), 15000);
+ ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
if (zone == null)
{
@@ -213,7 +213,7 @@ public final class DenOfEvil extends AbstractNpcAI
final L2Npc npc = (L2Npc) character;
if (CommonUtil.contains(EYE_IDS, npc.getId()))
{
- ThreadPoolManager.schedule(new RespawnNewEye(npc.getLocation()), 15000);
+ ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
index 21f7d8c4cb..23514e5981 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
@@ -20,8 +20,8 @@ import java.text.SimpleDateFormat;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
+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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -129,7 +129,7 @@ public final class Parade extends AbstractNpcAI
{
// Starts at 8:00 and repeats every 6 hours.
final long diff = timeLeftMilli(8, 0, 0), cycle = 3600000L;
- ThreadPoolManager.scheduleAtFixedRate(new Start(), diff, cycle);
+ ThreadPool.scheduleAtFixedRate(new Start(), diff, cycle);
// Test - Starts 3 minutes after server startup and repeats every 20 minutes.
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000L;
@@ -167,9 +167,9 @@ public final class Parade extends AbstractNpcAI
public void run()
{
load();
- spawnTask = ThreadPoolManager.scheduleAtFixedRate(new Spawn(), 0, 5000);
- deleteTask = ThreadPoolManager.scheduleAtFixedRate(new Delete(), 10000, 1000);
- cleanTask = ThreadPoolManager.schedule(new Clean(), 420000);
+ spawnTask = ThreadPool.scheduleAtFixedRate(new Spawn(), 0, 5000);
+ deleteTask = ThreadPool.scheduleAtFixedRate(new Delete(), 10000, 1000);
+ cleanTask = ThreadPool.schedule(new Clean(), 420000);
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java
index e730e1d3c4..f8b824d674 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java
@@ -17,7 +17,7 @@
package ai.areas.GainakUnderground;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -140,7 +140,7 @@ public final class GainakSiege extends AbstractNpcAI
final L2SiegeZone zone = ZoneManager.getInstance().getZone(npc, L2SiegeZone.class);
if ((zone != null) && (zone.getId() == 60019) && zone.isActive())
{
- ThreadPoolManager.schedule(new RespawnNewAssassin(npc.getLocation()), 60000);
+ ThreadPool.schedule(new RespawnNewAssassin(npc.getLocation()), 60000);
}
return super.onKill(npc, killer, isSummon);
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
index 954afd0819..e67e5ea74d 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
@@ -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.enums.ChatType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -256,7 +256,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
if ((doorInfo[0] == sepulcherId) && (doorInfo[1] == currentWave))
{
openDoor(doorInfo[2], 0);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
closeDoor(doorInfo[2], 0);
}, 15000);
@@ -578,7 +578,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
showHtmlFile(player, npcId + "-OK.html", npc, null);
// Kick all players when/if time is over
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers();
}, TIME_ATTACK * 60 * 1000);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
index b1a37e194f..627cf622d0 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
@@ -16,7 +16,7 @@
*/
package ai.areas.Rune.AltarOfSacrifice;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -109,7 +109,7 @@ public class AltarOfSacrifice extends AbstractNpcAI
private void sendMessage(L2Npc npc, NpcStringId npcString, int delay)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (npc != null)
{
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
index 1a41e95122..e795fad37e 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
@@ -20,7 +20,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.enums.CategoryType;
@@ -340,7 +340,7 @@ public final class AwakeningMaster extends AbstractNpcAI
player.sendSkillList();
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
player.sendPacket(ExShowUsm.AWAKENING_END);
}, 10000);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
index 58750ad197..569eff3cfe 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
@@ -22,7 +22,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -174,7 +174,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic")), null));
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
currentInfo.setZoneStage(7);
- ThreadPoolManager.schedule(new changeZoneStage(zone), 600000); // 10min
+ ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min
}
else
{
@@ -202,7 +202,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (currentInfo.getZoneStage() < 6)
{
currentInfo.setZoneStage(currentInfo.getZoneStage() + 1);
- ThreadPoolManager.schedule(new changeZoneStage(zone), 5000);
+ ThreadPool.schedule(new changeZoneStage(zone), 5000);
}
}
catch (Exception e)
@@ -248,7 +248,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (calcPoints >= 300)
{
calcPoints = 300;
- ThreadPoolManager.schedule(new changeZoneStage(currentZone.getKey()), 1000);
+ ThreadPool.schedule(new changeZoneStage(currentZone.getKey()), 1000);
}
currentInfo.setCurrentPoint(calcPoints);
for (L2PcInstance player : currentZone.getKey().getPlayersInside())
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
index 7e11d3b4d1..33344e3f16 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
@@ -21,8 +21,8 @@ import java.util.List;
import java.util.concurrent.ScheduledFuture;
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.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.ChatType;
@@ -303,7 +303,7 @@ public class Lindvior extends AbstractNpcAI
}
else if ((percent <= 75) && (_status == 1))
{
- _bigVortexesTask = ThreadPoolManager.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
+ _bigVortexesTask = ThreadPool.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
addSpawn(LINDVIOR_SERVITOR[1], loc, true);
@@ -324,7 +324,7 @@ public class Lindvior extends AbstractNpcAI
{
addSpawn(LINDVIOR_SERVITOR[2], loc, true);
}
- _skillCastTask = ThreadPoolManager.scheduleAtFixedRate(() -> _lindvior.doCast(SKILL_REFLECT.getSkill()), 5000, 80000);
+ _skillCastTask = ThreadPool.scheduleAtFixedRate(() -> _lindvior.doCast(SKILL_REFLECT.getSkill()), 5000, 80000);
_status = 3;
}
else if ((percent <= 40) && (_status == 3))
@@ -348,7 +348,7 @@ public class Lindvior extends AbstractNpcAI
}
else if ((percent <= 35) && (_status == 4))
{
- _smallVortexesTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _smallVortexesTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
@@ -372,14 +372,14 @@ public class Lindvior extends AbstractNpcAI
_lindvior.deleteMe();
_lindvior = (L2GrandBossInstance) addSpawn(LINDVIOR_RAID, _lindvior.getLocation(), false, 0, false);
_lindvior.setCurrentHp(_lindvior.getMaxHp() * 0.2);
- _bigVortexesTask = ThreadPoolManager.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
+ _bigVortexesTask = ThreadPool.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
addSpawn(NPC_ATTACKER_SMALL_VORTEX, loc, true);
addSpawn(LINDVIOR_SERVITOR[4], loc, true);
addSpawn(LINDVIOR_SERVITOR[3], loc, true);
}
- _collapseTask = ThreadPoolManager.schedule(Lindvior.this::Clean, 600000);
+ _collapseTask = ThreadPool.schedule(Lindvior.this::Clean, 600000);
_status = 6;
}
return super.onAttack(npc, attacker, damage, isSummon);
@@ -580,7 +580,7 @@ public class Lindvior extends AbstractNpcAI
_guardSpawn.add(npc);
}
- _mobsSpawnTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : ATTACKER_GENERATOR_SPAWNS)
{
@@ -596,7 +596,7 @@ public class Lindvior extends AbstractNpcAI
}, 30000, 80000);
_dummyLindvior = addSpawn(LINDVIOR_CAMERA, 45259, -27115, -638, 41325, false, 0, false);
- _announceTask = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_MUST_ACTIVATE_THE_4_GENERATORS, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 20000);
+ _announceTask = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_MUST_ACTIVATE_THE_4_GENERATORS, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 20000);
break;
}
case 2: // After activation of 4 generators, we wait to be charged
@@ -621,7 +621,7 @@ public class Lindvior extends AbstractNpcAI
{
guard.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ALL_4_GENERATORS_MUST_BE_ACTIVATED);
});
- _announceProtect = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> player.sendPacket(new ExShowScreenMessage(NpcStringId.PROTECT_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 18000);
+ _announceProtect = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> player.sendPacket(new ExShowScreenMessage(NpcStringId.PROTECT_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 18000);
_zoneLair.broadcastPacket(new SpecialCamera(_dummyLindvior, 3300, 200, 20, 11000, 10500, 0, 8, 1, 0, 0));
_generatorSpawn.forEach(npc -> npc.sendInfo(player));
startQuestTimer("show_movie", 13000, null, null);
@@ -696,7 +696,7 @@ public class Lindvior extends AbstractNpcAI
_zoneLair.broadcastPacket(new SocialAction(_lindvior.getObjectId(), 1));
_zoneLair.getPlayersInside().forEach(_lindvior::sendInfo);
_zoneLair.broadcastPacket(new ExShowScreenMessage(NpcStringId.LINDVIOR_HAS_FALLEN_FROM_THE_SKY, ExShowScreenMessage.TOP_CENTER, 7000));
- _mobsSpawnTask = ThreadPoolManager.scheduleAtFixedRate(() -> spawnServitor(2, 1000, _lindvior.getLocation(), LINDVIOR_SERVITOR), 60000, 180000);
+ _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(() -> spawnServitor(2, 1000, _lindvior.getLocation(), LINDVIOR_SERVITOR), 60000, 180000);
break;
}
}
@@ -749,12 +749,12 @@ public class Lindvior extends AbstractNpcAI
_dummyLindvior.deleteMe();
_lindvior2 = addSpawn(LINDVIOR_FAKE, CENTER_LOCATION, false, 0, false);
_lindvior2.setTargetable(false);
- _announceTask = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> p.sendPacket(new ExShowScreenMessage(NpcStringId.CHARGE_THE_CANNON_USING_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 40000, 20000);
+ _announceTask = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> p.sendPacket(new ExShowScreenMessage(NpcStringId.CHARGE_THE_CANNON_USING_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 40000, 20000);
break;
}
case "start_charge":
{
- _skillCastTask = ThreadPoolManager.scheduleAtFixedRate(() -> _generatorSpawn.forEach(generators ->
+ _skillCastTask = ThreadPool.scheduleAtFixedRate(() -> _generatorSpawn.forEach(generators ->
{
int index = generators.getScriptValue();
if (!generators.isCastingNow() && (generators.getEffectList().getBuffInfoBySkillId(SKILL_RECHARGE_POSIBLE.getSkillId()) == null) && !hasFlag(_chargedMask, 1 << index))
@@ -780,7 +780,7 @@ public class Lindvior extends AbstractNpcAI
});
}
}), 10000, 20000);
- _LynDracoTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _LynDracoTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : LYN_DRACO_SPAWNS)
{
@@ -830,7 +830,7 @@ public class Lindvior extends AbstractNpcAI
_mobsSpawnTask = null;
}
_zoneLair.getCharactersInside().stream().filter(L2Character::isNpc).forEach(mob -> mob.deleteMe());
- ThreadPoolManager.schedule(() -> npc.decayMe(), 10000);
+ ThreadPool.schedule(() -> npc.decayMe(), 10000);
_zoneLair.broadcastPacket(new OnEventTrigger(SECOND_STAGE_EVENT_TRIGGER, false));
_zoneLair.broadcastPacket(new OnEventTrigger(FIRST_STAGE_EVENT_TRIGGER, true));
_lionel.deleteMe();
@@ -846,7 +846,7 @@ public class Lindvior extends AbstractNpcAI
{
_zoneLair.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_GENERATOR_HAS_BEEN_DESTROYED, ExShowScreenMessage.TOP_CENTER, 5000, true));
Clean();
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(false), 20000);
+ _collapseTask = ThreadPool.schedule(() -> Fail(false), 20000);
}
return super.onKill(npc, killer, isSummon);
}
@@ -882,7 +882,7 @@ public class Lindvior extends AbstractNpcAI
{
if (zone.getPlayersInside().isEmpty())
{
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(true), 900000);
+ _collapseTask = ThreadPool.schedule(() -> Fail(true), 900000);
}
}
return super.onExitZone(character, zone);
@@ -940,7 +940,7 @@ public class Lindvior extends AbstractNpcAI
{
if (_socialTask == null)
{
- _socialTask = ThreadPoolManager.schedule(() -> nextStage(1), 3000);
+ _socialTask = ThreadPool.schedule(() -> nextStage(1), 3000);
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index 6c0a28cefe..d66ecbb53e 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -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;
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
index 6e8a0db865..9e42c69098 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
@@ -20,8 +20,8 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicInteger;
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.DoorData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.Movie;
@@ -429,7 +429,7 @@ public class Trasken extends AbstractNpcAI
doom.setTarget(doom);
doom.isCastingNow();
doom.doCast(SKILL_1.getSkill());
- ThreadPoolManager.schedule(() -> doom.deleteMe(), 15000);
+ ThreadPool.schedule(() -> doom.deleteMe(), 15000);
}
final double percent = ((npc.getCurrentHp() - damage) / npc.getMaxHp()) * 100.0;
if ((percent <= 30) && (_statusZone == 4))
@@ -616,7 +616,7 @@ public class Trasken extends AbstractNpcAI
_zoneLair.getCharactersInside().stream().filter(L2Object::isMonster).forEach(cha -> ((L2MonsterInstance) cha).getSpawn().stopRespawn());
_zoneLair2.getCharactersInside().stream().filter(L2Character::isNpc).forEach(mob -> mob.deleteMe());
_zoneLair2.getCharactersInside().stream().filter(L2Object::isMonster).forEach(cha -> ((L2MonsterInstance) cha).getSpawn().stopRespawn());
- ThreadPoolManager.schedule(() -> npc.decayMe(), 10000);
+ ThreadPool.schedule(() -> npc.decayMe(), 10000);
cancelQuestTimer("finish", npc, null);
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
@@ -642,7 +642,7 @@ public class Trasken extends AbstractNpcAI
final int[] spawn = Rnd_Spawn_Tail[Rnd.get(Rnd_Spawn_Tail.length)];
if (SpawnTable.getInstance().getSpawns(TAIL_TRASKEN) == null)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
tie_trasken = addSpawn(TAIL_TRASKEN, spawn[0], spawn[1], spawn[2], 0, false, 0, true);
tie_trasken.setCurrentHp(hp_tail);
@@ -663,7 +663,7 @@ public class Trasken extends AbstractNpcAI
final int[] spawn1 = Rnd_Spawn_Trasken[Rnd.get(Rnd_Spawn_Trasken.length)];
if (SpawnTable.getInstance().getSpawns(TRASKEN) == null)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
trasken = addSpawn(TRASKEN, spawn1[0], spawn1[1], spawn1[2], 0, false, 0, true);
trasken.doCast(SKILL_TRASKEN_UP.getSkill());
@@ -774,7 +774,7 @@ public class Trasken extends AbstractNpcAI
}
final int time = 540000;
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 540, 0, NpcStringId.REMAINING_TIME)));
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(true), time);
+ _collapseTask = ThreadPool.schedule(() -> Fail(true), time);
}
return super.onEnterZone(character, zone);
}
@@ -784,7 +784,7 @@ public class Trasken extends AbstractNpcAI
{
if ((zone.getId() == ZONE_ID_HEART) && zone.getPlayersInside().isEmpty())
{
- _collapseTask = ThreadPoolManager.schedule(() ->
+ _collapseTask = ThreadPool.schedule(() ->
{
Fail(true);
for (int info : eventTriggers)
@@ -890,7 +890,7 @@ public class Trasken extends AbstractNpcAI
character.getEffectList().stopSkillEffects(true, traskenBuff.getSkill());
}
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
character.broadcastPacket(new ExShowScreenMessage(NpcStringId.YOU_VE_EXCEEDED_THE_MAXIMUM_NUMBER_OF_PERSONNEL, 5, 24000, true));
character.doCast(SKILL_TRASKEN_SLEEP.getSkill());
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/EnergySeeds.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/EnergySeeds.java
index 546f3b3cc0..30db4dff20 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/EnergySeeds.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/EnergySeeds.java
@@ -20,8 +20,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
@@ -721,7 +721,7 @@ public final class EnergySeeds extends AbstractNpcAI
public void scheduleRespawn(long waitTime)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// if the AI is inactive, do not spawn the NPC
if (isSeedActive(_seedId))
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
index 9cef571b2a..819ba28b77 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
@@ -18,7 +18,7 @@ package ai.others.NpcBuffers;
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.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -90,6 +90,6 @@ public class NpcBufferAI implements Runnable
_npc.doCast(skill);
- ThreadPoolManager.schedule(this, skill.getReuseDelay());
+ ThreadPool.schedule(this, skill.getReuseDelay());
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
index faf003a11c..a8f7bcc23f 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
@@ -16,7 +16,7 @@
*/
package ai.others.NpcBuffers;
-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;
@@ -53,7 +53,7 @@ public final class NpcBuffers extends AbstractNpcAI
final NpcBufferData data = _npcBuffers.getNpcBuffer(npc.getId());
for (NpcBufferSkillData skill : data.getSkills())
{
- ThreadPoolManager.schedule(new NpcBufferAI(npc, skill), skill.getInitialDelay());
+ ThreadPool.schedule(new NpcBufferAI(npc, skill), skill.getInitialDelay());
}
return super.onSpawn(npc);
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/events/Elpies/Elpies.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/events/Elpies/Elpies.java
index 604b5bcff8..4ca3d1df97 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/events/Elpies/Elpies.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/events/Elpies/Elpies.java
@@ -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();
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/events/Race/Race.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/events/Race/Race.java
index 8af01c7b29..19f2f42bae 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/events/Race/Race.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/events/Race/Race.java
@@ -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
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
index b986361b8c..51fee14634 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
@@ -16,8 +16,8 @@
*/
package handlers.admincommandhandlers;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.MonsterRace;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -107,7 +107,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunRace(codes, activeChar), 5000);
+ ThreadPool.schedule(new RunRace(codes, activeChar), 5000);
}
}
@@ -137,7 +137,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
final MonRaceInfo spk = new MonRaceInfo(codes[2][0], codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunEnd(activeChar), 30000);
+ ThreadPool.schedule(new RunEnd(activeChar), 30000);
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
index b64a8a1504..0bcd0b583d 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
@@ -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);
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
index bd3295b928..ecfde52eff 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
@@ -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;
@@ -57,7 +57,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();
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/playeractions/SocialAction.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/playeractions/SocialAction.java
index 63f58d424d..f7db8c36f7 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/playeractions/SocialAction.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/playeractions/SocialAction.java
@@ -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;
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 6618f26888..db9e7a1a83 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -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();
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
index 612ca5cdc7..50a74f01fa 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
@@ -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");
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
index 4ca843967c..c165b2658d 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
@@ -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);
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
index 0ae4d70bdf..f0e18f6b8d 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
@@ -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);
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
index 7f2ed62f90..856942597c 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
@@ -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;
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
index 4baa7c3145..6e86e46b09 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
@@ -23,8 +23,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -202,7 +202,7 @@ public final class CastleDungeon extends AbstractInstance
*/
private void spawnRaid(Instance instance)
{
- final ScheduledFuture> spawnTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> spawnTask = ThreadPool.schedule(() ->
{
// Get template id of raid
final int npcId;
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
index 517ae46248..87fe82da43 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
@@ -25,8 +25,8 @@ import java.util.logging.Level;
import java.util.stream.IntStream;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
@@ -111,7 +111,7 @@ public final class ChamberOfDelusion extends AbstractInstance
changeRoom(instance);
// Start banish task
- final ScheduledFuture> banishTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ final ScheduledFuture> banishTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (instance.getRemainingTime() < 60000)
{
@@ -414,7 +414,7 @@ public final class ChamberOfDelusion extends AbstractInstance
final long nextInterval = (bossRoom) ? 60000L : (ROOM_CHANGE_INTERVAL + getRandom(ROOM_CHANGE_RANDOM_TIME)) * 1000L;
if (world.getRemainingTime() > nextInterval)
{
- final ScheduledFuture> roomChangeTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> roomChangeTask = ThreadPool.schedule(() ->
{
try
{
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
index 591730785d..a77b62959c 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
@@ -23,8 +23,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -225,7 +225,7 @@ public final class FortressDungeon extends AbstractInstance
*/
private void spawnRaid(Instance instance)
{
- final ScheduledFuture> spawnTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> spawnTask = ThreadPool.schedule(() ->
{
// Get template id of raid
final int npcId;
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
index bfc2a993c2..b186e52726 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
@@ -16,8 +16,8 @@
*/
package quests.Q10292_SevenSignsGirlOfDoubt;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -168,7 +168,7 @@ public final class Q10292_SevenSignsGirlOfDoubt extends Quest
creature1.setRandomWalking(true);
final L2Npc creature2 = addSpawn(CREATURE_OF_THE_DUSK2, 89524, -238131, -9632, 56, false, 0, false, player.getInstanceId());
creature2.setRandomWalking(true);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
creature1.deleteMe();
creature2.deleteMe();
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
index 0d98846433..b2f7557291 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
@@ -16,7 +16,7 @@
*/
package quests.Q10742_AFurryFriend;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -228,6 +228,6 @@ public final class Q10742_AFurryFriend extends Quest
public void onRouteFinished(L2Npc npc)
{
WalkingManager.getInstance().cancelMoving(npc);
- ThreadPoolManager.schedule(() -> npc.deleteMe(), 1000);
+ ThreadPool.schedule(() -> npc.deleteMe(), 1000);
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/AirShipController.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/AirShipController.java
index bd5264cfe0..bcd888210f 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/AirShipController.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/AirShipController.java
@@ -19,7 +19,7 @@ package vehicles;
import java.util.concurrent.Future;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.Movie;
import com.l2jmobius.gameserver.instancemanager.AirShipManager;
@@ -291,11 +291,11 @@ public abstract class AirShipController extends AbstractNpcAI
playMovie(_dockedShip.getPassengers(), _movie);
}
- ThreadPoolManager.schedule(_decayTask, 1000);
+ ThreadPool.schedule(_decayTask, 1000);
}
else
{
- _departSchedule = ThreadPoolManager.schedule(_departTask, DEPART_INTERVAL);
+ _departSchedule = ThreadPool.schedule(_departTask, DEPART_INTERVAL);
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
index 8f320c15d9..699a792202 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
@@ -16,7 +16,7 @@
*/
package vehicles.AirShipGludioGracia;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.AirShipManager;
import com.l2jmobius.gameserver.model.L2World;
@@ -251,7 +251,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
{
// _ship.teleToLocation(-167874, 256731, -509, 41035, false);
_ship.setOustLoc(OUST_GRACIA);
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
break;
}
case 2:
@@ -264,7 +264,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
broadcastInGracia(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_ADEN_CONTINENT_IN_1_MINUTE);
_ship.setInDock(GRACIA_DOCK_ID);
_ship.oustPlayers();
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
case 4:
@@ -278,7 +278,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
{
// _ship.teleToLocation(-157261, 255664, 221, 64781, false);
_ship.setOustLoc(OUST_GLUDIO);
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
break;
}
case 6:
@@ -291,7 +291,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
broadcastInGludio(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_GRACIA_CONTINENT_IN_1_MINUTE);
_ship.setInDock(GLUDIO_DOCK_ID);
_ship.oustPlayers();
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatGludinRune.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatGludinRune.java
index b03d55dc79..c162606bf1 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatGludinRune.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatGludinRune.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -176,19 +176,19 @@ public class BoatGludinRune implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -198,25 +198,25 @@ public class BoatGludinRune implements Runnable
_boat.broadcastPacket(GLUDIN_SOUND);
_boat.payForRide(7905, 1, -90015, 150422, -3610);
_boat.executePath(GLUDIN_TO_RUNE);
- ThreadPoolManager.schedule(this, 250000);
+ ThreadPool.schedule(this, 250000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 6:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 7:
@@ -239,7 +239,7 @@ public class BoatGludinRune implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(RUNE_DOCK);
@@ -250,25 +250,25 @@ public class BoatGludinRune implements Runnable
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2);
_boat.broadcastPacket(RUNE_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 10:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 11:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 12:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 13:
@@ -278,25 +278,25 @@ public class BoatGludinRune implements Runnable
_boat.broadcastPacket(RUNE_SOUND);
_boat.payForRide(7904, 1, 34513, -38009, -3640);
_boat.executePath(RUNE_TO_GLUDIN);
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
case 14:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 15:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 16:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 17:
@@ -319,7 +319,7 @@ public class BoatGludinRune implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(GLUDIN_DOCK);
@@ -330,7 +330,7 @@ public class BoatGludinRune implements Runnable
BoatManager.getInstance().dockShip(BoatManager.GLUDIN_HARBOR, true);
BoatManager.getInstance().broadcastPackets(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVED_AT_GLUDIN, ARRIVED_AT_GLUDIN_2);
_boat.broadcastPacket(GLUDIN_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatInnadrilTour.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
index b2462e8c54..1805617eaf 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -119,19 +119,19 @@ public class BoatInnadrilTour implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -139,31 +139,31 @@ public class BoatInnadrilTour implements Runnable
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, LEAVING_INNADRIL, INNADRIL_SOUND);
_boat.payForRide(0, 1, 107092, 219098, -3952);
_boat.executePath(TOUR);
- ThreadPoolManager.schedule(this, 650000);
+ ThreadPool.schedule(this, 650000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL20);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 6:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 7:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 8:
@@ -174,7 +174,7 @@ public class BoatInnadrilTour implements Runnable
case 9:
{
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, ARRIVED_AT_INNADRIL, INNADRIL_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatRunePrimeval.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
index fee83279f1..c04177df76 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -120,7 +120,7 @@ public class BoatRunePrimeval implements Runnable
case 1:
{
BoatManager.getInstance().broadcastPackets(PRIMEVAL_DOCK, RUNE_DOCK[0], ARRIVED_AT_PRIMEVAL, ARRIVED_AT_PRIMEVAL_2, PRIMEVAL_SOUND);
- ThreadPoolManager.schedule(this, 180000);
+ ThreadPool.schedule(this, 180000);
break;
}
case 2:
@@ -145,7 +145,7 @@ public class BoatRunePrimeval implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(RUNE_DOCK);
@@ -155,7 +155,7 @@ public class BoatRunePrimeval implements Runnable
{
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], PRIMEVAL_DOCK, ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2, RUNE_SOUND);
- ThreadPoolManager.schedule(this, 180000);
+ ThreadPool.schedule(this, 180000);
break;
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ThreadPoolManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/concurrent/ThreadPool.java
similarity index 98%
rename from L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ThreadPoolManager.java
rename to L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/concurrent/ThreadPool.java
index c9777e9c56..63b620ce4e 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ThreadPoolManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/concurrent/ThreadPool.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-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;
* Instant pool handles short-life events.
*
*/
-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;
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java
index 5dd2063e42..e9547b444a 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java
@@ -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;
@@ -183,7 +184,7 @@ public class GameServer
}
printSection("ThreadPool");
- ThreadPoolManager.init();
+ ThreadPool.init();
EventDispatcher.getInstance();
// load script engines
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
index 777bcbbd43..a4fc1b00a2 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -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()
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/RecipeController.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/RecipeController.java
index 0bd69dc604..06c67d16e2 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/RecipeController.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/RecipeController.java
@@ -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
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/Shutdown.java
index 2878a9df1b..2e99f8f99f 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/Shutdown.java
@@ -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)
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/AbstractAI.java
index b0de12e3a7..1955d24a1b 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/AbstractAI.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/AbstractAI.java
@@ -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
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
index 6fc8e2db7b..e39af75c7a 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
index d75219e0a7..852194d0e7 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
@@ -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
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2DoorAI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
index 1c536565b1..863a88a54e 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
@@ -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
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2SummonAI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
index d0d6ef1cc4..fa06b60c27 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index 258e120fa2..9005a7c1ec 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -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)
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
index 93625c6b3c..df544c991d 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
@@ -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;
@@ -331,7 +331,7 @@ public class ClanTable
public void scheduleRemoveClan(int clanId)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (getClan(clanId) == null)
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/BotReportTable.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
index d525c02a6a..555223ce4f 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/ItemTable.java
index 1723520fa2..c8f34ed812 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/ItemTable.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/datatables/ItemTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
index b81189c6db..3965ca6cbf 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
@@ -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.");
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index d2b606a72a..6a9dff749b 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -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()
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
index 62d750ea6e..4f8594ee49 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
@@ -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));
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
index d15bee76d5..e16e1eb679 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
@@ -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)));
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index f4d39d153f..af7835fe63 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -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);
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
index 16a0da92bc..65b7775e2f 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
@@ -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)
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index c6537d2d80..14f412ec48 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -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;
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
index c06464b525..9c43355936 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
@@ -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)
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
index dbcfdb4423..2f33b08a7b 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 926b637642..e8b430a5df 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -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();
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/MailManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
index 9a562ecf61..58b75f592d 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
@@ -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)
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 1a6bdcfebb..a29ed155fc 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -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);
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
index 478e1f78f5..c1df0ca78b 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
@@ -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() + ".");
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
index e9c54b975a..a7a85e7181 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/ClanWar.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/ClanWar.java
index 61a97fa208..eea3375661 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/ClanWar.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/ClanWar.java
@@ -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());
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CreatureContainer.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CreatureContainer.java
index da2d7bcc94..91d8c1f632 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CreatureContainer.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CreatureContainer.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CursedWeapon.java
index d6c5f1374b..d579628d09 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CursedWeapon.java
@@ -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;
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/DropProtection.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/DropProtection.java
index 50a3cc2145..a6aef4bdc4 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/DropProtection.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/DropProtection.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/Fishing.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/Fishing.java
index edbfe1412c..56b6c3e94a 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/Fishing.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/Fishing.java
@@ -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));
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Clan.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Clan.java
index 77faa268ca..08b62e547b 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Clan.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Clan.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Party.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Party.java
index 5b6e9281fe..5f14864046 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Party.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Party.java
@@ -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));
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Request.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Request.java
index a65b9b6a50..dafa0f378e 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Request.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Request.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java
index 06b8d89b88..723bae6bfd 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 693ba7ad57..6bfaf3a33d 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/MpRewardTask.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/MpRewardTask.java
index cf4458c3a4..827e7e936f 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/MpRewardTask.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/MpRewardTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
index e82c15218f..67e20df0bb 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
@@ -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
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index e39c93014d..af22b8d62e 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -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)
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
index 7cc8062431..8679593b56 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
@@ -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())
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
index 3f2fcfb5dc..94fe6bb6b5 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
index 3d61e79b4e..8bdacda8a8 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
@@ -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());
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
index 8f14bf5519..6c554e10e0 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
@@ -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
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
index f47eab9638..4fb7bbb976 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
index b982a00c9f..a1606ac209 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
index b42de1d3f7..117f29d970 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
@@ -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;
@@ -823,7 +823,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);
}
}
@@ -2838,7 +2838,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);
}
}
@@ -2861,7 +2861,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);
}
}
@@ -7766,7 +7766,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;
@@ -7957,7 +7957,7 @@ public final class L2PcInstance extends L2Playable
final long currentTime = System.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
- _hennaRemoveSchedules.put(i, ThreadPoolManager.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
+ _hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
}
// Reward henna skills
@@ -8069,7 +8069,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));
}
}
@@ -8678,7 +8678,7 @@ public final class L2PcInstance extends L2Playable
_inventoryDisable = val;
if (val)
{
- ThreadPoolManager.schedule(new InventoryEnableTask(this), 1500);
+ ThreadPool.schedule(new InventoryEnableTask(this), 1500);
}
}
@@ -9494,7 +9494,7 @@ public final class L2PcInstance extends L2Playable
{
if (_skillListRefreshTask == null)
{
- _skillListRefreshTask = ThreadPoolManager.schedule(() ->
+ _skillListRefreshTask = ThreadPool.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
@@ -9965,7 +9965,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);
}
}
@@ -9991,7 +9991,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);
}
}
@@ -10022,7 +10022,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);
}
}
@@ -10403,7 +10403,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);
}
}
}
@@ -11297,7 +11297,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);
}
}
@@ -11417,7 +11417,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);
}
@@ -11789,7 +11789,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)
@@ -11799,7 +11799,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);
}
}
}
@@ -11876,7 +11876,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()
@@ -11997,7 +11997,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);
}
/**
@@ -13036,7 +13036,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();
@@ -13977,7 +13977,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()
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
index 652a1ca0fa..5718895451 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
index d398e89c03..cdca1b721f 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.MonsterRace;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -106,26 +106,26 @@ public class L2RaceManagerInstance extends L2Npc
_managers = new CopyOnWriteArrayList<>();
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
}
_managers.add(this);
}
@@ -253,7 +253,7 @@ public class L2RaceManagerInstance extends L2Npc
_packet = new MonRaceInfo(_codes[1][0], _codes[1][1], race.getMonsters(), race.getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunRace(), 5000);
+ ThreadPool.schedule(new RunRace(), 5000);
}
else
{
@@ -558,7 +558,7 @@ public class L2RaceManagerInstance extends L2Npc
{
_packet = new MonRaceInfo(_codes[2][0], _codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunEnd(), 30000);
+ ThreadPool.schedule(new RunEnd(), 30000);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
index 7b95a8d218..4b4f6d1f00 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
@@ -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()
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
index bbe7fd3e89..2c113f3992 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
index eb169af1ce..d5549be287 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
@@ -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.YOUR_BASE_IS_BEING_ATTACKED));
setCanTalk(false);
- ThreadPoolManager.schedule(new ScheduleTalkTask(), 20000);
+ ThreadPool.schedule(new ScheduleTalkTask(), 20000);
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
index 0a04416d20..3d3a67f2b9 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
@@ -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
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
index 60e018bb0f..32b74ba8eb 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
@@ -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()
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
index 7950d61315..5e68cb589e 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
@@ -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()
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
index 9af40f494e..352a7719ae 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 6f37725f33..dc787cbc19 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -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
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
index a6ffb508f1..3fa6773fd2 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
index b15e938ffe..192da08f4e 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
@@ -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)
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
index 4dff07f0c4..5c5e479600 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
@@ -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);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
index 7d2ed5035b..a47ba1a0a5 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/buylist/Product.java
index 0da19f8ec7..97571235ed 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/buylist/Product.java
@@ -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
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
index a5c90d0c95..f2fb12dc19 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
@@ -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()
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
index 58eab32cb0..d77bf6af86 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
@@ -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)
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Castle.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Castle.java
index f1aa77737c..a6faf0b0df 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Castle.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Castle.java
@@ -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
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/ClanHall.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
index 2cfbef3323..d41afdb68a 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
@@ -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();
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java
index 09536b2aef..d601203f8d 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Fort.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Fort.java
index d892c13f8c..e9b3160a50 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Fort.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Fort.java
@@ -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
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/FortSiege.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
index 43e89644c5..053af69e9d 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Siege.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Siege.java
index 00ff234699..c3b017869d 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Siege.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Siege.java
@@ -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();
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index 8f25107013..f09be6765f 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -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);
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
index 2e551991b6..c25f5189f6 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
index 2fdc072c9f..2e334ae7ed 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
@@ -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 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);
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
index 70464afd7c..65d29d5c01 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -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
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index 34c893a2b6..c538e405ae 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -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)
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 17a9b42f56..5c81ea0b72 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -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;
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 407130b911..2e12063fd7 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
index 724b7229fc..38d0fa7c13 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -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");
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index 06c89cb134..d18e278286 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index bc8f5d0bc3..d4720828f5 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -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()));
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 5e7ed370d3..cae533ba54 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
index 0eb81e0589..64f6afb219 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
@@ -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)
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index 9b93abc89c..497bcd5aec 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -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());
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
index 6fb07987fe..64f04389a2 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
@@ -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:
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index 9696330565..9ac2dd32b5 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -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);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
index 451d9a575b..7758ffe098 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
@@ -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());
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
index 0f57c18729..66b9f7e4b2 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
@@ -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()
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
index dd4d99799e..bccb1a9fdb 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
@@ -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()
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
index 9801290712..38c9a63329 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
index f9ff489d33..043a66b6f4 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
@@ -20,8 +20,8 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +150,7 @@ public final class L2EffectZone extends L2ZoneType
{
if (getSettings().getTask() == null)
{
- getSettings().setTask(ThreadPoolManager.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
+ getSettings().setTask(ThreadPool.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
index 6814af7a3a..71d8f10b3e 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.lang.ref.WeakReference;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.PcCondOverride;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -47,7 +47,7 @@ public class L2FishingZone extends L2ZoneType
if ((Config.ALLOW_FISHING || character.canOverrideCond(PcCondOverride.ZONE_CONDITIONS)) && !character.isInsideZone(ZoneId.FISHING))
{
final WeakReference weakPlayer = new WeakReference<>(character.getActingPlayer());
- ThreadPoolManager.execute(new Runnable()
+ ThreadPool.execute(new Runnable()
{
@Override
public void run()
@@ -69,7 +69,7 @@ public class L2FishingZone extends L2ZoneType
player.sendPacket(ExAutoFishAvailable.NO);
}
}
- ThreadPoolManager.schedule(this, 1500);
+ ThreadPool.schedule(this, 1500);
}
else
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
index 13e3744d6c..6511752492 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -77,7 +77,7 @@ public class L2JailZone extends L2ZoneType
if (player.isJailed())
{
// when a player wants to exit jail even if he is still jailed, teleport him back to jail
- ThreadPoolManager.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
+ ThreadPool.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
character.sendMessage("You cannot cheat your way out of here. You must wait until your jail time is over.");
}
if (Config.JAIL_DISABLE_TRANSACTION)
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
index 94b5594d11..c0ffa52989 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.ArrayList;
import java.util.List;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.Location;
@@ -130,7 +130,7 @@ public class L2OlympiadStadiumZone extends L2ZoneRespawn
// only participants, observers and GMs allowed
if (!player.canOverrideCond(PcCondOverride.ZONE_CONDITIONS) && !player.isInOlympiadMode() && !player.inObserverMode())
{
- ThreadPoolManager.execute(new KickPlayer(player));
+ ThreadPool.execute(new KickPlayer(player));
}
else
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
index 063cd551e6..cb7760aee0 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
@@ -18,8 +18,8 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -62,7 +62,7 @@ public class L2ResidenceHallTeleportZone extends L2ResidenceTeleportZone
{
if ((_teleTask == null) || _teleTask.isDone())
{
- _teleTask = ThreadPoolManager.schedule(new TeleportTask(), 30000);
+ _teleTask = ThreadPool.schedule(new TeleportTask(), 30000);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
index ca1ec6ed1a..3d7911ed2a 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.CategoryType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.tasks.player.FlyMoveStartTask;
@@ -59,7 +59,7 @@ public class L2SayuneZone extends L2ZoneType
if (character.isPlayer() && (character.isInCategory(CategoryType.SIXTH_CLASS_GROUP) || Config.FREE_JUMPS_FOR_ALL) && !character.getActingPlayer().isMounted() && !character.isTransformed())
{
character.setInsideZone(ZoneId.SAYUNE, true);
- ThreadPoolManager.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
+ ThreadPool.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/Disconnection.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/Disconnection.java
index 8c839bb573..dd0aefae85 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/Disconnection.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/Disconnection.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.network;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventDispatcher;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogout;
@@ -183,7 +183,7 @@ public final class Disconnection
{
if (_activeChar != null)
{
- ThreadPoolManager.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
+ ThreadPool.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 901665ac2a..6c6b755605 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -17,9 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.LoginServerThread;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.sql.impl.AnnouncementsTable;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
@@ -658,7 +658,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.ENABLE_ATTENDANCE_REWARDS)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Check if player can receive reward today.
final AttendanceInfoHolder attendanceInfo = activeChar.getAttendanceInfo();
@@ -678,7 +678,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.HARDWARE_INFO_ENABLED)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (client.getHardwareInfo() == null)
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
index c1d19b5e5b..274d425f02 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
@@ -101,7 +101,7 @@ public final class RequestDuelStart implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_BEEN_CHALLENGED_TO_A_DUEL);
sm.addString(name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, name), 10000);
activeChar.blockRequest();
return;
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
index aa110b024b..817c5d9296 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.enums.PartyDistributionType;
import com.l2jmobius.gameserver.model.BlockList;
@@ -82,7 +82,7 @@ public final class RequestJoinParty implements IClientIncomingPacket
requestor.sendPacket(sm);
if (!requestor.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(requestor), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(requestor), 10000);
requestor.blockRequest();
}
else
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
index 37c539556f..9e6d7ce7be 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2World;
@@ -80,7 +80,7 @@ public final class RequestJoinPledge implements IClientIncomingPacket
{
if (!activeChar.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
index d9cc2097df..7e97a40c3f 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
@@ -21,8 +21,8 @@ import java.util.Map;
import java.util.logging.Level;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.L2Object;
@@ -241,7 +241,7 @@ public final class RequestPreviewItem implements IClientIncomingPacket
{
activeChar.sendPacket(new ShopPreviewInfo(itemList));
// Schedule task
- ThreadPoolManager.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
+ ThreadPool.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 31e80f64fb..7ba8a189b4 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.FortManager;
@@ -114,7 +114,7 @@ public final class RequestRestartPoint implements IClientIncomingPacket
if ((activeChar.getClan() != null) && castle.getSiege().checkIsAttacker(activeChar.getClan()))
{
// Schedule respawn delay for attacker
- ThreadPoolManager.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
+ ThreadPool.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
if (castle.getSiege().getAttackerRespawnDelay() > 0)
{
activeChar.sendMessage("You will be re-spawned in " + (castle.getSiege().getAttackerRespawnDelay() / 1000) + " seconds");
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
index 7675b1221d..27dadd4973 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.datatables.BotReportTable;
import com.l2jmobius.gameserver.enums.PrivateStoreType;
@@ -129,7 +129,7 @@ public final class TradeRequest implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_REQUESTED_A_TRADE_WITH_C1);
sm.addString(name);
player.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(player, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(player, name), 10000);
player.blockRequest();
}
else
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
index de78415a4b..5999d7d02c 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.NextAction;
@@ -247,7 +247,7 @@ public final class UseItem implements IClientIncomingPacket
}
else if (activeChar.isAttackingNow())
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Removed for preventing retail behavior.
// if (activeChar.isAttackingNow()) // If character is still engaged in strike we should not change weapon
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
index f14c3fa651..5c0b6915bc 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets.friend;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.L2World;
@@ -65,7 +65,7 @@ public final class RequestFriendInvite implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_VE_REQUESTED_C1_TO_BE_ON_YOUR_FRIENDS_LIST);
sm.addString(_name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
index 4fe79bf68d..b6e739add1 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.serverpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketWriter;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.OutgoingPackets;
@@ -56,7 +56,7 @@ public class ExAlterSkillRequest implements IClientOutgoingPacket
if (_alterTime > 0)
{
_player.setAlterSkillActive(true);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
_player.sendPacket(new ExAlterSkillRequest(null, -1, -1, -1));
_player.setAlterSkillActive(false);
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9cd2ebed02..9f26c91ac6 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
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.L2Summon;
import com.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -45,7 +45,7 @@ public class AttackStanceTaskManager
*/
protected AttackStanceTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
+ ThreadPool.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 9e9dde878c..942d4215db 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
@@ -65,7 +65,7 @@ public final class DecayTaskManager
if (!_decayTasks.containsKey(character))
{
- _decayTasks.put(character, ThreadPoolManager.schedule(new DecayTask(character), delay * 1000));
+ _decayTasks.put(character, ThreadPool.schedule(new DecayTask(character), delay * 1000));
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
index 5d9816577a..7f86a2bfb3 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -35,8 +35,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.taskmanager.tasks.TaskBirthday;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskRestart;
@@ -235,14 +235,14 @@ public final class TaskManager
case TYPE_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
- task.scheduled = ThreadPoolManager.schedule(task, delay);
+ task.scheduled = ThreadPool.schedule(task, delay);
return true;
}
case TYPE_FIXED_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
interval = Long.valueOf(task.getParams()[1]);
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
case TYPE_TIME:
@@ -253,7 +253,7 @@ public final class TaskManager
final long diff = desired.getTime() - System.currentTimeMillis();
if (diff >= 0)
{
- task.scheduled = ThreadPoolManager.schedule(task, diff);
+ task.scheduled = ThreadPool.schedule(task, diff);
return true;
}
LOGGER.info("Task " + task.getId() + " is obsoleted.");
@@ -306,7 +306,7 @@ public final class TaskManager
{
delay += interval;
}
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
default:
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/Evolve.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/Evolve.java
index 80a1c892c6..7fae394d24 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/Evolve.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/Evolve.java
@@ -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.database.DatabaseFactory;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.PetDataTable;
import com.l2jmobius.gameserver.model.L2PetData;
@@ -142,11 +142,11 @@ public final class Evolve
petSummon.startFeed();
item.setEnchantLevel(petSummon.getLevel());
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
@@ -236,11 +236,11 @@ public final class Evolve
player.broadcastUserInfo();
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/MinionList.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/MinionList.java
index fda128217e..271b3ea3d9 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/MinionList.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/MinionList.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -141,7 +141,7 @@ public class MinionList
final int time = respawnTime < 0 ? _master.isRaid() ? (int) Config.RAID_MINION_RESPAWN_TIMER : 0 : respawnTime;
if ((time > 0) && !_master.isAlikeDead())
{
- ThreadPoolManager.schedule(new MinionRespawnTask(minion), time);
+ ThreadPool.schedule(new MinionRespawnTask(minion), time);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/Util.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/Util.java
index 0508148f16..b075bfc1d2 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/Util.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/util/Util.java
@@ -38,9 +38,9 @@ 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.Rnd;
import com.l2jmobius.commons.util.file.filter.ExtFilter;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.HtmlActionScope;
import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import com.l2jmobius.gameserver.model.L2Object;
@@ -64,7 +64,7 @@ public final class Util
public static void handleIllegalPlayerAction(L2PcInstance actor, String message, IllegalActionPunishmentType punishment)
{
- ThreadPoolManager.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
+ ThreadPool.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
}
/**
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
index 3619de52a6..b21c9b9df7 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
@@ -16,8 +16,8 @@
*/
package ai.areas.DenOfDevil;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
@@ -127,7 +127,7 @@ public final class DenOfEvil extends AbstractNpcAI
zone.addSkill(skillId, skillLevel + 1);
if (skillLevel == 3) // 3+1=4
{
- ThreadPoolManager.schedule(new KashaDestruction(zone), 2 * 60 * 1000l);
+ ThreadPool.schedule(new KashaDestruction(zone), 2 * 60 * 1000l);
zone.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.DEFEAT_KASHA_S_EYES_TO_LIFT_THE_GREAT_CURSE));
}
else if (skillLevel == 2)
@@ -140,7 +140,7 @@ public final class DenOfEvil extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
- ThreadPoolManager.schedule(new RespawnNewEye(npc.getLocation()), 15000);
+ ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
if (zone == null)
{
@@ -213,7 +213,7 @@ public final class DenOfEvil extends AbstractNpcAI
final L2Npc npc = (L2Npc) character;
if (CommonUtil.contains(EYE_IDS, npc.getId()))
{
- ThreadPoolManager.schedule(new RespawnNewEye(npc.getLocation()), 15000);
+ ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
index 21f7d8c4cb..23514e5981 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
@@ -20,8 +20,8 @@ import java.text.SimpleDateFormat;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
+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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -129,7 +129,7 @@ public final class Parade extends AbstractNpcAI
{
// Starts at 8:00 and repeats every 6 hours.
final long diff = timeLeftMilli(8, 0, 0), cycle = 3600000L;
- ThreadPoolManager.scheduleAtFixedRate(new Start(), diff, cycle);
+ ThreadPool.scheduleAtFixedRate(new Start(), diff, cycle);
// Test - Starts 3 minutes after server startup and repeats every 20 minutes.
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000L;
@@ -167,9 +167,9 @@ public final class Parade extends AbstractNpcAI
public void run()
{
load();
- spawnTask = ThreadPoolManager.scheduleAtFixedRate(new Spawn(), 0, 5000);
- deleteTask = ThreadPoolManager.scheduleAtFixedRate(new Delete(), 10000, 1000);
- cleanTask = ThreadPoolManager.schedule(new Clean(), 420000);
+ spawnTask = ThreadPool.scheduleAtFixedRate(new Spawn(), 0, 5000);
+ deleteTask = ThreadPool.scheduleAtFixedRate(new Delete(), 10000, 1000);
+ cleanTask = ThreadPool.schedule(new Clean(), 420000);
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java
index e730e1d3c4..f8b824d674 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java
@@ -17,7 +17,7 @@
package ai.areas.GainakUnderground;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -140,7 +140,7 @@ public final class GainakSiege extends AbstractNpcAI
final L2SiegeZone zone = ZoneManager.getInstance().getZone(npc, L2SiegeZone.class);
if ((zone != null) && (zone.getId() == 60019) && zone.isActive())
{
- ThreadPoolManager.schedule(new RespawnNewAssassin(npc.getLocation()), 60000);
+ ThreadPool.schedule(new RespawnNewAssassin(npc.getLocation()), 60000);
}
return super.onKill(npc, killer, isSummon);
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
index 954afd0819..e67e5ea74d 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
@@ -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.enums.ChatType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -256,7 +256,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
if ((doorInfo[0] == sepulcherId) && (doorInfo[1] == currentWave))
{
openDoor(doorInfo[2], 0);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
closeDoor(doorInfo[2], 0);
}, 15000);
@@ -578,7 +578,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
showHtmlFile(player, npcId + "-OK.html", npc, null);
// Kick all players when/if time is over
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers();
}, TIME_ATTACK * 60 * 1000);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
index b1a37e194f..627cf622d0 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
@@ -16,7 +16,7 @@
*/
package ai.areas.Rune.AltarOfSacrifice;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -109,7 +109,7 @@ public class AltarOfSacrifice extends AbstractNpcAI
private void sendMessage(L2Npc npc, NpcStringId npcString, int delay)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (npc != null)
{
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
index 1a41e95122..e795fad37e 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
@@ -20,7 +20,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.enums.CategoryType;
@@ -340,7 +340,7 @@ public final class AwakeningMaster extends AbstractNpcAI
player.sendSkillList();
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
player.sendPacket(ExShowUsm.AWAKENING_END);
}, 10000);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
index 58750ad197..569eff3cfe 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
@@ -22,7 +22,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -174,7 +174,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic")), null));
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
currentInfo.setZoneStage(7);
- ThreadPoolManager.schedule(new changeZoneStage(zone), 600000); // 10min
+ ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min
}
else
{
@@ -202,7 +202,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (currentInfo.getZoneStage() < 6)
{
currentInfo.setZoneStage(currentInfo.getZoneStage() + 1);
- ThreadPoolManager.schedule(new changeZoneStage(zone), 5000);
+ ThreadPool.schedule(new changeZoneStage(zone), 5000);
}
}
catch (Exception e)
@@ -248,7 +248,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (calcPoints >= 300)
{
calcPoints = 300;
- ThreadPoolManager.schedule(new changeZoneStage(currentZone.getKey()), 1000);
+ ThreadPool.schedule(new changeZoneStage(currentZone.getKey()), 1000);
}
currentInfo.setCurrentPoint(calcPoints);
for (L2PcInstance player : currentZone.getKey().getPlayersInside())
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
index 7e11d3b4d1..33344e3f16 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
@@ -21,8 +21,8 @@ import java.util.List;
import java.util.concurrent.ScheduledFuture;
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.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.ChatType;
@@ -303,7 +303,7 @@ public class Lindvior extends AbstractNpcAI
}
else if ((percent <= 75) && (_status == 1))
{
- _bigVortexesTask = ThreadPoolManager.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
+ _bigVortexesTask = ThreadPool.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
addSpawn(LINDVIOR_SERVITOR[1], loc, true);
@@ -324,7 +324,7 @@ public class Lindvior extends AbstractNpcAI
{
addSpawn(LINDVIOR_SERVITOR[2], loc, true);
}
- _skillCastTask = ThreadPoolManager.scheduleAtFixedRate(() -> _lindvior.doCast(SKILL_REFLECT.getSkill()), 5000, 80000);
+ _skillCastTask = ThreadPool.scheduleAtFixedRate(() -> _lindvior.doCast(SKILL_REFLECT.getSkill()), 5000, 80000);
_status = 3;
}
else if ((percent <= 40) && (_status == 3))
@@ -348,7 +348,7 @@ public class Lindvior extends AbstractNpcAI
}
else if ((percent <= 35) && (_status == 4))
{
- _smallVortexesTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _smallVortexesTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
@@ -372,14 +372,14 @@ public class Lindvior extends AbstractNpcAI
_lindvior.deleteMe();
_lindvior = (L2GrandBossInstance) addSpawn(LINDVIOR_RAID, _lindvior.getLocation(), false, 0, false);
_lindvior.setCurrentHp(_lindvior.getMaxHp() * 0.2);
- _bigVortexesTask = ThreadPoolManager.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
+ _bigVortexesTask = ThreadPool.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
addSpawn(NPC_ATTACKER_SMALL_VORTEX, loc, true);
addSpawn(LINDVIOR_SERVITOR[4], loc, true);
addSpawn(LINDVIOR_SERVITOR[3], loc, true);
}
- _collapseTask = ThreadPoolManager.schedule(Lindvior.this::Clean, 600000);
+ _collapseTask = ThreadPool.schedule(Lindvior.this::Clean, 600000);
_status = 6;
}
return super.onAttack(npc, attacker, damage, isSummon);
@@ -580,7 +580,7 @@ public class Lindvior extends AbstractNpcAI
_guardSpawn.add(npc);
}
- _mobsSpawnTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : ATTACKER_GENERATOR_SPAWNS)
{
@@ -596,7 +596,7 @@ public class Lindvior extends AbstractNpcAI
}, 30000, 80000);
_dummyLindvior = addSpawn(LINDVIOR_CAMERA, 45259, -27115, -638, 41325, false, 0, false);
- _announceTask = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_MUST_ACTIVATE_THE_4_GENERATORS, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 20000);
+ _announceTask = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_MUST_ACTIVATE_THE_4_GENERATORS, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 20000);
break;
}
case 2: // After activation of 4 generators, we wait to be charged
@@ -621,7 +621,7 @@ public class Lindvior extends AbstractNpcAI
{
guard.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ALL_4_GENERATORS_MUST_BE_ACTIVATED);
});
- _announceProtect = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> player.sendPacket(new ExShowScreenMessage(NpcStringId.PROTECT_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 18000);
+ _announceProtect = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> player.sendPacket(new ExShowScreenMessage(NpcStringId.PROTECT_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 18000);
_zoneLair.broadcastPacket(new SpecialCamera(_dummyLindvior, 3300, 200, 20, 11000, 10500, 0, 8, 1, 0, 0));
_generatorSpawn.forEach(npc -> npc.sendInfo(player));
startQuestTimer("show_movie", 13000, null, null);
@@ -696,7 +696,7 @@ public class Lindvior extends AbstractNpcAI
_zoneLair.broadcastPacket(new SocialAction(_lindvior.getObjectId(), 1));
_zoneLair.getPlayersInside().forEach(_lindvior::sendInfo);
_zoneLair.broadcastPacket(new ExShowScreenMessage(NpcStringId.LINDVIOR_HAS_FALLEN_FROM_THE_SKY, ExShowScreenMessage.TOP_CENTER, 7000));
- _mobsSpawnTask = ThreadPoolManager.scheduleAtFixedRate(() -> spawnServitor(2, 1000, _lindvior.getLocation(), LINDVIOR_SERVITOR), 60000, 180000);
+ _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(() -> spawnServitor(2, 1000, _lindvior.getLocation(), LINDVIOR_SERVITOR), 60000, 180000);
break;
}
}
@@ -749,12 +749,12 @@ public class Lindvior extends AbstractNpcAI
_dummyLindvior.deleteMe();
_lindvior2 = addSpawn(LINDVIOR_FAKE, CENTER_LOCATION, false, 0, false);
_lindvior2.setTargetable(false);
- _announceTask = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> p.sendPacket(new ExShowScreenMessage(NpcStringId.CHARGE_THE_CANNON_USING_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 40000, 20000);
+ _announceTask = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> p.sendPacket(new ExShowScreenMessage(NpcStringId.CHARGE_THE_CANNON_USING_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 40000, 20000);
break;
}
case "start_charge":
{
- _skillCastTask = ThreadPoolManager.scheduleAtFixedRate(() -> _generatorSpawn.forEach(generators ->
+ _skillCastTask = ThreadPool.scheduleAtFixedRate(() -> _generatorSpawn.forEach(generators ->
{
int index = generators.getScriptValue();
if (!generators.isCastingNow() && (generators.getEffectList().getBuffInfoBySkillId(SKILL_RECHARGE_POSIBLE.getSkillId()) == null) && !hasFlag(_chargedMask, 1 << index))
@@ -780,7 +780,7 @@ public class Lindvior extends AbstractNpcAI
});
}
}), 10000, 20000);
- _LynDracoTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _LynDracoTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : LYN_DRACO_SPAWNS)
{
@@ -830,7 +830,7 @@ public class Lindvior extends AbstractNpcAI
_mobsSpawnTask = null;
}
_zoneLair.getCharactersInside().stream().filter(L2Character::isNpc).forEach(mob -> mob.deleteMe());
- ThreadPoolManager.schedule(() -> npc.decayMe(), 10000);
+ ThreadPool.schedule(() -> npc.decayMe(), 10000);
_zoneLair.broadcastPacket(new OnEventTrigger(SECOND_STAGE_EVENT_TRIGGER, false));
_zoneLair.broadcastPacket(new OnEventTrigger(FIRST_STAGE_EVENT_TRIGGER, true));
_lionel.deleteMe();
@@ -846,7 +846,7 @@ public class Lindvior extends AbstractNpcAI
{
_zoneLair.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_GENERATOR_HAS_BEEN_DESTROYED, ExShowScreenMessage.TOP_CENTER, 5000, true));
Clean();
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(false), 20000);
+ _collapseTask = ThreadPool.schedule(() -> Fail(false), 20000);
}
return super.onKill(npc, killer, isSummon);
}
@@ -882,7 +882,7 @@ public class Lindvior extends AbstractNpcAI
{
if (zone.getPlayersInside().isEmpty())
{
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(true), 900000);
+ _collapseTask = ThreadPool.schedule(() -> Fail(true), 900000);
}
}
return super.onExitZone(character, zone);
@@ -940,7 +940,7 @@ public class Lindvior extends AbstractNpcAI
{
if (_socialTask == null)
{
- _socialTask = ThreadPoolManager.schedule(() -> nextStage(1), 3000);
+ _socialTask = ThreadPool.schedule(() -> nextStage(1), 3000);
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index 6c0a28cefe..d66ecbb53e 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -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;
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
index 6e8a0db865..9e42c69098 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
@@ -20,8 +20,8 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicInteger;
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.DoorData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.Movie;
@@ -429,7 +429,7 @@ public class Trasken extends AbstractNpcAI
doom.setTarget(doom);
doom.isCastingNow();
doom.doCast(SKILL_1.getSkill());
- ThreadPoolManager.schedule(() -> doom.deleteMe(), 15000);
+ ThreadPool.schedule(() -> doom.deleteMe(), 15000);
}
final double percent = ((npc.getCurrentHp() - damage) / npc.getMaxHp()) * 100.0;
if ((percent <= 30) && (_statusZone == 4))
@@ -616,7 +616,7 @@ public class Trasken extends AbstractNpcAI
_zoneLair.getCharactersInside().stream().filter(L2Object::isMonster).forEach(cha -> ((L2MonsterInstance) cha).getSpawn().stopRespawn());
_zoneLair2.getCharactersInside().stream().filter(L2Character::isNpc).forEach(mob -> mob.deleteMe());
_zoneLair2.getCharactersInside().stream().filter(L2Object::isMonster).forEach(cha -> ((L2MonsterInstance) cha).getSpawn().stopRespawn());
- ThreadPoolManager.schedule(() -> npc.decayMe(), 10000);
+ ThreadPool.schedule(() -> npc.decayMe(), 10000);
cancelQuestTimer("finish", npc, null);
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
@@ -642,7 +642,7 @@ public class Trasken extends AbstractNpcAI
final int[] spawn = Rnd_Spawn_Tail[Rnd.get(Rnd_Spawn_Tail.length)];
if (SpawnTable.getInstance().getSpawns(TAIL_TRASKEN) == null)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
tie_trasken = addSpawn(TAIL_TRASKEN, spawn[0], spawn[1], spawn[2], 0, false, 0, true);
tie_trasken.setCurrentHp(hp_tail);
@@ -663,7 +663,7 @@ public class Trasken extends AbstractNpcAI
final int[] spawn1 = Rnd_Spawn_Trasken[Rnd.get(Rnd_Spawn_Trasken.length)];
if (SpawnTable.getInstance().getSpawns(TRASKEN) == null)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
trasken = addSpawn(TRASKEN, spawn1[0], spawn1[1], spawn1[2], 0, false, 0, true);
trasken.doCast(SKILL_TRASKEN_UP.getSkill());
@@ -774,7 +774,7 @@ public class Trasken extends AbstractNpcAI
}
final int time = 540000;
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 540, 0, NpcStringId.REMAINING_TIME)));
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(true), time);
+ _collapseTask = ThreadPool.schedule(() -> Fail(true), time);
}
return super.onEnterZone(character, zone);
}
@@ -784,7 +784,7 @@ public class Trasken extends AbstractNpcAI
{
if ((zone.getId() == ZONE_ID_HEART) && zone.getPlayersInside().isEmpty())
{
- _collapseTask = ThreadPoolManager.schedule(() ->
+ _collapseTask = ThreadPool.schedule(() ->
{
Fail(true);
for (int info : eventTriggers)
@@ -890,7 +890,7 @@ public class Trasken extends AbstractNpcAI
character.getEffectList().stopSkillEffects(true, traskenBuff.getSkill());
}
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
character.broadcastPacket(new ExShowScreenMessage(NpcStringId.YOU_VE_EXCEEDED_THE_MAXIMUM_NUMBER_OF_PERSONNEL, 5, 24000, true));
character.doCast(SKILL_TRASKEN_SLEEP.getSkill());
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/EnergySeeds.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/EnergySeeds.java
index 546f3b3cc0..30db4dff20 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/EnergySeeds.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/EnergySeeds.java
@@ -20,8 +20,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
@@ -721,7 +721,7 @@ public final class EnergySeeds extends AbstractNpcAI
public void scheduleRespawn(long waitTime)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// if the AI is inactive, do not spawn the NPC
if (isSeedActive(_seedId))
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
index 9cef571b2a..819ba28b77 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
@@ -18,7 +18,7 @@ package ai.others.NpcBuffers;
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.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -90,6 +90,6 @@ public class NpcBufferAI implements Runnable
_npc.doCast(skill);
- ThreadPoolManager.schedule(this, skill.getReuseDelay());
+ ThreadPool.schedule(this, skill.getReuseDelay());
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
index faf003a11c..a8f7bcc23f 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
@@ -16,7 +16,7 @@
*/
package ai.others.NpcBuffers;
-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;
@@ -53,7 +53,7 @@ public final class NpcBuffers extends AbstractNpcAI
final NpcBufferData data = _npcBuffers.getNpcBuffer(npc.getId());
for (NpcBufferSkillData skill : data.getSkills())
{
- ThreadPoolManager.schedule(new NpcBufferAI(npc, skill), skill.getInitialDelay());
+ ThreadPool.schedule(new NpcBufferAI(npc, skill), skill.getInitialDelay());
}
return super.onSpawn(npc);
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/events/Elpies/Elpies.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/events/Elpies/Elpies.java
index 604b5bcff8..4ca3d1df97 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/events/Elpies/Elpies.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/events/Elpies/Elpies.java
@@ -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();
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/events/Race/Race.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/events/Race/Race.java
index 8af01c7b29..19f2f42bae 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/events/Race/Race.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/events/Race/Race.java
@@ -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
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
index b986361b8c..51fee14634 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
@@ -16,8 +16,8 @@
*/
package handlers.admincommandhandlers;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.MonsterRace;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -107,7 +107,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunRace(codes, activeChar), 5000);
+ ThreadPool.schedule(new RunRace(codes, activeChar), 5000);
}
}
@@ -137,7 +137,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
final MonRaceInfo spk = new MonRaceInfo(codes[2][0], codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunEnd(activeChar), 30000);
+ ThreadPool.schedule(new RunEnd(activeChar), 30000);
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
index b64a8a1504..0bcd0b583d 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
@@ -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);
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
index bd3295b928..ecfde52eff 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
@@ -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;
@@ -57,7 +57,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();
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/playeractions/SocialAction.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/playeractions/SocialAction.java
index 63f58d424d..f7db8c36f7 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/playeractions/SocialAction.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/playeractions/SocialAction.java
@@ -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;
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 6618f26888..db9e7a1a83 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -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();
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
index 612ca5cdc7..50a74f01fa 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
@@ -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");
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
index 4ca843967c..c165b2658d 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
@@ -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);
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
index 0ae4d70bdf..f0e18f6b8d 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
@@ -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);
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
index 7f2ed62f90..856942597c 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
@@ -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;
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
index 4baa7c3145..6e86e46b09 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
@@ -23,8 +23,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -202,7 +202,7 @@ public final class CastleDungeon extends AbstractInstance
*/
private void spawnRaid(Instance instance)
{
- final ScheduledFuture> spawnTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> spawnTask = ThreadPool.schedule(() ->
{
// Get template id of raid
final int npcId;
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
index 517ae46248..87fe82da43 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
@@ -25,8 +25,8 @@ import java.util.logging.Level;
import java.util.stream.IntStream;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
@@ -111,7 +111,7 @@ public final class ChamberOfDelusion extends AbstractInstance
changeRoom(instance);
// Start banish task
- final ScheduledFuture> banishTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ final ScheduledFuture> banishTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (instance.getRemainingTime() < 60000)
{
@@ -414,7 +414,7 @@ public final class ChamberOfDelusion extends AbstractInstance
final long nextInterval = (bossRoom) ? 60000L : (ROOM_CHANGE_INTERVAL + getRandom(ROOM_CHANGE_RANDOM_TIME)) * 1000L;
if (world.getRemainingTime() > nextInterval)
{
- final ScheduledFuture> roomChangeTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> roomChangeTask = ThreadPool.schedule(() ->
{
try
{
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
index 591730785d..a77b62959c 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
@@ -23,8 +23,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -225,7 +225,7 @@ public final class FortressDungeon extends AbstractInstance
*/
private void spawnRaid(Instance instance)
{
- final ScheduledFuture> spawnTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> spawnTask = ThreadPool.schedule(() ->
{
// Get template id of raid
final int npcId;
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
index 9e5daeb716..547652d4b0 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
@@ -16,8 +16,8 @@
*/
package quests.Q10292_SevenSignsGirlOfDoubt;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -160,7 +160,7 @@ public final class Q10292_SevenSignsGirlOfDoubt extends Quest
creature1.setRandomWalking(true);
final L2Npc creature2 = addSpawn(CREATURE_OF_THE_DUSK2, 89524, -238131, -9632, 56, false, 0, false, player.getInstanceId());
creature2.setRandomWalking(true);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
creature1.deleteMe();
creature2.deleteMe();
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
index 0d98846433..b2f7557291 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
@@ -16,7 +16,7 @@
*/
package quests.Q10742_AFurryFriend;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -228,6 +228,6 @@ public final class Q10742_AFurryFriend extends Quest
public void onRouteFinished(L2Npc npc)
{
WalkingManager.getInstance().cancelMoving(npc);
- ThreadPoolManager.schedule(() -> npc.deleteMe(), 1000);
+ ThreadPool.schedule(() -> npc.deleteMe(), 1000);
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/AirShipController.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/AirShipController.java
index bd5264cfe0..bcd888210f 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/AirShipController.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/AirShipController.java
@@ -19,7 +19,7 @@ package vehicles;
import java.util.concurrent.Future;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.Movie;
import com.l2jmobius.gameserver.instancemanager.AirShipManager;
@@ -291,11 +291,11 @@ public abstract class AirShipController extends AbstractNpcAI
playMovie(_dockedShip.getPassengers(), _movie);
}
- ThreadPoolManager.schedule(_decayTask, 1000);
+ ThreadPool.schedule(_decayTask, 1000);
}
else
{
- _departSchedule = ThreadPoolManager.schedule(_departTask, DEPART_INTERVAL);
+ _departSchedule = ThreadPool.schedule(_departTask, DEPART_INTERVAL);
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
index 8f320c15d9..699a792202 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
@@ -16,7 +16,7 @@
*/
package vehicles.AirShipGludioGracia;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.AirShipManager;
import com.l2jmobius.gameserver.model.L2World;
@@ -251,7 +251,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
{
// _ship.teleToLocation(-167874, 256731, -509, 41035, false);
_ship.setOustLoc(OUST_GRACIA);
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
break;
}
case 2:
@@ -264,7 +264,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
broadcastInGracia(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_ADEN_CONTINENT_IN_1_MINUTE);
_ship.setInDock(GRACIA_DOCK_ID);
_ship.oustPlayers();
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
case 4:
@@ -278,7 +278,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
{
// _ship.teleToLocation(-157261, 255664, 221, 64781, false);
_ship.setOustLoc(OUST_GLUDIO);
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
break;
}
case 6:
@@ -291,7 +291,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
broadcastInGludio(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_GRACIA_CONTINENT_IN_1_MINUTE);
_ship.setInDock(GLUDIO_DOCK_ID);
_ship.oustPlayers();
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatGludinRune.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatGludinRune.java
index b03d55dc79..c162606bf1 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatGludinRune.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatGludinRune.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -176,19 +176,19 @@ public class BoatGludinRune implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -198,25 +198,25 @@ public class BoatGludinRune implements Runnable
_boat.broadcastPacket(GLUDIN_SOUND);
_boat.payForRide(7905, 1, -90015, 150422, -3610);
_boat.executePath(GLUDIN_TO_RUNE);
- ThreadPoolManager.schedule(this, 250000);
+ ThreadPool.schedule(this, 250000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 6:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 7:
@@ -239,7 +239,7 @@ public class BoatGludinRune implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(RUNE_DOCK);
@@ -250,25 +250,25 @@ public class BoatGludinRune implements Runnable
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2);
_boat.broadcastPacket(RUNE_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 10:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 11:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 12:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 13:
@@ -278,25 +278,25 @@ public class BoatGludinRune implements Runnable
_boat.broadcastPacket(RUNE_SOUND);
_boat.payForRide(7904, 1, 34513, -38009, -3640);
_boat.executePath(RUNE_TO_GLUDIN);
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
case 14:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 15:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 16:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 17:
@@ -319,7 +319,7 @@ public class BoatGludinRune implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(GLUDIN_DOCK);
@@ -330,7 +330,7 @@ public class BoatGludinRune implements Runnable
BoatManager.getInstance().dockShip(BoatManager.GLUDIN_HARBOR, true);
BoatManager.getInstance().broadcastPackets(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVED_AT_GLUDIN, ARRIVED_AT_GLUDIN_2);
_boat.broadcastPacket(GLUDIN_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatInnadrilTour.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
index b2462e8c54..1805617eaf 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -119,19 +119,19 @@ public class BoatInnadrilTour implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -139,31 +139,31 @@ public class BoatInnadrilTour implements Runnable
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, LEAVING_INNADRIL, INNADRIL_SOUND);
_boat.payForRide(0, 1, 107092, 219098, -3952);
_boat.executePath(TOUR);
- ThreadPoolManager.schedule(this, 650000);
+ ThreadPool.schedule(this, 650000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL20);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 6:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 7:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 8:
@@ -174,7 +174,7 @@ public class BoatInnadrilTour implements Runnable
case 9:
{
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, ARRIVED_AT_INNADRIL, INNADRIL_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatRunePrimeval.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
index fee83279f1..c04177df76 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -120,7 +120,7 @@ public class BoatRunePrimeval implements Runnable
case 1:
{
BoatManager.getInstance().broadcastPackets(PRIMEVAL_DOCK, RUNE_DOCK[0], ARRIVED_AT_PRIMEVAL, ARRIVED_AT_PRIMEVAL_2, PRIMEVAL_SOUND);
- ThreadPoolManager.schedule(this, 180000);
+ ThreadPool.schedule(this, 180000);
break;
}
case 2:
@@ -145,7 +145,7 @@ public class BoatRunePrimeval implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(RUNE_DOCK);
@@ -155,7 +155,7 @@ public class BoatRunePrimeval implements Runnable
{
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], PRIMEVAL_DOCK, ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2, RUNE_SOUND);
- ThreadPoolManager.schedule(this, 180000);
+ ThreadPool.schedule(this, 180000);
break;
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ThreadPoolManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/concurrent/ThreadPool.java
similarity index 98%
rename from L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ThreadPoolManager.java
rename to L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/concurrent/ThreadPool.java
index c9777e9c56..63b620ce4e 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ThreadPoolManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/concurrent/ThreadPool.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-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;
* Instant pool handles short-life events.
*
*/
-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;
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java
index e440ffffae..7e97632161 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java
@@ -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;
@@ -183,7 +184,7 @@ public class GameServer
}
printSection("ThreadPool");
- ThreadPoolManager.init();
+ ThreadPool.init();
EventDispatcher.getInstance();
// load script engines
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
index 777bcbbd43..a4fc1b00a2 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -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()
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/RecipeController.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/RecipeController.java
index 0bd69dc604..06c67d16e2 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/RecipeController.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/RecipeController.java
@@ -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
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/Shutdown.java
index 2878a9df1b..2e99f8f99f 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/Shutdown.java
@@ -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)
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/AbstractAI.java
index b0de12e3a7..1955d24a1b 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/AbstractAI.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/AbstractAI.java
@@ -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
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
index 6fc8e2db7b..e39af75c7a 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
index d75219e0a7..852194d0e7 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
@@ -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
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2DoorAI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
index 1c536565b1..863a88a54e 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
@@ -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
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2SummonAI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
index d0d6ef1cc4..fa06b60c27 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index 258e120fa2..9005a7c1ec 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -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)
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
index 699808b0fe..3f2fe830c7 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
@@ -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)
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/BotReportTable.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
index d525c02a6a..555223ce4f 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/ItemTable.java
index 1723520fa2..c8f34ed812 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/ItemTable.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/datatables/ItemTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
index b81189c6db..3965ca6cbf 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
@@ -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.");
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index d2b606a72a..6a9dff749b 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -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()
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
index 62d750ea6e..4f8594ee49 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
@@ -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));
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
index d15bee76d5..e16e1eb679 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
@@ -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)));
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index f4d39d153f..af7835fe63 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -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);
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
index 16a0da92bc..65b7775e2f 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
@@ -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)
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index c6537d2d80..14f412ec48 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -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;
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
index c06464b525..9c43355936 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
@@ -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)
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
index dbcfdb4423..2f33b08a7b 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 926b637642..e8b430a5df 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -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();
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/MailManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
index 9a562ecf61..58b75f592d 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
@@ -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)
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 1a6bdcfebb..a29ed155fc 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -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);
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
index 478e1f78f5..c1df0ca78b 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
@@ -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() + ".");
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
index e9c54b975a..a7a85e7181 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/ClanWar.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/ClanWar.java
index 61a97fa208..eea3375661 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/ClanWar.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/ClanWar.java
@@ -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());
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CreatureContainer.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CreatureContainer.java
index da2d7bcc94..91d8c1f632 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CreatureContainer.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CreatureContainer.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CursedWeapon.java
index d6c5f1374b..d579628d09 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CursedWeapon.java
@@ -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;
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/DropProtection.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/DropProtection.java
index 50a3cc2145..a6aef4bdc4 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/DropProtection.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/DropProtection.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/Fishing.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/Fishing.java
index 2b7cb1e44b..9e5a0a9df5 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/Fishing.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/Fishing.java
@@ -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));
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Clan.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Clan.java
index 77faa268ca..08b62e547b 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Clan.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Clan.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Party.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Party.java
index 5b6e9281fe..5f14864046 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Party.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Party.java
@@ -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));
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Request.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Request.java
index a65b9b6a50..dafa0f378e 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Request.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Request.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java
index 06b8d89b88..723bae6bfd 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 693ba7ad57..6bfaf3a33d 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/MpRewardTask.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/MpRewardTask.java
index cf4458c3a4..827e7e936f 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/MpRewardTask.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/MpRewardTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
index e82c15218f..67e20df0bb 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
@@ -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
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index e39c93014d..af22b8d62e 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -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)
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
index 7cc8062431..8679593b56 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
@@ -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())
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
index 3f2fcfb5dc..94fe6bb6b5 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
index 3d61e79b4e..8bdacda8a8 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
@@ -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());
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
index 8f14bf5519..6c554e10e0 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
@@ -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
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
index f47eab9638..4fb7bbb976 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
index b982a00c9f..a1606ac209 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
index 40e9d7e6cb..77f359b315 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
@@ -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;
@@ -825,7 +825,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);
}
}
@@ -2840,7 +2840,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);
}
}
@@ -2863,7 +2863,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);
}
}
@@ -7768,7 +7768,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;
@@ -7959,7 +7959,7 @@ public final class L2PcInstance extends L2Playable
final long currentTime = System.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
- _hennaRemoveSchedules.put(i, ThreadPoolManager.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
+ _hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
}
// Reward henna skills
@@ -8071,7 +8071,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));
}
}
@@ -8680,7 +8680,7 @@ public final class L2PcInstance extends L2Playable
_inventoryDisable = val;
if (val)
{
- ThreadPoolManager.schedule(new InventoryEnableTask(this), 1500);
+ ThreadPool.schedule(new InventoryEnableTask(this), 1500);
}
}
@@ -9504,7 +9504,7 @@ public final class L2PcInstance extends L2Playable
{
if (_skillListRefreshTask == null)
{
- _skillListRefreshTask = ThreadPoolManager.schedule(() ->
+ _skillListRefreshTask = ThreadPool.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
@@ -9975,7 +9975,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);
}
}
@@ -10001,7 +10001,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);
}
}
@@ -10032,7 +10032,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);
}
}
@@ -10413,7 +10413,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);
}
}
}
@@ -11307,7 +11307,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);
}
}
@@ -11427,7 +11427,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);
}
@@ -11799,7 +11799,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)
@@ -11809,7 +11809,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);
}
}
}
@@ -11886,7 +11886,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()
@@ -12007,7 +12007,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);
}
/**
@@ -13046,7 +13046,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();
@@ -13988,7 +13988,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()
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
index 652a1ca0fa..5718895451 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
index d398e89c03..cdca1b721f 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.MonsterRace;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -106,26 +106,26 @@ public class L2RaceManagerInstance extends L2Npc
_managers = new CopyOnWriteArrayList<>();
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
}
_managers.add(this);
}
@@ -253,7 +253,7 @@ public class L2RaceManagerInstance extends L2Npc
_packet = new MonRaceInfo(_codes[1][0], _codes[1][1], race.getMonsters(), race.getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunRace(), 5000);
+ ThreadPool.schedule(new RunRace(), 5000);
}
else
{
@@ -558,7 +558,7 @@ public class L2RaceManagerInstance extends L2Npc
{
_packet = new MonRaceInfo(_codes[2][0], _codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunEnd(), 30000);
+ ThreadPool.schedule(new RunEnd(), 30000);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
index 7b95a8d218..4b4f6d1f00 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
@@ -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()
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
index bbe7fd3e89..2c113f3992 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
index eb169af1ce..d5549be287 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
@@ -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.YOUR_BASE_IS_BEING_ATTACKED));
setCanTalk(false);
- ThreadPoolManager.schedule(new ScheduleTalkTask(), 20000);
+ ThreadPool.schedule(new ScheduleTalkTask(), 20000);
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
index 0a04416d20..3d3a67f2b9 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
@@ -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
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
index 60e018bb0f..32b74ba8eb 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
@@ -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()
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
index 7950d61315..5e68cb589e 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
@@ -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()
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
index 9af40f494e..352a7719ae 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 6f37725f33..dc787cbc19 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -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
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
index a6ffb508f1..3fa6773fd2 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
index b15e938ffe..192da08f4e 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
@@ -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)
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
index 4dff07f0c4..5c5e479600 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
@@ -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);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
index 7d2ed5035b..a47ba1a0a5 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/buylist/Product.java
index 0da19f8ec7..97571235ed 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/buylist/Product.java
@@ -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
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
index a5c90d0c95..f2fb12dc19 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
@@ -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()
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
index 58eab32cb0..d77bf6af86 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
@@ -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)
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Castle.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Castle.java
index f1aa77737c..a6faf0b0df 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Castle.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Castle.java
@@ -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
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/ClanHall.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
index 2cfbef3323..d41afdb68a 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
@@ -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();
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Duel.java
index 09536b2aef..d601203f8d 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Duel.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Duel.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Fort.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Fort.java
index d892c13f8c..e9b3160a50 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Fort.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Fort.java
@@ -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
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/FortSiege.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
index 43e89644c5..053af69e9d 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Siege.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Siege.java
index 00ff234699..c3b017869d 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Siege.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Siege.java
@@ -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();
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index 8f25107013..f09be6765f 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -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);
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
index 2e551991b6..c25f5189f6 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
index 2fdc072c9f..2e334ae7ed 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
@@ -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 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);
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
index 70464afd7c..65d29d5c01 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -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
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index 34c893a2b6..c538e405ae 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -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)
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 17a9b42f56..5c81ea0b72 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -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;
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 407130b911..2e12063fd7 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
index 724b7229fc..38d0fa7c13 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -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");
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index 06c89cb134..d18e278286 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index bc8f5d0bc3..d4720828f5 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -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()));
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 5e7ed370d3..cae533ba54 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
index 0eb81e0589..64f6afb219 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
@@ -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)
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index 9b93abc89c..497bcd5aec 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -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());
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
index 6fb07987fe..64f04389a2 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
@@ -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:
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index 9696330565..9ac2dd32b5 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -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);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
index 451d9a575b..7758ffe098 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
@@ -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());
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
index 0f57c18729..66b9f7e4b2 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
@@ -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()
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
index dd4d99799e..bccb1a9fdb 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
@@ -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()
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
index 9801290712..38c9a63329 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
index f9ff489d33..043a66b6f4 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
@@ -20,8 +20,8 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +150,7 @@ public final class L2EffectZone extends L2ZoneType
{
if (getSettings().getTask() == null)
{
- getSettings().setTask(ThreadPoolManager.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
+ getSettings().setTask(ThreadPool.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
index 6814af7a3a..71d8f10b3e 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.lang.ref.WeakReference;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.PcCondOverride;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -47,7 +47,7 @@ public class L2FishingZone extends L2ZoneType
if ((Config.ALLOW_FISHING || character.canOverrideCond(PcCondOverride.ZONE_CONDITIONS)) && !character.isInsideZone(ZoneId.FISHING))
{
final WeakReference weakPlayer = new WeakReference<>(character.getActingPlayer());
- ThreadPoolManager.execute(new Runnable()
+ ThreadPool.execute(new Runnable()
{
@Override
public void run()
@@ -69,7 +69,7 @@ public class L2FishingZone extends L2ZoneType
player.sendPacket(ExAutoFishAvailable.NO);
}
}
- ThreadPoolManager.schedule(this, 1500);
+ ThreadPool.schedule(this, 1500);
}
else
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
index 13e3744d6c..6511752492 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -77,7 +77,7 @@ public class L2JailZone extends L2ZoneType
if (player.isJailed())
{
// when a player wants to exit jail even if he is still jailed, teleport him back to jail
- ThreadPoolManager.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
+ ThreadPool.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
character.sendMessage("You cannot cheat your way out of here. You must wait until your jail time is over.");
}
if (Config.JAIL_DISABLE_TRANSACTION)
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
index 94b5594d11..c0ffa52989 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.ArrayList;
import java.util.List;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.Location;
@@ -130,7 +130,7 @@ public class L2OlympiadStadiumZone extends L2ZoneRespawn
// only participants, observers and GMs allowed
if (!player.canOverrideCond(PcCondOverride.ZONE_CONDITIONS) && !player.isInOlympiadMode() && !player.inObserverMode())
{
- ThreadPoolManager.execute(new KickPlayer(player));
+ ThreadPool.execute(new KickPlayer(player));
}
else
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
index 063cd551e6..cb7760aee0 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
@@ -18,8 +18,8 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -62,7 +62,7 @@ public class L2ResidenceHallTeleportZone extends L2ResidenceTeleportZone
{
if ((_teleTask == null) || _teleTask.isDone())
{
- _teleTask = ThreadPoolManager.schedule(new TeleportTask(), 30000);
+ _teleTask = ThreadPool.schedule(new TeleportTask(), 30000);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
index ca1ec6ed1a..3d7911ed2a 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.CategoryType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.tasks.player.FlyMoveStartTask;
@@ -59,7 +59,7 @@ public class L2SayuneZone extends L2ZoneType
if (character.isPlayer() && (character.isInCategory(CategoryType.SIXTH_CLASS_GROUP) || Config.FREE_JUMPS_FOR_ALL) && !character.getActingPlayer().isMounted() && !character.isTransformed())
{
character.setInsideZone(ZoneId.SAYUNE, true);
- ThreadPoolManager.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
+ ThreadPool.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/Disconnection.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/Disconnection.java
index 8c839bb573..dd0aefae85 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/Disconnection.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/Disconnection.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.network;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventDispatcher;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogout;
@@ -183,7 +183,7 @@ public final class Disconnection
{
if (_activeChar != null)
{
- ThreadPoolManager.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
+ ThreadPool.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 901665ac2a..6c6b755605 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -17,9 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.LoginServerThread;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.sql.impl.AnnouncementsTable;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
@@ -658,7 +658,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.ENABLE_ATTENDANCE_REWARDS)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Check if player can receive reward today.
final AttendanceInfoHolder attendanceInfo = activeChar.getAttendanceInfo();
@@ -678,7 +678,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.HARDWARE_INFO_ENABLED)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (client.getHardwareInfo() == null)
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
index c1d19b5e5b..274d425f02 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
@@ -101,7 +101,7 @@ public final class RequestDuelStart implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_BEEN_CHALLENGED_TO_A_DUEL);
sm.addString(name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, name), 10000);
activeChar.blockRequest();
return;
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
index aa110b024b..817c5d9296 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.enums.PartyDistributionType;
import com.l2jmobius.gameserver.model.BlockList;
@@ -82,7 +82,7 @@ public final class RequestJoinParty implements IClientIncomingPacket
requestor.sendPacket(sm);
if (!requestor.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(requestor), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(requestor), 10000);
requestor.blockRequest();
}
else
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
index 37c539556f..9e6d7ce7be 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2World;
@@ -80,7 +80,7 @@ public final class RequestJoinPledge implements IClientIncomingPacket
{
if (!activeChar.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
index d9cc2097df..7e97a40c3f 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
@@ -21,8 +21,8 @@ import java.util.Map;
import java.util.logging.Level;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.L2Object;
@@ -241,7 +241,7 @@ public final class RequestPreviewItem implements IClientIncomingPacket
{
activeChar.sendPacket(new ShopPreviewInfo(itemList));
// Schedule task
- ThreadPoolManager.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
+ ThreadPool.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 31e80f64fb..7ba8a189b4 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.FortManager;
@@ -114,7 +114,7 @@ public final class RequestRestartPoint implements IClientIncomingPacket
if ((activeChar.getClan() != null) && castle.getSiege().checkIsAttacker(activeChar.getClan()))
{
// Schedule respawn delay for attacker
- ThreadPoolManager.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
+ ThreadPool.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
if (castle.getSiege().getAttackerRespawnDelay() > 0)
{
activeChar.sendMessage("You will be re-spawned in " + (castle.getSiege().getAttackerRespawnDelay() / 1000) + " seconds");
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
index 7675b1221d..27dadd4973 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.datatables.BotReportTable;
import com.l2jmobius.gameserver.enums.PrivateStoreType;
@@ -129,7 +129,7 @@ public final class TradeRequest implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_REQUESTED_A_TRADE_WITH_C1);
sm.addString(name);
player.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(player, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(player, name), 10000);
player.blockRequest();
}
else
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
index de78415a4b..5999d7d02c 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.NextAction;
@@ -247,7 +247,7 @@ public final class UseItem implements IClientIncomingPacket
}
else if (activeChar.isAttackingNow())
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Removed for preventing retail behavior.
// if (activeChar.isAttackingNow()) // If character is still engaged in strike we should not change weapon
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
index f14c3fa651..5c0b6915bc 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets.friend;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.L2World;
@@ -65,7 +65,7 @@ public final class RequestFriendInvite implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_VE_REQUESTED_C1_TO_BE_ON_YOUR_FRIENDS_LIST);
sm.addString(_name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
index 4fe79bf68d..b6e739add1 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.serverpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketWriter;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.OutgoingPackets;
@@ -56,7 +56,7 @@ public class ExAlterSkillRequest implements IClientOutgoingPacket
if (_alterTime > 0)
{
_player.setAlterSkillActive(true);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
_player.sendPacket(new ExAlterSkillRequest(null, -1, -1, -1));
_player.setAlterSkillActive(false);
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9cd2ebed02..9f26c91ac6 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
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.L2Summon;
import com.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -45,7 +45,7 @@ public class AttackStanceTaskManager
*/
protected AttackStanceTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
+ ThreadPool.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 9e9dde878c..942d4215db 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
@@ -65,7 +65,7 @@ public final class DecayTaskManager
if (!_decayTasks.containsKey(character))
{
- _decayTasks.put(character, ThreadPoolManager.schedule(new DecayTask(character), delay * 1000));
+ _decayTasks.put(character, ThreadPool.schedule(new DecayTask(character), delay * 1000));
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
index 5d9816577a..7f86a2bfb3 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -35,8 +35,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.taskmanager.tasks.TaskBirthday;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskRestart;
@@ -235,14 +235,14 @@ public final class TaskManager
case TYPE_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
- task.scheduled = ThreadPoolManager.schedule(task, delay);
+ task.scheduled = ThreadPool.schedule(task, delay);
return true;
}
case TYPE_FIXED_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
interval = Long.valueOf(task.getParams()[1]);
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
case TYPE_TIME:
@@ -253,7 +253,7 @@ public final class TaskManager
final long diff = desired.getTime() - System.currentTimeMillis();
if (diff >= 0)
{
- task.scheduled = ThreadPoolManager.schedule(task, diff);
+ task.scheduled = ThreadPool.schedule(task, diff);
return true;
}
LOGGER.info("Task " + task.getId() + " is obsoleted.");
@@ -306,7 +306,7 @@ public final class TaskManager
{
delay += interval;
}
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
default:
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/Evolve.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/Evolve.java
index 80a1c892c6..7fae394d24 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/Evolve.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/Evolve.java
@@ -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.database.DatabaseFactory;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.PetDataTable;
import com.l2jmobius.gameserver.model.L2PetData;
@@ -142,11 +142,11 @@ public final class Evolve
petSummon.startFeed();
item.setEnchantLevel(petSummon.getLevel());
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
@@ -236,11 +236,11 @@ public final class Evolve
player.broadcastUserInfo();
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/MinionList.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/MinionList.java
index fda128217e..271b3ea3d9 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/MinionList.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/MinionList.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -141,7 +141,7 @@ public class MinionList
final int time = respawnTime < 0 ? _master.isRaid() ? (int) Config.RAID_MINION_RESPAWN_TIMER : 0 : respawnTime;
if ((time > 0) && !_master.isAlikeDead())
{
- ThreadPoolManager.schedule(new MinionRespawnTask(minion), time);
+ ThreadPool.schedule(new MinionRespawnTask(minion), time);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/Util.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/Util.java
index 0508148f16..b075bfc1d2 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/Util.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/util/Util.java
@@ -38,9 +38,9 @@ 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.Rnd;
import com.l2jmobius.commons.util.file.filter.ExtFilter;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.HtmlActionScope;
import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import com.l2jmobius.gameserver.model.L2Object;
@@ -64,7 +64,7 @@ public final class Util
public static void handleIllegalPlayerAction(L2PcInstance actor, String message, IllegalActionPunishmentType punishment)
{
- ThreadPoolManager.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
+ ThreadPool.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
index 3619de52a6..b21c9b9df7 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java
@@ -16,8 +16,8 @@
*/
package ai.areas.DenOfDevil;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
@@ -127,7 +127,7 @@ public final class DenOfEvil extends AbstractNpcAI
zone.addSkill(skillId, skillLevel + 1);
if (skillLevel == 3) // 3+1=4
{
- ThreadPoolManager.schedule(new KashaDestruction(zone), 2 * 60 * 1000l);
+ ThreadPool.schedule(new KashaDestruction(zone), 2 * 60 * 1000l);
zone.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.DEFEAT_KASHA_S_EYES_TO_LIFT_THE_GREAT_CURSE));
}
else if (skillLevel == 2)
@@ -140,7 +140,7 @@ public final class DenOfEvil extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
- ThreadPoolManager.schedule(new RespawnNewEye(npc.getLocation()), 15000);
+ ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
if (zone == null)
{
@@ -213,7 +213,7 @@ public final class DenOfEvil extends AbstractNpcAI
final L2Npc npc = (L2Npc) character;
if (CommonUtil.contains(EYE_IDS, npc.getId()))
{
- ThreadPoolManager.schedule(new RespawnNewEye(npc.getLocation()), 15000);
+ ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
index 21f7d8c4cb..23514e5981 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
@@ -20,8 +20,8 @@ import java.text.SimpleDateFormat;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
+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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -129,7 +129,7 @@ public final class Parade extends AbstractNpcAI
{
// Starts at 8:00 and repeats every 6 hours.
final long diff = timeLeftMilli(8, 0, 0), cycle = 3600000L;
- ThreadPoolManager.scheduleAtFixedRate(new Start(), diff, cycle);
+ ThreadPool.scheduleAtFixedRate(new Start(), diff, cycle);
// Test - Starts 3 minutes after server startup and repeats every 20 minutes.
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000L;
@@ -167,9 +167,9 @@ public final class Parade extends AbstractNpcAI
public void run()
{
load();
- spawnTask = ThreadPoolManager.scheduleAtFixedRate(new Spawn(), 0, 5000);
- deleteTask = ThreadPoolManager.scheduleAtFixedRate(new Delete(), 10000, 1000);
- cleanTask = ThreadPoolManager.schedule(new Clean(), 420000);
+ spawnTask = ThreadPool.scheduleAtFixedRate(new Spawn(), 0, 5000);
+ deleteTask = ThreadPool.scheduleAtFixedRate(new Delete(), 10000, 1000);
+ cleanTask = ThreadPool.schedule(new Clean(), 420000);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java
index e730e1d3c4..f8b824d674 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/GainakSiege.java
@@ -17,7 +17,7 @@
package ai.areas.GainakUnderground;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -140,7 +140,7 @@ public final class GainakSiege extends AbstractNpcAI
final L2SiegeZone zone = ZoneManager.getInstance().getZone(npc, L2SiegeZone.class);
if ((zone != null) && (zone.getId() == 60019) && zone.isActive())
{
- ThreadPoolManager.schedule(new RespawnNewAssassin(npc.getLocation()), 60000);
+ ThreadPool.schedule(new RespawnNewAssassin(npc.getLocation()), 60000);
}
return super.onKill(npc, killer, isSummon);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
index 954afd0819..e67e5ea74d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
@@ -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.enums.ChatType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -256,7 +256,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
if ((doorInfo[0] == sepulcherId) && (doorInfo[1] == currentWave))
{
openDoor(doorInfo[2], 0);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
closeDoor(doorInfo[2], 0);
}, 15000);
@@ -578,7 +578,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
showHtmlFile(player, npcId + "-OK.html", npc, null);
// Kick all players when/if time is over
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers();
}, TIME_ATTACK * 60 * 1000);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
index b1a37e194f..627cf622d0 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/Rune/AltarOfSacrifice/AltarOfSacrifice.java
@@ -16,7 +16,7 @@
*/
package ai.areas.Rune.AltarOfSacrifice;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -109,7 +109,7 @@ public class AltarOfSacrifice extends AbstractNpcAI
private void sendMessage(L2Npc npc, NpcStringId npcString, int delay)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (npc != null)
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
index 1a41e95122..e795fad37e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/TalkingIsland/AwakeningMaster/AwakeningMaster.java
@@ -20,7 +20,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.enums.CategoryType;
@@ -340,7 +340,7 @@ public final class AwakeningMaster extends AbstractNpcAI
player.sendSkillList();
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
player.sendPacket(ExShowUsm.AWAKENING_END);
}, 10000);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
index 58750ad197..569eff3cfe 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/TalkingIsland/HarnakUndergroundRuinsZone/HarnakUndergroundRuinsZone.java
@@ -22,7 +22,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -174,7 +174,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic")), null));
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
currentInfo.setZoneStage(7);
- ThreadPoolManager.schedule(new changeZoneStage(zone), 600000); // 10min
+ ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min
}
else
{
@@ -202,7 +202,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (currentInfo.getZoneStage() < 6)
{
currentInfo.setZoneStage(currentInfo.getZoneStage() + 1);
- ThreadPoolManager.schedule(new changeZoneStage(zone), 5000);
+ ThreadPool.schedule(new changeZoneStage(zone), 5000);
}
}
catch (Exception e)
@@ -248,7 +248,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (calcPoints >= 300)
{
calcPoints = 300;
- ThreadPoolManager.schedule(new changeZoneStage(currentZone.getKey()), 1000);
+ ThreadPool.schedule(new changeZoneStage(currentZone.getKey()), 1000);
}
currentInfo.setCurrentPoint(calcPoints);
for (L2PcInstance player : currentZone.getKey().getPlayersInside())
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
index 7e11d3b4d1..33344e3f16 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
@@ -21,8 +21,8 @@ import java.util.List;
import java.util.concurrent.ScheduledFuture;
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.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.ChatType;
@@ -303,7 +303,7 @@ public class Lindvior extends AbstractNpcAI
}
else if ((percent <= 75) && (_status == 1))
{
- _bigVortexesTask = ThreadPoolManager.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
+ _bigVortexesTask = ThreadPool.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
addSpawn(LINDVIOR_SERVITOR[1], loc, true);
@@ -324,7 +324,7 @@ public class Lindvior extends AbstractNpcAI
{
addSpawn(LINDVIOR_SERVITOR[2], loc, true);
}
- _skillCastTask = ThreadPoolManager.scheduleAtFixedRate(() -> _lindvior.doCast(SKILL_REFLECT.getSkill()), 5000, 80000);
+ _skillCastTask = ThreadPool.scheduleAtFixedRate(() -> _lindvior.doCast(SKILL_REFLECT.getSkill()), 5000, 80000);
_status = 3;
}
else if ((percent <= 40) && (_status == 3))
@@ -348,7 +348,7 @@ public class Lindvior extends AbstractNpcAI
}
else if ((percent <= 35) && (_status == 4))
{
- _smallVortexesTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _smallVortexesTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
@@ -372,14 +372,14 @@ public class Lindvior extends AbstractNpcAI
_lindvior.deleteMe();
_lindvior = (L2GrandBossInstance) addSpawn(LINDVIOR_RAID, _lindvior.getLocation(), false, 0, false);
_lindvior.setCurrentHp(_lindvior.getMaxHp() * 0.2);
- _bigVortexesTask = ThreadPoolManager.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
+ _bigVortexesTask = ThreadPool.schedule(() -> spawnServitor(1, 300, _lindvior.getLocation(), NPC_ATTACKER_BIG_VORTEX), 1000);
for (Location loc : ATTACKER_SMALL_VORTEX_SPAWNS)
{
addSpawn(NPC_ATTACKER_SMALL_VORTEX, loc, true);
addSpawn(LINDVIOR_SERVITOR[4], loc, true);
addSpawn(LINDVIOR_SERVITOR[3], loc, true);
}
- _collapseTask = ThreadPoolManager.schedule(Lindvior.this::Clean, 600000);
+ _collapseTask = ThreadPool.schedule(Lindvior.this::Clean, 600000);
_status = 6;
}
return super.onAttack(npc, attacker, damage, isSummon);
@@ -580,7 +580,7 @@ public class Lindvior extends AbstractNpcAI
_guardSpawn.add(npc);
}
- _mobsSpawnTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : ATTACKER_GENERATOR_SPAWNS)
{
@@ -596,7 +596,7 @@ public class Lindvior extends AbstractNpcAI
}, 30000, 80000);
_dummyLindvior = addSpawn(LINDVIOR_CAMERA, 45259, -27115, -638, 41325, false, 0, false);
- _announceTask = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_MUST_ACTIVATE_THE_4_GENERATORS, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 20000);
+ _announceTask = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_MUST_ACTIVATE_THE_4_GENERATORS, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 20000);
break;
}
case 2: // After activation of 4 generators, we wait to be charged
@@ -621,7 +621,7 @@ public class Lindvior extends AbstractNpcAI
{
guard.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ALL_4_GENERATORS_MUST_BE_ACTIVATED);
});
- _announceProtect = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> player.sendPacket(new ExShowScreenMessage(NpcStringId.PROTECT_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 18000);
+ _announceProtect = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> player.sendPacket(new ExShowScreenMessage(NpcStringId.PROTECT_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 10000, 18000);
_zoneLair.broadcastPacket(new SpecialCamera(_dummyLindvior, 3300, 200, 20, 11000, 10500, 0, 8, 1, 0, 0));
_generatorSpawn.forEach(npc -> npc.sendInfo(player));
startQuestTimer("show_movie", 13000, null, null);
@@ -696,7 +696,7 @@ public class Lindvior extends AbstractNpcAI
_zoneLair.broadcastPacket(new SocialAction(_lindvior.getObjectId(), 1));
_zoneLair.getPlayersInside().forEach(_lindvior::sendInfo);
_zoneLair.broadcastPacket(new ExShowScreenMessage(NpcStringId.LINDVIOR_HAS_FALLEN_FROM_THE_SKY, ExShowScreenMessage.TOP_CENTER, 7000));
- _mobsSpawnTask = ThreadPoolManager.scheduleAtFixedRate(() -> spawnServitor(2, 1000, _lindvior.getLocation(), LINDVIOR_SERVITOR), 60000, 180000);
+ _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(() -> spawnServitor(2, 1000, _lindvior.getLocation(), LINDVIOR_SERVITOR), 60000, 180000);
break;
}
}
@@ -749,12 +749,12 @@ public class Lindvior extends AbstractNpcAI
_dummyLindvior.deleteMe();
_lindvior2 = addSpawn(LINDVIOR_FAKE, CENTER_LOCATION, false, 0, false);
_lindvior2.setTargetable(false);
- _announceTask = ThreadPoolManager.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> p.sendPacket(new ExShowScreenMessage(NpcStringId.CHARGE_THE_CANNON_USING_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 40000, 20000);
+ _announceTask = ThreadPool.scheduleAtFixedRate(() -> _zoneLair.getPlayersInside().forEach(p -> p.sendPacket(new ExShowScreenMessage(NpcStringId.CHARGE_THE_CANNON_USING_THE_GENERATOR, ExShowScreenMessage.TOP_CENTER, 7000, true))), 40000, 20000);
break;
}
case "start_charge":
{
- _skillCastTask = ThreadPoolManager.scheduleAtFixedRate(() -> _generatorSpawn.forEach(generators ->
+ _skillCastTask = ThreadPool.scheduleAtFixedRate(() -> _generatorSpawn.forEach(generators ->
{
int index = generators.getScriptValue();
if (!generators.isCastingNow() && (generators.getEffectList().getBuffInfoBySkillId(SKILL_RECHARGE_POSIBLE.getSkillId()) == null) && !hasFlag(_chargedMask, 1 << index))
@@ -780,7 +780,7 @@ public class Lindvior extends AbstractNpcAI
});
}
}), 10000, 20000);
- _LynDracoTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _LynDracoTask = ThreadPool.scheduleAtFixedRate(() ->
{
for (Location loc : LYN_DRACO_SPAWNS)
{
@@ -830,7 +830,7 @@ public class Lindvior extends AbstractNpcAI
_mobsSpawnTask = null;
}
_zoneLair.getCharactersInside().stream().filter(L2Character::isNpc).forEach(mob -> mob.deleteMe());
- ThreadPoolManager.schedule(() -> npc.decayMe(), 10000);
+ ThreadPool.schedule(() -> npc.decayMe(), 10000);
_zoneLair.broadcastPacket(new OnEventTrigger(SECOND_STAGE_EVENT_TRIGGER, false));
_zoneLair.broadcastPacket(new OnEventTrigger(FIRST_STAGE_EVENT_TRIGGER, true));
_lionel.deleteMe();
@@ -846,7 +846,7 @@ public class Lindvior extends AbstractNpcAI
{
_zoneLair.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_GENERATOR_HAS_BEEN_DESTROYED, ExShowScreenMessage.TOP_CENTER, 5000, true));
Clean();
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(false), 20000);
+ _collapseTask = ThreadPool.schedule(() -> Fail(false), 20000);
}
return super.onKill(npc, killer, isSummon);
}
@@ -882,7 +882,7 @@ public class Lindvior extends AbstractNpcAI
{
if (zone.getPlayersInside().isEmpty())
{
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(true), 900000);
+ _collapseTask = ThreadPool.schedule(() -> Fail(true), 900000);
}
}
return super.onExitZone(character, zone);
@@ -940,7 +940,7 @@ public class Lindvior extends AbstractNpcAI
{
if (_socialTask == null)
{
- _socialTask = ThreadPoolManager.schedule(() -> nextStage(1), 3000);
+ _socialTask = ThreadPool.schedule(() -> nextStage(1), 3000);
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index 6c0a28cefe..d66ecbb53e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -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;
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
index 6e8a0db865..9e42c69098 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
@@ -20,8 +20,8 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicInteger;
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.DoorData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.Movie;
@@ -429,7 +429,7 @@ public class Trasken extends AbstractNpcAI
doom.setTarget(doom);
doom.isCastingNow();
doom.doCast(SKILL_1.getSkill());
- ThreadPoolManager.schedule(() -> doom.deleteMe(), 15000);
+ ThreadPool.schedule(() -> doom.deleteMe(), 15000);
}
final double percent = ((npc.getCurrentHp() - damage) / npc.getMaxHp()) * 100.0;
if ((percent <= 30) && (_statusZone == 4))
@@ -616,7 +616,7 @@ public class Trasken extends AbstractNpcAI
_zoneLair.getCharactersInside().stream().filter(L2Object::isMonster).forEach(cha -> ((L2MonsterInstance) cha).getSpawn().stopRespawn());
_zoneLair2.getCharactersInside().stream().filter(L2Character::isNpc).forEach(mob -> mob.deleteMe());
_zoneLair2.getCharactersInside().stream().filter(L2Object::isMonster).forEach(cha -> ((L2MonsterInstance) cha).getSpawn().stopRespawn());
- ThreadPoolManager.schedule(() -> npc.decayMe(), 10000);
+ ThreadPool.schedule(() -> npc.decayMe(), 10000);
cancelQuestTimer("finish", npc, null);
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
@@ -642,7 +642,7 @@ public class Trasken extends AbstractNpcAI
final int[] spawn = Rnd_Spawn_Tail[Rnd.get(Rnd_Spawn_Tail.length)];
if (SpawnTable.getInstance().getSpawns(TAIL_TRASKEN) == null)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
tie_trasken = addSpawn(TAIL_TRASKEN, spawn[0], spawn[1], spawn[2], 0, false, 0, true);
tie_trasken.setCurrentHp(hp_tail);
@@ -663,7 +663,7 @@ public class Trasken extends AbstractNpcAI
final int[] spawn1 = Rnd_Spawn_Trasken[Rnd.get(Rnd_Spawn_Trasken.length)];
if (SpawnTable.getInstance().getSpawns(TRASKEN) == null)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
trasken = addSpawn(TRASKEN, spawn1[0], spawn1[1], spawn1[2], 0, false, 0, true);
trasken.doCast(SKILL_TRASKEN_UP.getSkill());
@@ -774,7 +774,7 @@ public class Trasken extends AbstractNpcAI
}
final int time = 540000;
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 540, 0, NpcStringId.REMAINING_TIME)));
- _collapseTask = ThreadPoolManager.schedule(() -> Fail(true), time);
+ _collapseTask = ThreadPool.schedule(() -> Fail(true), time);
}
return super.onEnterZone(character, zone);
}
@@ -784,7 +784,7 @@ public class Trasken extends AbstractNpcAI
{
if ((zone.getId() == ZONE_ID_HEART) && zone.getPlayersInside().isEmpty())
{
- _collapseTask = ThreadPoolManager.schedule(() ->
+ _collapseTask = ThreadPool.schedule(() ->
{
Fail(true);
for (int info : eventTriggers)
@@ -890,7 +890,7 @@ public class Trasken extends AbstractNpcAI
character.getEffectList().stopSkillEffects(true, traskenBuff.getSkill());
}
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
character.broadcastPacket(new ExShowScreenMessage(NpcStringId.YOU_VE_EXCEEDED_THE_MAXIMUM_NUMBER_OF_PERSONNEL, 5, 24000, true));
character.doCast(SKILL_TRASKEN_SLEEP.getSkill());
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/EnergySeeds.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/EnergySeeds.java
index 546f3b3cc0..30db4dff20 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/EnergySeeds.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/EnergySeeds.java
@@ -20,8 +20,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
@@ -721,7 +721,7 @@ public final class EnergySeeds extends AbstractNpcAI
public void scheduleRespawn(long waitTime)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// if the AI is inactive, do not spawn the NPC
if (isSeedActive(_seedId))
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
index 9cef571b2a..819ba28b77 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/NpcBuffers/NpcBufferAI.java
@@ -18,7 +18,7 @@ package ai.others.NpcBuffers;
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.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -90,6 +90,6 @@ public class NpcBufferAI implements Runnable
_npc.doCast(skill);
- ThreadPoolManager.schedule(this, skill.getReuseDelay());
+ ThreadPool.schedule(this, skill.getReuseDelay());
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
index faf003a11c..a8f7bcc23f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/NpcBuffers/NpcBuffers.java
@@ -16,7 +16,7 @@
*/
package ai.others.NpcBuffers;
-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;
@@ -53,7 +53,7 @@ public final class NpcBuffers extends AbstractNpcAI
final NpcBufferData data = _npcBuffers.getNpcBuffer(npc.getId());
for (NpcBufferSkillData skill : data.getSkills())
{
- ThreadPoolManager.schedule(new NpcBufferAI(npc, skill), skill.getInitialDelay());
+ ThreadPool.schedule(new NpcBufferAI(npc, skill), skill.getInitialDelay());
}
return super.onSpawn(npc);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/events/Elpies/Elpies.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/events/Elpies/Elpies.java
index 604b5bcff8..4ca3d1df97 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/events/Elpies/Elpies.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/events/Elpies/Elpies.java
@@ -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();
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/events/Race/Race.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/events/Race/Race.java
index 8af01c7b29..19f2f42bae 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/events/Race/Race.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/events/Race/Race.java
@@ -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
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
index b986361b8c..51fee14634 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
@@ -16,8 +16,8 @@
*/
package handlers.admincommandhandlers;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.MonsterRace;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -107,7 +107,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunRace(codes, activeChar), 5000);
+ ThreadPool.schedule(new RunRace(codes, activeChar), 5000);
}
}
@@ -137,7 +137,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
final MonRaceInfo spk = new MonRaceInfo(codes[2][0], codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunEnd(activeChar), 30000);
+ ThreadPool.schedule(new RunEnd(activeChar), 30000);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
index b64a8a1504..0bcd0b583d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
@@ -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);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
index bd3295b928..ecfde52eff 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
@@ -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;
@@ -57,7 +57,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();
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/playeractions/SocialAction.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/playeractions/SocialAction.java
index d5242a32a7..fde530a2b4 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/playeractions/SocialAction.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/playeractions/SocialAction.java
@@ -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;
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 6618f26888..db9e7a1a83 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -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();
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
index 612ca5cdc7..50a74f01fa 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
@@ -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");
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
index 4ca843967c..c165b2658d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
@@ -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);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
index 0ae4d70bdf..f0e18f6b8d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
@@ -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);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
index 7f2ed62f90..856942597c 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
@@ -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;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
index 4baa7c3145..6e86e46b09 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
@@ -23,8 +23,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -202,7 +202,7 @@ public final class CastleDungeon extends AbstractInstance
*/
private void spawnRaid(Instance instance)
{
- final ScheduledFuture> spawnTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> spawnTask = ThreadPool.schedule(() ->
{
// Get template id of raid
final int npcId;
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
index 517ae46248..87fe82da43 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/ChambersOfDelusion/ChamberOfDelusion.java
@@ -25,8 +25,8 @@ import java.util.logging.Level;
import java.util.stream.IntStream;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
@@ -111,7 +111,7 @@ public final class ChamberOfDelusion extends AbstractInstance
changeRoom(instance);
// Start banish task
- final ScheduledFuture> banishTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ final ScheduledFuture> banishTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (instance.getRemainingTime() < 60000)
{
@@ -414,7 +414,7 @@ public final class ChamberOfDelusion extends AbstractInstance
final long nextInterval = (bossRoom) ? 60000L : (ROOM_CHANGE_INTERVAL + getRandom(ROOM_CHANGE_RANDOM_TIME)) * 1000L;
if (world.getRemainingTime() > nextInterval)
{
- final ScheduledFuture> roomChangeTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> roomChangeTask = ThreadPool.schedule(() ->
{
try
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
index 591730785d..a77b62959c 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
@@ -23,8 +23,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -225,7 +225,7 @@ public final class FortressDungeon extends AbstractInstance
*/
private void spawnRaid(Instance instance)
{
- final ScheduledFuture> spawnTask = ThreadPoolManager.schedule(() ->
+ final ScheduledFuture> spawnTask = ThreadPool.schedule(() ->
{
// Get template id of raid
final int npcId;
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
index 9e5daeb716..547652d4b0 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
@@ -16,8 +16,8 @@
*/
package quests.Q10292_SevenSignsGirlOfDoubt;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -160,7 +160,7 @@ public final class Q10292_SevenSignsGirlOfDoubt extends Quest
creature1.setRandomWalking(true);
final L2Npc creature2 = addSpawn(CREATURE_OF_THE_DUSK2, 89524, -238131, -9632, 56, false, 0, false, player.getInstanceId());
creature2.setRandomWalking(true);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
creature1.deleteMe();
creature2.deleteMe();
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
index 0d98846433..b2f7557291 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java
@@ -16,7 +16,7 @@
*/
package quests.Q10742_AFurryFriend;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -228,6 +228,6 @@ public final class Q10742_AFurryFriend extends Quest
public void onRouteFinished(L2Npc npc)
{
WalkingManager.getInstance().cancelMoving(npc);
- ThreadPoolManager.schedule(() -> npc.deleteMe(), 1000);
+ ThreadPool.schedule(() -> npc.deleteMe(), 1000);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/AirShipController.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/AirShipController.java
index bd5264cfe0..bcd888210f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/AirShipController.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/AirShipController.java
@@ -19,7 +19,7 @@ package vehicles;
import java.util.concurrent.Future;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.Movie;
import com.l2jmobius.gameserver.instancemanager.AirShipManager;
@@ -291,11 +291,11 @@ public abstract class AirShipController extends AbstractNpcAI
playMovie(_dockedShip.getPassengers(), _movie);
}
- ThreadPoolManager.schedule(_decayTask, 1000);
+ ThreadPool.schedule(_decayTask, 1000);
}
else
{
- _departSchedule = ThreadPoolManager.schedule(_departTask, DEPART_INTERVAL);
+ _departSchedule = ThreadPool.schedule(_departTask, DEPART_INTERVAL);
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
index d3300786a3..f694f32aa1 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
@@ -16,7 +16,7 @@
*/
package vehicles.AirShipGludioGracia;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.AirShipManager;
import com.l2jmobius.gameserver.model.L2World;
@@ -251,7 +251,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
{
// _ship.teleToLocation(-167874, 256731, -509, 41035, false);
_ship.setOustLoc(OUST_GRACIA);
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
break;
}
case 2:
@@ -264,7 +264,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
broadcastInGracia(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_ADEN_CONTINENT_IN_1_MINUTE);
_ship.setInDock(GRACIA_DOCK_ID);
_ship.oustPlayers();
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
case 4:
@@ -278,7 +278,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
{
// _ship.teleToLocation(-157261, 255664, 221, 64781, false);
_ship.setOustLoc(OUST_GLUDIO);
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
break;
}
case 6:
@@ -291,7 +291,7 @@ public final class AirShipGludioGracia extends AbstractNpcAI implements Runnable
broadcastInGludio(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_GRACIA_CONTINENT_IN_1_MINUTE);
_ship.setInDock(GLUDIO_DOCK_ID);
_ship.oustPlayers();
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatGludinRune.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatGludinRune.java
index b03d55dc79..c162606bf1 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatGludinRune.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatGludinRune.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -176,19 +176,19 @@ public class BoatGludinRune implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -198,25 +198,25 @@ public class BoatGludinRune implements Runnable
_boat.broadcastPacket(GLUDIN_SOUND);
_boat.payForRide(7905, 1, -90015, 150422, -3610);
_boat.executePath(GLUDIN_TO_RUNE);
- ThreadPoolManager.schedule(this, 250000);
+ ThreadPool.schedule(this, 250000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 6:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 7:
@@ -239,7 +239,7 @@ public class BoatGludinRune implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(RUNE_DOCK);
@@ -250,25 +250,25 @@ public class BoatGludinRune implements Runnable
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2);
_boat.broadcastPacket(RUNE_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 10:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 11:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 12:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 13:
@@ -278,25 +278,25 @@ public class BoatGludinRune implements Runnable
_boat.broadcastPacket(RUNE_SOUND);
_boat.payForRide(7904, 1, 34513, -38009, -3640);
_boat.executePath(RUNE_TO_GLUDIN);
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
case 14:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 15:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 16:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 17:
@@ -319,7 +319,7 @@ public class BoatGludinRune implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(GLUDIN_DOCK);
@@ -330,7 +330,7 @@ public class BoatGludinRune implements Runnable
BoatManager.getInstance().dockShip(BoatManager.GLUDIN_HARBOR, true);
BoatManager.getInstance().broadcastPackets(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVED_AT_GLUDIN, ARRIVED_AT_GLUDIN_2);
_boat.broadcastPacket(GLUDIN_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatInnadrilTour.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
index b2462e8c54..1805617eaf 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -119,19 +119,19 @@ public class BoatInnadrilTour implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -139,31 +139,31 @@ public class BoatInnadrilTour implements Runnable
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, LEAVING_INNADRIL, INNADRIL_SOUND);
_boat.payForRide(0, 1, 107092, 219098, -3952);
_boat.executePath(TOUR);
- ThreadPoolManager.schedule(this, 650000);
+ ThreadPool.schedule(this, 650000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL20);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 6:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 7:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 8:
@@ -174,7 +174,7 @@ public class BoatInnadrilTour implements Runnable
case 9:
{
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, ARRIVED_AT_INNADRIL, INNADRIL_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatRunePrimeval.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
index fee83279f1..c04177df76 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
@@ -18,7 +18,7 @@ package vehicles;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -120,7 +120,7 @@ public class BoatRunePrimeval implements Runnable
case 1:
{
BoatManager.getInstance().broadcastPackets(PRIMEVAL_DOCK, RUNE_DOCK[0], ARRIVED_AT_PRIMEVAL, ARRIVED_AT_PRIMEVAL_2, PRIMEVAL_SOUND);
- ThreadPoolManager.schedule(this, 180000);
+ ThreadPool.schedule(this, 180000);
break;
}
case 2:
@@ -145,7 +145,7 @@ public class BoatRunePrimeval implements Runnable
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(RUNE_DOCK);
@@ -155,7 +155,7 @@ public class BoatRunePrimeval implements Runnable
{
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], PRIMEVAL_DOCK, ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2, RUNE_SOUND);
- ThreadPoolManager.schedule(this, 180000);
+ ThreadPool.schedule(this, 180000);
break;
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ThreadPoolManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/concurrent/ThreadPool.java
similarity index 98%
rename from L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ThreadPoolManager.java
rename to L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/concurrent/ThreadPool.java
index c9777e9c56..63b620ce4e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ThreadPoolManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/concurrent/ThreadPool.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-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;
* Instant pool handles short-life events.
*
*/
-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;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java
index 51a495291d..475b7ba4bc 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java
@@ -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;
@@ -183,7 +184,7 @@ public class GameServer
}
printSection("ThreadPool");
- ThreadPoolManager.init();
+ ThreadPool.init();
EventDispatcher.getInstance();
// load script engines
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
index 777bcbbd43..a4fc1b00a2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -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()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/Shutdown.java
index 2878a9df1b..2e99f8f99f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/Shutdown.java
@@ -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)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/AbstractAI.java
index b0de12e3a7..1955d24a1b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/AbstractAI.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/AbstractAI.java
@@ -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
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
index 6fc8e2db7b..e39af75c7a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
index d75219e0a7..852194d0e7 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
@@ -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
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2DoorAI.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
index 1c536565b1..863a88a54e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
@@ -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
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2SummonAI.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
index d0d6ef1cc4..fa06b60c27 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index 258e120fa2..9005a7c1ec 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -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)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
index 699808b0fe..3f2fe830c7 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
@@ -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)
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/BotReportTable.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
index 09ef061645..953b0211c9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/ItemTable.java
index 1723520fa2..c8f34ed812 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/ItemTable.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/datatables/ItemTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
index b81189c6db..3965ca6cbf 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
@@ -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.");
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index d2b606a72a..6a9dff749b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -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()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
index 62d750ea6e..4f8594ee49 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
@@ -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));
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
index d15bee76d5..e16e1eb679 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
@@ -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)));
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index f4d39d153f..af7835fe63 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -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);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
index 16a0da92bc..65b7775e2f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
@@ -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)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index c6537d2d80..14f412ec48 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -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;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
index 4704d55126..99c7fa7996 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
@@ -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)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
index 132d0a6b33..3a2ec25c20 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 926b637642..e8b430a5df 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -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();
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/MailManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
index 9a562ecf61..58b75f592d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
@@ -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)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 1a6bdcfebb..a29ed155fc 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -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);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
index 478e1f78f5..c1df0ca78b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
@@ -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() + ".");
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
index e9c54b975a..a7a85e7181 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/ClanWar.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/ClanWar.java
index 61a97fa208..eea3375661 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/ClanWar.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/ClanWar.java
@@ -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());
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/CreatureContainer.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/CreatureContainer.java
index da2d7bcc94..91d8c1f632 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/CreatureContainer.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/CreatureContainer.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/CursedWeapon.java
index d6c5f1374b..d579628d09 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/CursedWeapon.java
@@ -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;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/DropProtection.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/DropProtection.java
index 50a3cc2145..a6aef4bdc4 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/DropProtection.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/DropProtection.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/Fishing.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/Fishing.java
index 42bccf8661..68e1da0a23 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/Fishing.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/Fishing.java
@@ -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));
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Clan.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Clan.java
index 77faa268ca..08b62e547b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Clan.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Clan.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Party.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Party.java
index 5b6e9281fe..5f14864046 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Party.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Party.java
@@ -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));
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Request.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Request.java
index a65b9b6a50..dafa0f378e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Request.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Request.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java
index 06b8d89b88..723bae6bfd 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 693ba7ad57..6bfaf3a33d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/MpRewardTask.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/MpRewardTask.java
index cf4458c3a4..827e7e936f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/MpRewardTask.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/MpRewardTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
index e82c15218f..67e20df0bb 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
@@ -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
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index e39c93014d..af22b8d62e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -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)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
index 7cc8062431..8679593b56 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
@@ -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())
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
index 3f2fcfb5dc..94fe6bb6b5 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
index 3d61e79b4e..8bdacda8a8 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
@@ -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());
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
index 8f14bf5519..6c554e10e0 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
@@ -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
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
index f47eab9638..4fb7bbb976 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
index b982a00c9f..a1606ac209 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
index e363667a77..d3f3126ae3 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
@@ -44,13 +44,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.CommonUtil;
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.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.L2CharacterAI;
import com.l2jmobius.gameserver.ai.L2PlayerAI;
@@ -832,7 +832,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);
}
}
@@ -2831,7 +2831,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);
}
}
@@ -2854,7 +2854,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);
}
}
@@ -7765,7 +7765,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;
@@ -7956,7 +7956,7 @@ public final class L2PcInstance extends L2Playable
final long currentTime = System.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
- _hennaRemoveSchedules.put(i, ThreadPoolManager.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
+ _hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
}
// Reward henna skills
@@ -8068,7 +8068,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));
}
}
@@ -8677,7 +8677,7 @@ public final class L2PcInstance extends L2Playable
_inventoryDisable = val;
if (val)
{
- ThreadPoolManager.schedule(new InventoryEnableTask(this), 1500);
+ ThreadPool.schedule(new InventoryEnableTask(this), 1500);
}
}
@@ -9497,7 +9497,7 @@ public final class L2PcInstance extends L2Playable
{
if (_skillListRefreshTask == null)
{
- _skillListRefreshTask = ThreadPoolManager.schedule(() ->
+ _skillListRefreshTask = ThreadPool.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
@@ -9968,7 +9968,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);
}
}
@@ -9994,7 +9994,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);
}
}
@@ -10025,7 +10025,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);
}
}
@@ -10406,7 +10406,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);
}
}
}
@@ -11290,7 +11290,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);
}
}
@@ -11410,7 +11410,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);
}
@@ -11782,7 +11782,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)
@@ -11792,7 +11792,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);
}
}
}
@@ -11869,7 +11869,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()
@@ -11990,7 +11990,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);
}
/**
@@ -13028,7 +13028,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();
@@ -13962,7 +13962,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()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
index 652a1ca0fa..5718895451 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
index d398e89c03..cdca1b721f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.MonsterRace;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -106,26 +106,26 @@ public class L2RaceManagerInstance extends L2Npc
_managers = new CopyOnWriteArrayList<>();
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
}
_managers.add(this);
}
@@ -253,7 +253,7 @@ public class L2RaceManagerInstance extends L2Npc
_packet = new MonRaceInfo(_codes[1][0], _codes[1][1], race.getMonsters(), race.getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunRace(), 5000);
+ ThreadPool.schedule(new RunRace(), 5000);
}
else
{
@@ -558,7 +558,7 @@ public class L2RaceManagerInstance extends L2Npc
{
_packet = new MonRaceInfo(_codes[2][0], _codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunEnd(), 30000);
+ ThreadPool.schedule(new RunEnd(), 30000);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
index 7b95a8d218..4b4f6d1f00 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
@@ -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()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
index bbe7fd3e89..2c113f3992 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
index eb169af1ce..d5549be287 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
@@ -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.YOUR_BASE_IS_BEING_ATTACKED));
setCanTalk(false);
- ThreadPoolManager.schedule(new ScheduleTalkTask(), 20000);
+ ThreadPool.schedule(new ScheduleTalkTask(), 20000);
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
index 0a04416d20..3d3a67f2b9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
@@ -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
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
index 60e018bb0f..32b74ba8eb 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
@@ -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()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
index 7950d61315..5e68cb589e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
@@ -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()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
index 9af40f494e..352a7719ae 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 6f37725f33..dc787cbc19 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -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
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
index a6ffb508f1..3fa6773fd2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
index b15e938ffe..192da08f4e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
@@ -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)
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
index 4dff07f0c4..5c5e479600 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
@@ -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);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
index 7d2ed5035b..a47ba1a0a5 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/buylist/Product.java
index 0da19f8ec7..97571235ed 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/buylist/Product.java
@@ -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
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
index a5c90d0c95..f2fb12dc19 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
@@ -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()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
index 58eab32cb0..d77bf6af86 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
@@ -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)
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Castle.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Castle.java
index f1aa77737c..a6faf0b0df 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Castle.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Castle.java
@@ -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
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/ClanHall.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
index 2cfbef3323..d41afdb68a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
@@ -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();
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Duel.java
index 09536b2aef..d601203f8d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Duel.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Duel.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Fort.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Fort.java
index d892c13f8c..e9b3160a50 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Fort.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Fort.java
@@ -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
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/FortSiege.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
index 43e89644c5..053af69e9d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Siege.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Siege.java
index 00ff234699..c3b017869d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Siege.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Siege.java
@@ -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();
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index 8f25107013..f09be6765f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -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);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
index 2e551991b6..c25f5189f6 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
index 2fdc072c9f..2e334ae7ed 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
@@ -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 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);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
index 70464afd7c..65d29d5c01 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -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
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index 632c4f38f6..743b4a12ee 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -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)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 17a9b42f56..5c81ea0b72 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -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;
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 745b91c704..d725067262 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
index 724b7229fc..38d0fa7c13 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -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");
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index 06c89cb134..d18e278286 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index bc8f5d0bc3..d4720828f5 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -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()));
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 5e7ed370d3..cae533ba54 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
index 0eb81e0589..64f6afb219 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
@@ -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)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index 9b93abc89c..497bcd5aec 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -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());
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
index 6fb07987fe..64f04389a2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
@@ -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:
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index 9696330565..9ac2dd32b5 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -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);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
index 451d9a575b..7758ffe098 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
@@ -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());
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
index 0f57c18729..66b9f7e4b2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
@@ -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()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
index dd4d99799e..bccb1a9fdb 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
@@ -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()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
index 9801290712..38c9a63329 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
index f9ff489d33..043a66b6f4 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
@@ -20,8 +20,8 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +150,7 @@ public final class L2EffectZone extends L2ZoneType
{
if (getSettings().getTask() == null)
{
- getSettings().setTask(ThreadPoolManager.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
+ getSettings().setTask(ThreadPool.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
index 6814af7a3a..71d8f10b3e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.lang.ref.WeakReference;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.PcCondOverride;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -47,7 +47,7 @@ public class L2FishingZone extends L2ZoneType
if ((Config.ALLOW_FISHING || character.canOverrideCond(PcCondOverride.ZONE_CONDITIONS)) && !character.isInsideZone(ZoneId.FISHING))
{
final WeakReference weakPlayer = new WeakReference<>(character.getActingPlayer());
- ThreadPoolManager.execute(new Runnable()
+ ThreadPool.execute(new Runnable()
{
@Override
public void run()
@@ -69,7 +69,7 @@ public class L2FishingZone extends L2ZoneType
player.sendPacket(ExAutoFishAvailable.NO);
}
}
- ThreadPoolManager.schedule(this, 1500);
+ ThreadPool.schedule(this, 1500);
}
else
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
index 13e3744d6c..6511752492 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -77,7 +77,7 @@ public class L2JailZone extends L2ZoneType
if (player.isJailed())
{
// when a player wants to exit jail even if he is still jailed, teleport him back to jail
- ThreadPoolManager.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
+ ThreadPool.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
character.sendMessage("You cannot cheat your way out of here. You must wait until your jail time is over.");
}
if (Config.JAIL_DISABLE_TRANSACTION)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
index 94b5594d11..c0ffa52989 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.ArrayList;
import java.util.List;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.Location;
@@ -130,7 +130,7 @@ public class L2OlympiadStadiumZone extends L2ZoneRespawn
// only participants, observers and GMs allowed
if (!player.canOverrideCond(PcCondOverride.ZONE_CONDITIONS) && !player.isInOlympiadMode() && !player.inObserverMode())
{
- ThreadPoolManager.execute(new KickPlayer(player));
+ ThreadPool.execute(new KickPlayer(player));
}
else
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
index 063cd551e6..cb7760aee0 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
@@ -18,8 +18,8 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -62,7 +62,7 @@ public class L2ResidenceHallTeleportZone extends L2ResidenceTeleportZone
{
if ((_teleTask == null) || _teleTask.isDone())
{
- _teleTask = ThreadPoolManager.schedule(new TeleportTask(), 30000);
+ _teleTask = ThreadPool.schedule(new TeleportTask(), 30000);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
index ca1ec6ed1a..3d7911ed2a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.CategoryType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.tasks.player.FlyMoveStartTask;
@@ -59,7 +59,7 @@ public class L2SayuneZone extends L2ZoneType
if (character.isPlayer() && (character.isInCategory(CategoryType.SIXTH_CLASS_GROUP) || Config.FREE_JUMPS_FOR_ALL) && !character.getActingPlayer().isMounted() && !character.isTransformed())
{
character.setInsideZone(ZoneId.SAYUNE, true);
- ThreadPoolManager.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
+ ThreadPool.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/Disconnection.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/Disconnection.java
index 98b74379c3..5fde2489f9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/Disconnection.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/Disconnection.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.network;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventDispatcher;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogout;
@@ -183,7 +183,7 @@ public final class Disconnection
{
if (_activeChar != null)
{
- ThreadPoolManager.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
+ ThreadPool.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index c92b8e36c5..1597cb50b4 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -17,9 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.LoginServerThread;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.sql.impl.AnnouncementsTable;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
@@ -658,7 +658,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.ENABLE_ATTENDANCE_REWARDS)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Check if player can receive reward today.
final AttendanceInfoHolder attendanceInfo = activeChar.getAttendanceInfo();
@@ -678,7 +678,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.HARDWARE_INFO_ENABLED)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (client.getHardwareInfo() == null)
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
index 60a2336347..66116fb464 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
@@ -101,7 +101,7 @@ public final class RequestDuelStart implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_BEEN_CHALLENGED_TO_A_DUEL);
sm.addString(name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, name), 10000);
activeChar.blockRequest();
return;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
index aa110b024b..817c5d9296 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.enums.PartyDistributionType;
import com.l2jmobius.gameserver.model.BlockList;
@@ -82,7 +82,7 @@ public final class RequestJoinParty implements IClientIncomingPacket
requestor.sendPacket(sm);
if (!requestor.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(requestor), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(requestor), 10000);
requestor.blockRequest();
}
else
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
index 37c539556f..9e6d7ce7be 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2World;
@@ -80,7 +80,7 @@ public final class RequestJoinPledge implements IClientIncomingPacket
{
if (!activeChar.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
index d9cc2097df..7e97a40c3f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
@@ -21,8 +21,8 @@ import java.util.Map;
import java.util.logging.Level;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.L2Object;
@@ -241,7 +241,7 @@ public final class RequestPreviewItem implements IClientIncomingPacket
{
activeChar.sendPacket(new ShopPreviewInfo(itemList));
// Schedule task
- ThreadPoolManager.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
+ ThreadPool.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 31e80f64fb..7ba8a189b4 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.FortManager;
@@ -114,7 +114,7 @@ public final class RequestRestartPoint implements IClientIncomingPacket
if ((activeChar.getClan() != null) && castle.getSiege().checkIsAttacker(activeChar.getClan()))
{
// Schedule respawn delay for attacker
- ThreadPoolManager.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
+ ThreadPool.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
if (castle.getSiege().getAttackerRespawnDelay() > 0)
{
activeChar.sendMessage("You will be re-spawned in " + (castle.getSiege().getAttackerRespawnDelay() / 1000) + " seconds");
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
index 7675b1221d..27dadd4973 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.datatables.BotReportTable;
import com.l2jmobius.gameserver.enums.PrivateStoreType;
@@ -129,7 +129,7 @@ public final class TradeRequest implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_REQUESTED_A_TRADE_WITH_C1);
sm.addString(name);
player.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(player, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(player, name), 10000);
player.blockRequest();
}
else
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
index de78415a4b..5999d7d02c 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.NextAction;
@@ -247,7 +247,7 @@ public final class UseItem implements IClientIncomingPacket
}
else if (activeChar.isAttackingNow())
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Removed for preventing retail behavior.
// if (activeChar.isAttackingNow()) // If character is still engaged in strike we should not change weapon
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
index f14c3fa651..5c0b6915bc 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets.friend;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.L2World;
@@ -65,7 +65,7 @@ public final class RequestFriendInvite implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_VE_REQUESTED_C1_TO_BE_ON_YOUR_FRIENDS_LIST);
sm.addString(_name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
index 4fe79bf68d..b6e739add1 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/ExAlterSkillRequest.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.serverpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketWriter;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.OutgoingPackets;
@@ -56,7 +56,7 @@ public class ExAlterSkillRequest implements IClientOutgoingPacket
if (_alterTime > 0)
{
_player.setAlterSkillActive(true);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
_player.sendPacket(new ExAlterSkillRequest(null, -1, -1, -1));
_player.setAlterSkillActive(false);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9cd2ebed02..9f26c91ac6 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
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.L2Summon;
import com.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -45,7 +45,7 @@ public class AttackStanceTaskManager
*/
protected AttackStanceTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
+ ThreadPool.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 9e9dde878c..942d4215db 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
@@ -65,7 +65,7 @@ public final class DecayTaskManager
if (!_decayTasks.containsKey(character))
{
- _decayTasks.put(character, ThreadPoolManager.schedule(new DecayTask(character), delay * 1000));
+ _decayTasks.put(character, ThreadPool.schedule(new DecayTask(character), delay * 1000));
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
index 5d9816577a..7f86a2bfb3 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -35,8 +35,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.taskmanager.tasks.TaskBirthday;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskRestart;
@@ -235,14 +235,14 @@ public final class TaskManager
case TYPE_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
- task.scheduled = ThreadPoolManager.schedule(task, delay);
+ task.scheduled = ThreadPool.schedule(task, delay);
return true;
}
case TYPE_FIXED_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
interval = Long.valueOf(task.getParams()[1]);
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
case TYPE_TIME:
@@ -253,7 +253,7 @@ public final class TaskManager
final long diff = desired.getTime() - System.currentTimeMillis();
if (diff >= 0)
{
- task.scheduled = ThreadPoolManager.schedule(task, diff);
+ task.scheduled = ThreadPool.schedule(task, diff);
return true;
}
LOGGER.info("Task " + task.getId() + " is obsoleted.");
@@ -306,7 +306,7 @@ public final class TaskManager
{
delay += interval;
}
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
default:
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/Evolve.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/Evolve.java
index 80a1c892c6..7fae394d24 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/Evolve.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/Evolve.java
@@ -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.database.DatabaseFactory;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.PetDataTable;
import com.l2jmobius.gameserver.model.L2PetData;
@@ -142,11 +142,11 @@ public final class Evolve
petSummon.startFeed();
item.setEnchantLevel(petSummon.getLevel());
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
@@ -236,11 +236,11 @@ public final class Evolve
player.broadcastUserInfo();
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/MinionList.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/MinionList.java
index fda128217e..271b3ea3d9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/MinionList.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/MinionList.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -141,7 +141,7 @@ public class MinionList
final int time = respawnTime < 0 ? _master.isRaid() ? (int) Config.RAID_MINION_RESPAWN_TIMER : 0 : respawnTime;
if ((time > 0) && !_master.isAlikeDead())
{
- ThreadPoolManager.schedule(new MinionRespawnTask(minion), time);
+ ThreadPool.schedule(new MinionRespawnTask(minion), time);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/Util.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/Util.java
index 0508148f16..b075bfc1d2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/Util.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/util/Util.java
@@ -38,9 +38,9 @@ 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.Rnd;
import com.l2jmobius.commons.util.file.filter.ExtFilter;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.HtmlActionScope;
import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import com.l2jmobius.gameserver.model.L2Object;
@@ -64,7 +64,7 @@ public final class Util
public static void handleIllegalPlayerAction(L2PcInstance actor, String message, IllegalActionPunishmentType punishment)
{
- ThreadPoolManager.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
+ ThreadPool.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Antharas.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Antharas.java
index 82d3f07653..da0b824600 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Antharas.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Antharas.java
@@ -25,7 +25,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillTable;
@@ -263,11 +263,11 @@ public class Antharas extends Quest
_antharas.setCurrentHpMp(hp, mp);
_LastAction = System.currentTimeMillis();
// Start repeating timer to check for inactivity
- _activityCheckTask = ThreadPoolManager.scheduleAtFixedRate(new CheckActivity(), 60000, 60000);
+ _activityCheckTask = ThreadPool.scheduleAtFixedRate(new CheckActivity(), 60000, 60000);
}
else if (status == DEAD)
{
- ThreadPoolManager.schedule(new UnlockAntharas(ANTHARASOLDID), respawnTime - System.currentTimeMillis());
+ ThreadPool.schedule(new UnlockAntharas(ANTHARASOLDID), respawnTime - System.currentTimeMillis());
}
else if (status == DORMANT)
{
@@ -316,7 +316,7 @@ public class Antharas extends Quest
_antharas.setCurrentHpMp(hp, mp);
_LastAction = System.currentTimeMillis();
// Start repeating timer to check for inactivity
- _activityCheckTask = ThreadPoolManager.scheduleAtFixedRate(new CheckActivity(), 60000, 60000);
+ _activityCheckTask = ThreadPool.scheduleAtFixedRate(new CheckActivity(), 60000, 60000);
}
else if ((antharasId != 0) && (status == DEAD))
{
@@ -331,7 +331,7 @@ public class Antharas extends Quest
}
else
{
- ThreadPoolManager.schedule(new UnlockAntharas(antharasId), respawnTime - System.currentTimeMillis());
+ ThreadPool.schedule(new UnlockAntharas(antharasId), respawnTime - System.currentTimeMillis());
}
}
}
@@ -372,7 +372,7 @@ public class Antharas extends Quest
if (_monsterSpawnTask == null)
{
GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID, WAITING);
- _monsterSpawnTask = ThreadPoolManager.schedule(new AntharasSpawn(1), 60000 * Config.ANTHARAS_WAIT_TIME);
+ _monsterSpawnTask = ThreadPool.schedule(new AntharasSpawn(1), 60000 * Config.ANTHARAS_WAIT_TIME);
}
}
}
@@ -404,7 +404,7 @@ public class Antharas extends Quest
}
// Spawn mobs.
- _mobsSpawnTask = ThreadPoolManager.scheduleAtFixedRate(new MobsSpawn(), intervalOfMobs, intervalOfMobs);
+ _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(new MobsSpawn(), intervalOfMobs, intervalOfMobs);
}
// Do spawn Antharas.
@@ -462,7 +462,7 @@ public class Antharas extends Quest
GrandBossManager.getInstance().setBossStatus(npcId, FIGHTING);
_LastAction = System.currentTimeMillis();
// Start repeating timer to check for inactivity
- _activityCheckTask = ThreadPoolManager.scheduleAtFixedRate(new CheckActivity(), 60000, 60000);
+ _activityCheckTask = ThreadPool.scheduleAtFixedRate(new CheckActivity(), 60000, 60000);
// Setting 1st time of minions spawn task.
if (!FWA_OLDANTHARAS)
{
@@ -474,7 +474,7 @@ public class Antharas extends Quest
_socialTask.cancel(true);
_socialTask = null;
}
- _socialTask = ThreadPoolManager.schedule(new AntharasSpawn(2), 16);
+ _socialTask = ThreadPool.schedule(new AntharasSpawn(2), 16);
break;
}
case 2:
@@ -487,7 +487,7 @@ public class Antharas extends Quest
_socialTask.cancel(true);
_socialTask = null;
}
- _socialTask = ThreadPoolManager.schedule(new AntharasSpawn(3), 3000);
+ _socialTask = ThreadPool.schedule(new AntharasSpawn(3), 3000);
break;
}
case 3:
@@ -500,7 +500,7 @@ public class Antharas extends Quest
_socialTask.cancel(true);
_socialTask = null;
}
- _socialTask = ThreadPoolManager.schedule(new AntharasSpawn(4), 10000);
+ _socialTask = ThreadPool.schedule(new AntharasSpawn(4), 10000);
break;
}
case 4:
@@ -512,7 +512,7 @@ public class Antharas extends Quest
_socialTask.cancel(true);
_socialTask = null;
}
- _socialTask = ThreadPoolManager.schedule(new AntharasSpawn(5), 200);
+ _socialTask = ThreadPool.schedule(new AntharasSpawn(5), 200);
break;
}
case 5:
@@ -525,7 +525,7 @@ public class Antharas extends Quest
_socialTask.cancel(true);
_socialTask = null;
}
- _socialTask = ThreadPoolManager.schedule(new AntharasSpawn(6), 10800);
+ _socialTask = ThreadPool.schedule(new AntharasSpawn(6), 10800);
break;
}
case 6:
@@ -538,18 +538,18 @@ public class Antharas extends Quest
_socialTask.cancel(true);
_socialTask = null;
}
- _socialTask = ThreadPoolManager.schedule(new AntharasSpawn(7), 1900);
+ _socialTask = ThreadPool.schedule(new AntharasSpawn(7), 1900);
break;
}
case 7:
{
_antharas.abortCast();
- _mobiliseTask = ThreadPoolManager.schedule(new SetMobilised(_antharas), 16);
+ _mobiliseTask = ThreadPool.schedule(new SetMobilised(_antharas), 16);
// Move at random.
if (FWA_MOVEATRANDOM)
{
final Location pos = new Location(Rnd.get(175000, 178500), Rnd.get(112400, 116000), -7707, 0);
- _moveAtRandomTask = ThreadPoolManager.schedule(new MoveAtRandom(_antharas, pos), 500);
+ _moveAtRandomTask = ThreadPool.schedule(new MoveAtRandom(_antharas, pos), 500);
}
if (_socialTask != null)
{
@@ -668,7 +668,7 @@ public class Antharas extends Quest
{
if ((_selfDestructionTask == null) && !npc.isDead())
{
- _selfDestructionTask = ThreadPoolManager.schedule(new SelfDestructionOfBomber(npc), FWA_SELFDESTRUCTTIME);
+ _selfDestructionTask = ThreadPool.schedule(new SelfDestructionOfBomber(npc), FWA_SELFDESTRUCTTIME);
}
break;
}
@@ -842,7 +842,7 @@ public class Antharas extends Quest
if (_type == 0)
{
spawnCube();
- _cubeSpawnTask = ThreadPoolManager.schedule(new CubeSpawn(1), 1800000);
+ _cubeSpawnTask = ThreadPool.schedule(new CubeSpawn(1), 1800000);
}
else
{
@@ -967,10 +967,10 @@ public class Antharas extends Quest
if (!npc.getSpawn().is_customBossInstance())
{
- _cubeSpawnTask = ThreadPoolManager.schedule(new CubeSpawn(0), 10000);
+ _cubeSpawnTask = ThreadPool.schedule(new CubeSpawn(0), 10000);
GrandBossManager.getInstance().setBossStatus(npc.getNpcId(), DEAD);
final long respawnTime = (Config.ANTHARAS_RESP_FIRST + Rnd.get(Config.ANTHARAS_RESP_SECOND)) * 3600000;
- ThreadPoolManager.schedule(new UnlockAntharas(npc.getNpcId()), respawnTime);
+ ThreadPool.schedule(new UnlockAntharas(npc.getNpcId()), respawnTime);
// also save the respawn time so that the info is maintained past reboots
final StatsSet info = GrandBossManager.getInstance().getStatsSet(npc.getNpcId());
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Baium.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Baium.java
index 3856395936..5390604667 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Baium.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Baium.java
@@ -26,7 +26,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.geodata.GeoData;
@@ -175,7 +175,7 @@ public class Baium extends Quest
}
GrandBossManager.getInstance().addBoss(baium);
final L2NpcInstance _baium = baium;
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
try
{
@@ -244,7 +244,7 @@ public class Baium extends Quest
startQuestTimer("skill_range", 500, npc, null, true);
final L2NpcInstance baium = npc;
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
try
{
@@ -338,7 +338,7 @@ public class Baium extends Quest
final L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM, npc);
GrandBossManager.getInstance().addBoss(baium);
final L2NpcInstance _baium = baium;
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
try
{
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Valakas.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Valakas.java
index 6b83d417d1..a89bc19a6d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Valakas.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Valakas.java
@@ -21,7 +21,7 @@ import java.util.Collection;
import java.util.List;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillTable;
@@ -128,7 +128,7 @@ public class Valakas extends Quest
GrandBossManager.getInstance().addBoss(valakas);
final L2NpcInstance _valakas = valakas;
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
try
{
@@ -350,7 +350,7 @@ public class Valakas extends Quest
lastAttackTime = System.currentTimeMillis();
final L2NpcInstance _valakas = valakas;
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
try
{
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/VanHalter.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/VanHalter.java
index 79a38e181f..326992257c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/VanHalter.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/VanHalter.java
@@ -29,7 +29,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
@@ -239,14 +239,14 @@ public class VanHalter extends Quest
{
_timeUpTask.cancel(false);
}
- _timeUpTask = ThreadPoolManager.schedule(new TimeUp(), Config.HPH_ACTIVITYTIMEOFHALTER);
+ _timeUpTask = ThreadPool.schedule(new TimeUp(), Config.HPH_ACTIVITYTIMEOFHALTER);
// Set bleeding to palyers.
if (_setBleedTask != null)
{
_setBleedTask.cancel(false);
}
- _setBleedTask = ThreadPoolManager.schedule(new Bleeding(), 2000);
+ _setBleedTask = ThreadPool.schedule(new Bleeding(), 2000);
final Integer status = GrandBossManager.getInstance().getBossStatus(29062);
if (status == INTERVAL)
@@ -896,7 +896,7 @@ public class VanHalter extends Quest
{
if ((_lockUpDoorOfAltarTask == null) && !_isLocked && _isCaptainSpawned)
{
- _lockUpDoorOfAltarTask = ThreadPoolManager.schedule(new LockUpDoorOfAltar(), Config.HPH_TIMEOFLOCKUPDOOROFALTAR);
+ _lockUpDoorOfAltarTask = ThreadPool.schedule(new LockUpDoorOfAltar(), Config.HPH_TIMEOFLOCKUPDOOROFALTAR);
}
}
@@ -934,7 +934,7 @@ public class VanHalter extends Quest
_closeDoorOfAltarTask.cancel(false);
}
_closeDoorOfAltarTask = null;
- _closeDoorOfAltarTask = ThreadPoolManager.schedule(new CloseDoorOfAltar(), Config.HPH_INTERVALOFDOOROFALTER);
+ _closeDoorOfAltarTask = ThreadPool.schedule(new CloseDoorOfAltar(), Config.HPH_INTERVALOFDOOROFALTER);
}
else
{
@@ -969,7 +969,7 @@ public class VanHalter extends Quest
_openDoorOfAltarTask.cancel(false);
}
_openDoorOfAltarTask = null;
- _openDoorOfAltarTask = ThreadPoolManager.schedule(new OpenDoorOfAltar(), Config.HPH_INTERVALOFDOOROFALTER);
+ _openDoorOfAltarTask = ThreadPool.schedule(new OpenDoorOfAltar(), Config.HPH_INTERVALOFDOOROFALTER);
}
else
{
@@ -1065,7 +1065,7 @@ public class VanHalter extends Quest
}
_timeUpTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(1), Config.HPH_APPTIMEOFHALTER);
+ _movieTask = ThreadPool.schedule(new Movie(1), Config.HPH_APPTIMEOFHALTER);
}
// Start fight against High Priestess van Halter.
@@ -1075,7 +1075,7 @@ public class VanHalter extends Quest
{
_timeUpTask.cancel(false);
}
- _timeUpTask = ThreadPoolManager.schedule(new TimeUp(), Config.HPH_FIGHTTIMEOFHALTER);
+ _timeUpTask = ThreadPool.schedule(new TimeUp(), Config.HPH_FIGHTTIMEOFHALTER);
final Map _targets = new HashMap<>();
int i = 0;
@@ -1095,8 +1095,8 @@ public class VanHalter extends Quest
if (!_isHelperCalled)
{
_isHelperCalled = true;
- _halterEscapeTask = ThreadPoolManager.schedule(new HalterEscape(), 500);
- _callRoyalGuardHelperTask = ThreadPoolManager.schedule(new CallRoyalGuardHelper(), 1000);
+ _halterEscapeTask = ThreadPool.schedule(new HalterEscape(), 500);
+ _callRoyalGuardHelperTask = ThreadPool.schedule(new CallRoyalGuardHelper(), 1000);
}
}
@@ -1113,7 +1113,7 @@ public class VanHalter extends Quest
{
_callRoyalGuardHelperTask.cancel(false);
}
- _callRoyalGuardHelperTask = ThreadPoolManager.schedule(new CallRoyalGuardHelper(), Config.HPH_CALLROYALGUARDHELPERINTERVAL);
+ _callRoyalGuardHelperTask = ThreadPool.schedule(new CallRoyalGuardHelper(), Config.HPH_CALLROYALGUARDHELPERINTERVAL);
}
else
{
@@ -1171,7 +1171,7 @@ public class VanHalter extends Quest
{
_halterEscapeTask.cancel(false);
}
- _halterEscapeTask = ThreadPoolManager.schedule(new HalterEscape(), 5000);
+ _halterEscapeTask = ThreadPool.schedule(new HalterEscape(), 5000);
}
else
{
@@ -1243,7 +1243,7 @@ public class VanHalter extends Quest
{
_setBleedTask.cancel(false);
}
- _setBleedTask = ThreadPoolManager.schedule(new Bleeding(), 2000);
+ _setBleedTask = ThreadPool.schedule(new Bleeding(), 2000);
}
}
@@ -1334,7 +1334,7 @@ public class VanHalter extends Quest
final StatsSet info = GrandBossManager.getInstance().getStatsSet(29062);
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
- _intervalTask = ThreadPoolManager.schedule(new Interval(), temp);
+ _intervalTask = ThreadPool.schedule(new Interval(), temp);
}
// Interval.
@@ -1433,7 +1433,7 @@ public class VanHalter extends Quest
{
_timeUpTask.cancel(false);
}
- _timeUpTask = ThreadPoolManager.schedule(new TimeUp(), Config.HPH_ACTIVITYTIMEOFHALTER);
+ _timeUpTask = ThreadPool.schedule(new TimeUp(), Config.HPH_ACTIVITYTIMEOFHALTER);
}
// Time up.
@@ -1482,7 +1482,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(2), 16);
+ _movieTask = ThreadPool.schedule(new Movie(2), 16);
break;
}
case 2:
@@ -1501,7 +1501,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(3), 1);
+ _movieTask = ThreadPool.schedule(new Movie(3), 1);
break;
}
case 3:
@@ -1520,7 +1520,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(4), 1500);
+ _movieTask = ThreadPool.schedule(new Movie(4), 1500);
break;
}
case 4:
@@ -1539,7 +1539,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(5), 1);
+ _movieTask = ThreadPool.schedule(new Movie(5), 1);
break;
}
case 5:
@@ -1558,7 +1558,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(6), 1500);
+ _movieTask = ThreadPool.schedule(new Movie(6), 1500);
break;
}
case 6:
@@ -1577,7 +1577,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(7), 1);
+ _movieTask = ThreadPool.schedule(new Movie(7), 1);
break;
}
case 7:
@@ -1596,7 +1596,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(8), 1500);
+ _movieTask = ThreadPool.schedule(new Movie(8), 1500);
break;
}
case 8:
@@ -1615,7 +1615,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(9), 1);
+ _movieTask = ThreadPool.schedule(new Movie(9), 1);
break;
}
case 9:
@@ -1634,7 +1634,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(10), 1500);
+ _movieTask = ThreadPool.schedule(new Movie(10), 1500);
break;
}
case 10:
@@ -1653,7 +1653,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(11), 1);
+ _movieTask = ThreadPool.schedule(new Movie(11), 1);
break;
}
case 11:
@@ -1672,7 +1672,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(12), 2000);
+ _movieTask = ThreadPool.schedule(new Movie(12), 2000);
break;
}
case 12:
@@ -1691,7 +1691,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(13), 1000);
+ _movieTask = ThreadPool.schedule(new Movie(13), 1000);
break;
}
case 13:
@@ -1709,7 +1709,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(14), 4700);
+ _movieTask = ThreadPool.schedule(new Movie(14), 4700);
break;
}
case 14:
@@ -1722,7 +1722,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(15), 4300);
+ _movieTask = ThreadPool.schedule(new Movie(15), 4300);
break;
}
case 15:
@@ -1743,7 +1743,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(16), 2000);
+ _movieTask = ThreadPool.schedule(new Movie(16), 2000);
break;
}
case 16:
@@ -1762,7 +1762,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(17), 6000);
+ _movieTask = ThreadPool.schedule(new Movie(17), 6000);
break;
}
case 17:
@@ -1776,7 +1776,7 @@ public class VanHalter extends Quest
_movieTask.cancel(false);
}
_movieTask = null;
- _movieTask = ThreadPoolManager.schedule(new Movie(18), 1000);
+ _movieTask = ThreadPool.schedule(new Movie(18), 1000);
break;
}
case 18:
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Zaken.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Zaken.java
index 9d46713042..f36c7310ed 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Zaken.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Zaken.java
@@ -19,7 +19,7 @@ package ai.bosses;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ai.CtrlIntention;
@@ -130,7 +130,7 @@ public class Zaken extends Quest
super(questId, name, descr);
// Zaken doors handling
- ThreadPoolManager.scheduleAtFixedRate(() ->
+ ThreadPool.scheduleAtFixedRate(() ->
{
try
{
@@ -138,7 +138,7 @@ public class Zaken extends Quest
{
LOGGER.info("Zaken door id 21240006 opened, game time 00.00.");
DoorTable.getInstance().getDoor(21240006).openMe();
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
try
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/concurrent/ThreadPoolManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/concurrent/ThreadPool.java
similarity index 99%
rename from L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/concurrent/ThreadPoolManager.java
rename to L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/concurrent/ThreadPool.java
index 284fdfbedf..98b6635275 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/concurrent/ThreadPoolManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/concurrent/ThreadPool.java
@@ -37,9 +37,9 @@ import com.l2jmobius.Config;
* Instant pool handles short-life events.
*
*/
-public final class ThreadPoolManager
+public final class ThreadPool
{
- protected static final Logger LOGGER = Logger.getLogger(ThreadPoolManager.class.getName());
+ protected static final Logger LOGGER = Logger.getLogger(ThreadPool.class.getName());
private static final long MAX_DELAY = TimeUnit.NANOSECONDS.toMillis(Long.MAX_VALUE - System.nanoTime()) / 2;
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/GameServer.java
index 7144844d7a..55a5bcb041 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/GameServer.java
@@ -28,7 +28,7 @@ import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.Server;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.crypt.nProtect;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.mmocore.NetcoreConfig;
@@ -182,10 +182,10 @@ public class GameServer
LOGGER.info("L2DatabaseFactory: loaded.");
Util.printSection("Threads");
- ThreadPoolManager.init();
+ ThreadPool.init();
if (Config.DEADLOCKCHECK_INTIAL_TIME > 0)
{
- ThreadPoolManager.scheduleAtFixedRate(DeadlockDetector.getInstance(), Config.DEADLOCKCHECK_INTIAL_TIME, Config.DEADLOCKCHECK_DELAY_TIME);
+ ThreadPool.scheduleAtFixedRate(DeadlockDetector.getInstance(), Config.DEADLOCKCHECK_INTIAL_TIME, Config.DEADLOCKCHECK_DELAY_TIME);
}
new File(Config.DATAPACK_ROOT, "data/clans").mkdirs();
new File(Config.DATAPACK_ROOT, "data/crests").mkdirs();
@@ -521,7 +521,7 @@ public class GameServer
if (Config.PCB_ENABLE)
{
- ThreadPoolManager.scheduleAtFixedRate(PcPoint.getInstance(), Config.PCB_INTERVAL * 1000, Config.PCB_INTERVAL * 1000);
+ ThreadPool.scheduleAtFixedRate(PcPoint.getInstance(), Config.PCB_INTERVAL * 1000, Config.PCB_INTERVAL * 1000);
}
}
else
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/GameTimeController.java
index fa9f91f4e9..2818c3b594 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/GameTimeController.java
@@ -23,7 +23,7 @@ import java.util.List;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.instancemanager.DayNightSpawnManager;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -67,8 +67,8 @@ public class GameTimeController
_timer = new TimerThread();
_timer.start();
- _timerWatcher = ThreadPoolManager.scheduleAtFixedRate(new TimerWatcher(), 0, 1000);
- ThreadPoolManager.scheduleAtFixedRate(new BroadcastSunState(), 0, 600000);
+ _timerWatcher = ThreadPool.scheduleAtFixedRate(new TimerWatcher(), 0, 1000);
+ ThreadPool.scheduleAtFixedRate(new BroadcastSunState(), 0, 600000);
}
public boolean isNowNight()
@@ -154,7 +154,7 @@ public class GameTimeController
// TODO: maybe a general TP is needed for that kinda stuff (all knownlist updates should be done in a TP anyway).
if (ended != null)
{
- ThreadPoolManager.execute(new MovingObjectArrived(ended));
+ ThreadPool.execute(new MovingObjectArrived(ended));
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/RecipeController.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/RecipeController.java
index 28010c54b3..191f6f9189 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/RecipeController.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/RecipeController.java
@@ -25,7 +25,7 @@ import java.util.WeakHashMap;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.csv.RecipeTable;
import com.l2jmobius.gameserver.model.Inventory;
@@ -118,7 +118,7 @@ public class RecipeController
if (Config.ALT_GAME_CREATION)
{
_activeMakers.put(manufacturer, maker);
- ThreadPoolManager.schedule(maker, 100);
+ ThreadPool.schedule(maker, 100);
}
else
{
@@ -169,7 +169,7 @@ public class RecipeController
if (Config.ALT_GAME_CREATION)
{
_activeMakers.put(player, maker);
- ThreadPoolManager.schedule(maker, 100);
+ ThreadPool.schedule(maker, 100);
}
else
{
@@ -385,7 +385,7 @@ public class RecipeController
_player.broadcastPacket(msk);
_player.sendPacket(new SetupGauge(0, _delay));
- ThreadPoolManager.schedule(this, 100 + _delay);
+ ThreadPool.schedule(this, 100 + _delay);
}
else
{
@@ -539,7 +539,7 @@ public class RecipeController
if (Config.ALT_GAME_CREATION)
{
_player.sendPacket(new SetupGauge(0, _delay));
- ThreadPoolManager.schedule(this, 100 + _delay);
+ ThreadPool.schedule(this, 100 + _delay);
}
// no rest - report no mana
else
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ServerStatus.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ServerStatus.java
index 02dd0fcf27..5bc811ddb5 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ServerStatus.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ServerStatus.java
@@ -21,7 +21,7 @@ import java.util.Date;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Memory;
import com.l2jmobius.commons.util.Util;
import com.l2jmobius.gameserver.model.L2World;
@@ -39,7 +39,7 @@ public class ServerStatus
protected ServerStatus()
{
- _scheduledTask = ThreadPoolManager.scheduleAtFixedRate(new ServerStatusTask(), 1800000, 3600000);
+ _scheduledTask = ThreadPool.scheduleAtFixedRate(new ServerStatusTask(), 1800000, 3600000);
}
protected class ServerStatusTask implements Runnable
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/Shutdown.java
index 8d385900a6..13f63ffef3 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/Shutdown.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.BufferTable;
import com.l2jmobius.gameserver.datatables.OfflineTradeTable;
@@ -461,7 +461,7 @@ public class Shutdown extends Thread
// stop all threadpolls
try
{
- ThreadPoolManager.shutdown();
+ ThreadPool.shutdown();
}
catch (Throwable t)
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/TradeController.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/TradeController.java
index 33b260ad05..4cbe36c527 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/TradeController.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/TradeController.java
@@ -31,7 +31,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.xml.ItemTable;
import com.l2jmobius.gameserver.model.L2TradeList;
@@ -67,7 +67,7 @@ public class TradeController
{
restoreCount(_timer);
dataTimerSave(_timer);
- ThreadPoolManager.schedule(new RestoreCount(_timer), (long) _timer * 60 * 60 * 1000);
+ ThreadPool.schedule(new RestoreCount(_timer), (long) _timer * 60 * 60 * 1000);
}
catch (Throwable t)
{
@@ -327,11 +327,11 @@ public class TradeController
savetimer = rset2.getLong("savetimer");
if ((savetimer - currentMillis) > 0)
{
- ThreadPoolManager.schedule(new RestoreCount(time), savetimer - System.currentTimeMillis());
+ ThreadPool.schedule(new RestoreCount(time), savetimer - System.currentTimeMillis());
}
else
{
- ThreadPoolManager.schedule(new RestoreCount(time), 0);
+ ThreadPool.schedule(new RestoreCount(time), 0);
}
}
rset2.close();
@@ -503,11 +503,11 @@ public class TradeController
savetimer = rset2.getLong("savetimer");
if ((savetimer - currentMillis) > 0)
{
- ThreadPoolManager.schedule(new RestoreCount(time), savetimer - System.currentTimeMillis());
+ ThreadPool.schedule(new RestoreCount(time), savetimer - System.currentTimeMillis());
}
else
{
- ThreadPoolManager.schedule(new RestoreCount(time), 0);
+ ThreadPool.schedule(new RestoreCount(time), 0);
}
}
rset2.close();
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/AbstractAI.java
index d7ff18367a..3490e386f2 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/AbstractAI.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/AbstractAI.java
@@ -23,7 +23,7 @@ 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.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Skill;
@@ -859,7 +859,7 @@ abstract class AbstractAI implements Ctrl
// Create and Launch an AI Follow Task to execute every 1s
_followTarget = target;
- _followTask = ThreadPoolManager.scheduleAtFixedRate(new FollowTask(), 5, FOLLOW_INTERVAL);
+ _followTask = ThreadPool.scheduleAtFixedRate(new FollowTask(), 5, FOLLOW_INTERVAL);
}
/**
@@ -877,7 +877,7 @@ abstract class AbstractAI implements Ctrl
}
_followTarget = target;
- _followTask = ThreadPoolManager.scheduleAtFixedRate(new FollowTask(range), 5, ATTACK_FOLLOW_INTERVAL);
+ _followTask = ThreadPool.scheduleAtFixedRate(new FollowTask(range), 5, ATTACK_FOLLOW_INTERVAL);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
index f70fdd2b1d..352d56547a 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
@@ -23,7 +23,7 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.concurrent.Future;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.datatables.sql.TerritoryTable;
@@ -315,7 +315,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
if (_aiTask == null)
{
- _aiTask = ThreadPoolManager.scheduleAtFixedRate(this, 1000, 1000);
+ _aiTask = ThreadPool.scheduleAtFixedRate(this, 1000, 1000);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2DoorAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
index d580f7515e..7ffe1013ee 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.ai;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Skill;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -100,7 +100,7 @@ public class L2DoorAI extends L2CharacterAI
protected void onEvtAttacked(L2Character attacker)
{
L2DoorInstance me = (L2DoorInstance) _actor;
- ThreadPoolManager.execute(new onEventAttackedDoorTask(me, attacker));
+ ThreadPool.execute(new onEventAttackedDoorTask(me, attacker));
}
@Override
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java
index a7779c39ff..087f659fb4 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java
@@ -26,7 +26,7 @@ import java.util.concurrent.Future;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.geodata.GeoData;
@@ -257,7 +257,7 @@ public class L2FortSiegeGuardAI 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);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2NpcWalkerAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2NpcWalkerAI.java
index 809f2b2dfe..ee33d5b511 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2NpcWalkerAI.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2NpcWalkerAI.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.ai;
import java.util.List;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.csv.NpcWalkerRoutesTable;
import com.l2jmobius.gameserver.model.L2NpcWalkerNode;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -59,7 +59,7 @@ public class L2NpcWalkerAI extends L2CharacterAI implements Runnable
super(accessor);
// Do we really need 2 minutes delay before start?
// no we dont... :)
- ThreadPoolManager.scheduleAtFixedRate(this, 0, 1000);
+ ThreadPool.scheduleAtFixedRate(this, 0, 1000);
}
@Override
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2PlayerAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2PlayerAI.java
index fab683539a..4ec433e73e 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2PlayerAI.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2PlayerAI.java
@@ -26,7 +26,7 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_REST;
import java.util.EmptyStackException;
import java.util.Stack;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Skill;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -371,7 +371,7 @@ public class L2PlayerAI extends L2CharacterAI
@Override
protected void onEvtArrivedRevalidate()
{
- ThreadPoolManager.execute(new KnownListAsynchronousUpdateTask(_actor));
+ ThreadPool.execute(new KnownListAsynchronousUpdateTask(_actor));
super.onEvtArrivedRevalidate();
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java
index 7ffc715de8..1f444504a0 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java
@@ -23,7 +23,7 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.concurrent.Future;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.geodata.GeoData;
@@ -215,7 +215,7 @@ public class L2SiegeGuardAI 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);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index 2a97e3d5dd..dfa5aa99f4 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -20,7 +20,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
/**
@@ -46,7 +46,7 @@ public class WarehouseCacheManager
{
_cacheTime = Config.WAREHOUSE_CACHE_TIME * 60000L; // 60*1000 = 60000
_cachedWh = new ConcurrentHashMap<>();
- ThreadPoolManager.scheduleAtFixedRate(new CacheScheduler(), 120000, 60000);
+ ThreadPool.scheduleAtFixedRate(new CacheScheduler(), 120000, 60000);
}
public void addCacheTask(L2PcInstance pc)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/sql/ClanTable.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/sql/ClanTable.java
index bd4cd6e12f..8fa9e92f2d 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/sql/ClanTable.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/sql/ClanTable.java
@@ -27,7 +27,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.instancemanager.FortManager;
@@ -426,7 +426,7 @@ public class ClanTable
public void scheduleRemoveClan(int clanId)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (getClan(clanId) == null)
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/sql/TradeListTable.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/sql/TradeListTable.java
index 3de9923b4d..5af51aad5a 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/sql/TradeListTable.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/sql/TradeListTable.java
@@ -25,7 +25,7 @@ import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.xml.ItemTable;
import com.l2jmobius.gameserver.model.L2TradeList;
@@ -58,7 +58,7 @@ public class TradeListTable
{
restoreCount(timer);
dataTimerSave(timer);
- ThreadPoolManager.schedule(new RestoreCount(timer), (long) timer * 60 * 60 * 1000);
+ ThreadPool.schedule(new RestoreCount(timer), (long) timer * 60 * 60 * 1000);
}
}
@@ -186,11 +186,11 @@ public class TradeListTable
savetimer = rset2.getLong("savetimer");
if ((savetimer - currentMillis) > 0)
{
- ThreadPoolManager.schedule(new RestoreCount(time), savetimer - System.currentTimeMillis());
+ ThreadPool.schedule(new RestoreCount(time), savetimer - System.currentTimeMillis());
}
else
{
- ThreadPoolManager.schedule(new RestoreCount(time), 0);
+ ThreadPool.schedule(new RestoreCount(time), 0);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/xml/ItemTable.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/xml/ItemTable.java
index 622a813868..592dd0f3f8 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/xml/ItemTable.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/datatables/xml/ItemTable.java
@@ -27,7 +27,7 @@ import java.util.logging.LogRecord;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.sql.L2PetDataTable;
import com.l2jmobius.gameserver.engines.DocumentEngine;
@@ -216,7 +216,7 @@ public class ItemTable
item.setOwnerId(actor.getObjectId());
delay = 15000;
}
- itemLootShedule = ThreadPoolManager.schedule(new resetOwner(item), delay);
+ itemLootShedule = ThreadPool.schedule(new resetOwner(item), delay);
item.setItemLootShedule(itemLootShedule);
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoAnnouncementHandler.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoAnnouncementHandler.java
index 16eab6754b..0a730751bc 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoAnnouncementHandler.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoAnnouncementHandler.java
@@ -25,7 +25,7 @@ import java.util.Map;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Announcements;
@@ -427,7 +427,7 @@ public class AutoAnnouncementHandler
if (isActive())
{
AutoAnnouncementRunner acr = new AutoAnnouncementRunner(_defaultId);
- _chatTask = ThreadPoolManager.scheduleAtFixedRate(acr, _defaultDelay, _defaultDelay);
+ _chatTask = ThreadPool.scheduleAtFixedRate(acr, _defaultDelay, _defaultDelay);
}
else
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoChatHandler.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoChatHandler.java
index a68c1ed00c..e2d2d27aac 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoChatHandler.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/AutoChatHandler.java
@@ -28,7 +28,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -557,7 +557,7 @@ public class AutoChatHandler implements SpawnListener
if (isActive())
{
AutoChatRunner acr = new AutoChatRunner(_npcId, -1);
- _chatTask = ThreadPoolManager.scheduleAtFixedRate(acr, _defaultDelay, _defaultDelay);
+ _chatTask = ThreadPool.scheduleAtFixedRate(acr, _defaultDelay, _defaultDelay);
}
else
{
@@ -669,11 +669,11 @@ public class AutoChatHandler implements SpawnListener
{
// Schedule it set to 5Ms, isn't error, if use 0 sometine
// chatDefinition return null in AutoChatRunner
- _chatTask = ThreadPoolManager.schedule(acr, 5);
+ _chatTask = ThreadPool.schedule(acr, 5);
}
else
{
- _chatTask = ThreadPoolManager.scheduleAtFixedRate(acr, getChatDelay(), getChatDelay());
+ _chatTask = ThreadPool.scheduleAtFixedRate(acr, getChatDelay(), getChatDelay());
}
}
else
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminMonsterRace.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminMonsterRace.java
index e857be2426..513125a4df 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminMonsterRace.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminMonsterRace.java
@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.handler.admincommandhandlers;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.MonsterRace;
@@ -119,7 +119,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunRace(codes, activeChar), 5000);
+ ThreadPool.schedule(new RunRace(codes, activeChar), 5000);
}
}
@@ -147,7 +147,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
MonRaceInfo spk = new MonRaceInfo(codes[2][0], codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunEnd(activeChar), 30000);
+ ThreadPool.schedule(new RunEnd(activeChar), 30000);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminTest.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminTest.java
index 3e86fe4188..21eaccb7bc 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminTest.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminTest.java
@@ -20,7 +20,7 @@ import java.util.NoSuchElementException;
import java.util.StringTokenizer;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
@@ -55,7 +55,7 @@ public class AdminTest implements IAdminCommandHandler
{
if (command.equals("admin_stats"))
{
- for (String line : ThreadPoolManager.getStats())
+ for (String line : ThreadPool.getStats())
{
activeChar.sendMessage(line);
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/ChristmasTree.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/ChristmasTree.java
index c71df9d210..d08a5bd519 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/ChristmasTree.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/ChristmasTree.java
@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.handler.itemhandlers;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
import com.l2jmobius.gameserver.handler.IItemHandler;
import com.l2jmobius.gameserver.idfactory.IdFactory;
@@ -87,7 +87,7 @@ public class ChristmasTree implements IItemHandler
SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(new DeSpawn(result), 3600000);
+ ThreadPool.schedule(new DeSpawn(result), 3600000);
}
catch (Exception e)
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/MysteryPotion.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/MysteryPotion.java
index 913302b1ba..8f0e6122b4 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/MysteryPotion.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/MysteryPotion.java
@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.handler.itemhandlers;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.handler.IItemHandler;
import com.l2jmobius.gameserver.model.actor.L2Playable;
import com.l2jmobius.gameserver.model.actor.instance.L2ItemInstance;
@@ -64,7 +64,7 @@ public class MysteryPotion implements IItemHandler
activeChar.sendPacket(sm);
MysteryPotionStop mp = new MysteryPotionStop(playable);
- ThreadPoolManager.schedule(mp, EFFECT_DURATION);
+ ThreadPool.schedule(mp, EFFECT_DURATION);
}
public class MysteryPotionStop implements Runnable
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/Potions.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/Potions.java
index e12997ba99..e3bb049175 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/Potions.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/Potions.java
@@ -23,7 +23,7 @@ import java.util.Map;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.datatables.xml.ItemTable;
import com.l2jmobius.gameserver.handler.IItemHandler;
@@ -807,7 +807,7 @@ public class Potions implements IItemHandler
if (activeChar.isCastingNow() && (magicId > 2277) && (magicId < 2285))
{
_herbstask += 100;
- ThreadPoolManager.schedule(new HerbTask(activeChar, magicId, level), _herbstask);
+ ThreadPool.schedule(new HerbTask(activeChar, magicId, level), _herbstask);
}
else
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/ScrollOfEscape.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/ScrollOfEscape.java
index 088d83cac4..f7ce37a673 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/ScrollOfEscape.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/ScrollOfEscape.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.handler.itemhandlers;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillTable;
@@ -223,7 +223,7 @@ public class ScrollOfEscape implements IItemHandler
EscapeFinalizer ef = new EscapeFinalizer(activeChar, itemId);
// continue execution later
- activeChar.setSkillCast(ThreadPoolManager.schedule(ef, skill.getHitTime()));
+ activeChar.setSkillCast(ThreadPool.schedule(ef, skill.getHitTime()));
activeChar.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + (skill.getHitTime() / GameTimeController.MILLIS_IN_TICK));
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/SoulCrystals.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/SoulCrystals.java
index 8dfba71cba..788c540a09 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/SoulCrystals.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/SoulCrystals.java
@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.handler.itemhandlers;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.handler.IItemHandler;
import com.l2jmobius.gameserver.model.L2Object;
@@ -131,7 +131,7 @@ public class SoulCrystals implements IItemHandler
// Continue execution later
CrystalFinalizer cf = new CrystalFinalizer(activeChar, target, crystalId);
- ThreadPoolManager.schedule(cf, skill.getHitTime());
+ ThreadPool.schedule(cf, skill.getHitTime());
}
static class CrystalFinalizer implements Runnable
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/SummonItems.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/SummonItems.java
index 4514bf99ce..44b5848ede 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/SummonItems.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/itemhandlers/SummonItems.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.handler.itemhandlers;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.datatables.csv.SummonItemsData;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
@@ -173,7 +173,7 @@ public class SummonItems implements IItemHandler
final L2Skill skill = SkillTable.getInstance().getInfo(2046, 1);
activeChar.useMagic(skill, true, true);
activeChar.sendPacket(SystemMessageId.SUMMON_A_PET);
- ThreadPoolManager.schedule(new PetSummonFinalizer(activeChar, npcTemplate, item), 4800);
+ ThreadPool.schedule(new PetSummonFinalizer(activeChar, npcTemplate, item), 4800);
break;
}
case 2: // wyvern
@@ -289,7 +289,7 @@ public class SummonItems implements IItemHandler
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new PetSummonFeedWait(_activeChar, petSummon), 60000);
+ ThreadPool.schedule(new PetSummonFeedWait(_activeChar, petSummon), 60000);
}
else
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/ClanGate.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/ClanGate.java
index c33e96b15e..e040ef2789 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/ClanGate.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/skillhandlers/ClanGate.java
@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.handler.skillhandlers;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.handler.ISkillHandler;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -67,7 +67,7 @@ public class ClanGate implements ISkillHandler
if (player.isCastleLord(castle.getCastleId()))
{
// please note clan gate expires in two minutes WHATEVER happens to the clan leader.
- ThreadPoolManager.schedule(new RemoveClanGate(castle.getCastleId(), player), skill.getTotalLifeTime());
+ ThreadPool.schedule(new RemoveClanGate(castle.getCastleId(), player), skill.getTotalLifeTime());
castle.createClanGate(player.getX(), player.getY(), player.getZ() + 20);
player.getClan().broadcastToOnlineMembers(new SystemMessage(SystemMessageId.COURT_MAGICIAN_CREATED_PORTAL));
player.setIsParalyzed(true);
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/usercommandhandlers/Escape.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/usercommandhandlers/Escape.java
index 6387961138..35d9eda222 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/usercommandhandlers/Escape.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/usercommandhandlers/Escape.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.handler.usercommandhandlers;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.csv.MapRegionTable;
@@ -156,7 +156,7 @@ public class Escape implements IUserCommandHandler
// End SoE Animation section
EscapeFinalizer ef = new EscapeFinalizer(activeChar);
// continue execution later
- activeChar.setSkillCast(ThreadPoolManager.schedule(ef, unstuckTimer));
+ activeChar.setSkillCast(ThreadPool.schedule(ef, unstuckTimer));
activeChar.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + (unstuckTimer / GameTimeController.MILLIS_IN_TICK));
return true;
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/voicedcommandhandlers/FarmPvpCmd.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/voicedcommandhandlers/FarmPvpCmd.java
index 27bbace626..314d628a98 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/voicedcommandhandlers/FarmPvpCmd.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/voicedcommandhandlers/FarmPvpCmd.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.handler.voicedcommandhandlers;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.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.entity.olympiad.Olympiad;
@@ -118,7 +118,7 @@ public class FarmPvpCmd implements IVoicedCommandHandler
activeChar.sendPacket(sg);
activeChar.setIsImobilised(true);
- ThreadPoolManager.schedule(new teleportTask(activeChar, placex, placey, placez, message), 15000);
+ ThreadPool.schedule(new teleportTask(activeChar, placex, placey, placez, message), 15000);
return true;
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/voicedcommandhandlers/Wedding.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/voicedcommandhandlers/Wedding.java
index 41c413b191..d2df0c0294 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/voicedcommandhandlers/Wedding.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/voicedcommandhandlers/Wedding.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.handler.voicedcommandhandlers;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillTable;
@@ -409,7 +409,7 @@ public class Wedding implements IVoicedCommandHandler
EscapeFinalizer ef = new EscapeFinalizer(activeChar, partner.getX(), partner.getY(), partner.getZ(), partner.isIn7sDungeon());
// continue execution later
- activeChar.setSkillCast(ThreadPoolManager.schedule(ef, teleportTimer));
+ activeChar.setSkillCast(ThreadPool.schedule(ef, teleportTimer));
activeChar.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + (teleportTimer / GameTimeController.MILLIS_IN_TICK));
return true;
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
index d93c1371be..02f29e0b1a 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
@@ -21,7 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.PrimeFinder;
/**
@@ -57,7 +57,7 @@ public class BitSetIDFactory extends IdFactory
protected BitSetIDFactory()
{
super();
- ThreadPoolManager.scheduleAtFixedRate(new BitSetCapacityCheck(), 30000, 30000);
+ ThreadPool.scheduleAtFixedRate(new BitSetCapacityCheck(), 30000, 30000);
initialize();
LOGGER.info("IDFactory: " + _freeIds.size() + " id's available.");
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/AutoSaveManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/AutoSaveManager.java
index e48ce9a2c5..781bdfbb42 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/AutoSaveManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/AutoSaveManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -72,9 +72,9 @@ public class AutoSaveManager
public void startAutoSaveManager()
{
stopAutoSaveManager();
- _autoSaveInDB = ThreadPoolManager.scheduleAtFixedRate(new AutoSaveTask(), Config.AUTOSAVE_INITIAL_TIME, Config.AUTOSAVE_DELAY_TIME);
- _autoCheckConnectionStatus = ThreadPoolManager.scheduleAtFixedRate(new ConnectionCheckTask(), Config.CHECK_CONNECTION_INITIAL_TIME, Config.CHECK_CONNECTION_DELAY_TIME);
- _autoCleanDatabase = ThreadPoolManager.scheduleAtFixedRate(new AutoCleanDBTask(), Config.CLEANDB_INITIAL_TIME, Config.CLEANDB_DELAY_TIME);
+ _autoSaveInDB = ThreadPool.scheduleAtFixedRate(new AutoSaveTask(), Config.AUTOSAVE_INITIAL_TIME, Config.AUTOSAVE_DELAY_TIME);
+ _autoCheckConnectionStatus = ThreadPool.scheduleAtFixedRate(new ConnectionCheckTask(), Config.CHECK_CONNECTION_INITIAL_TIME, Config.CHECK_CONNECTION_DELAY_TIME);
+ _autoCleanDatabase = ThreadPool.scheduleAtFixedRate(new AutoCleanDBTask(), Config.CLEANDB_INITIAL_TIME, Config.CLEANDB_DELAY_TIME);
}
protected class AutoSaveTask implements Runnable
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/AwayManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/AwayManager.java
index 98d71e3598..7ca9770ef0 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/AwayManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/AwayManager.java
@@ -22,7 +22,7 @@ import java.util.WeakHashMap;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.SetupGauge;
@@ -90,7 +90,7 @@ public final class AwayManager
SetupGauge sg = new SetupGauge(SetupGauge.BLUE, Config.AWAY_TIMER * 1000);
activeChar.sendPacket(sg);
activeChar.setIsImobilised(true);
- ThreadPoolManager.schedule(new setPlayerAwayTask(activeChar, text), Config.AWAY_TIMER * 1000);
+ ThreadPool.schedule(new setPlayerAwayTask(activeChar, text), Config.AWAY_TIMER * 1000);
}
/**
@@ -101,7 +101,7 @@ public final class AwayManager
activeChar.sendMessage("You are back from Away Status in " + Config.BACK_TIMER + " Sec.");
SetupGauge sg = new SetupGauge(SetupGauge.BLUE, Config.BACK_TIMER * 1000);
activeChar.sendPacket(sg);
- ThreadPoolManager.schedule(new setPlayerBackTask(activeChar), Config.BACK_TIMER * 1000);
+ ThreadPool.schedule(new setPlayerBackTask(activeChar), Config.BACK_TIMER * 1000);
}
public void extraBack(L2PcInstance activeChar)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index f1227cb0ea..2d2864c5c5 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -25,7 +25,7 @@ import java.util.List;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.sql.ClanTable;
@@ -293,7 +293,7 @@ public class CastleManorManager
FirstDelay.set(Calendar.SECOND, 0);
FirstDelay.set(Calendar.MILLISECOND, 0);
FirstDelay.add(Calendar.MINUTE, 1);
- ThreadPoolManager.scheduleAtFixedRate(new ManorTask(), FirstDelay.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(), 60000);
+ ThreadPool.scheduleAtFixedRate(new ManorTask(), FirstDelay.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(), 60000);
}
public void setNextPeriod()
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/ChristmasManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/ChristmasManager.java
index 53c875a41b..956073e70d 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/ChristmasManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/ChristmasManager.java
@@ -22,7 +22,7 @@ import java.util.Random;
import java.util.concurrent.Future;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
import com.l2jmobius.gameserver.datatables.sql.SpawnTable;
import com.l2jmobius.gameserver.datatables.xml.ItemTable;
@@ -321,7 +321,7 @@ public class ChristmasManager
// Tasks:
- ThreadPoolManager.execute(new DeleteSpawns());
+ ThreadPool.execute(new DeleteSpawns());
endFestiveMessagesAtFixedRate();
isManagerInit--;
@@ -340,7 +340,7 @@ public class ChristmasManager
public void spawnTrees()
{
GetTreePos gtp = new GetTreePos(first);
- ThreadPoolManager.execute(gtp);
+ ThreadPool.execute(gtp);
}
/**
@@ -416,7 +416,7 @@ public class ChristmasManager
SpawnSantaNPCs ssNPCs = new SpawnSantaNPCs(first);
- _task = ThreadPoolManager.schedule(ssNPCs, 300);
+ _task = ThreadPool.schedule(ssNPCs, 300);
ssNPCs.setTask(_task);
return;
@@ -425,7 +425,7 @@ public class ChristmasManager
_iterator++;
GetTreePos gtp = new GetTreePos(_iterator);
- _task = ThreadPoolManager.schedule(gtp, 300);
+ _task = ThreadPool.schedule(gtp, 300);
gtp.setTask(_task);
}
}
@@ -523,7 +523,7 @@ public class ChristmasManager
private void startFestiveMessagesAtFixedRate()
{
SendXMasMessage XMasMessage = new SendXMasMessage();
- _XMasMessageTask = ThreadPoolManager.scheduleAtFixedRate(XMasMessage, 60000, _IntervalOfChristmas);
+ _XMasMessageTask = ThreadPool.scheduleAtFixedRate(XMasMessage, 60000, _IntervalOfChristmas);
}
/**
@@ -598,7 +598,7 @@ public class ChristmasManager
private void givePresentsAtFixedRate()
{
final XMasPresentGivingTask XMasPresents = new XMasPresentGivingTask();
- _XMasPresentsTask = ThreadPoolManager.scheduleAtFixedRate(XMasPresents, _IntervalOfChristmas, _IntervalOfChristmas * 3);
+ _XMasPresentsTask = ThreadPool.scheduleAtFixedRate(XMasPresents, _IntervalOfChristmas, _IntervalOfChristmas * 3);
}
class XMasPresentGivingTask implements Runnable
@@ -722,7 +722,7 @@ public class ChristmasManager
_iterator++;
SpawnSantaNPCs ssNPCs = new SpawnSantaNPCs(_iterator);
- _task = ThreadPoolManager.schedule(ssNPCs, 300);
+ _task = ThreadPool.schedule(ssNPCs, 300);
ssNPCs.setTask(_task);
}
}
@@ -741,7 +741,7 @@ public class ChristmasManager
LOGGER.info("ChristmasManager:Init ChristmasManager was started successfully, have a festive holiday.");
final EndEvent ee = new EndEvent();
- Future> task = ThreadPoolManager.schedule(ee, 86400000);
+ Future> task = ThreadPool.schedule(ee, 86400000);
ee.setTask(task);
isManagerInit = 5;
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/FishingChampionshipManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/FishingChampionshipManager.java
index 9a968d3cdc..c5e3ef6948 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/FishingChampionshipManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/FishingChampionshipManager.java
@@ -27,7 +27,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.xml.ItemTable;
@@ -67,7 +67,7 @@ public class FishingChampionshipManager
}
else
{
- ThreadPoolManager.schedule(new finishChamp(), _enddate - System.currentTimeMillis());
+ ThreadPool.schedule(new finishChamp(), _enddate - System.currentTimeMillis());
}
}
@@ -316,7 +316,7 @@ public class FishingChampionshipManager
pl.sendPacket(html);
refreshResult();
- ThreadPoolManager.schedule(new needRefresh(), 60000);
+ ThreadPool.schedule(new needRefresh(), 60000);
return;
}
@@ -482,7 +482,7 @@ public class FishingChampionshipManager
shutdown();
LOGGER.info("FishingChampionshipManager : new event period start.");
- ThreadPoolManager.schedule(new finishChamp(), _enddate - System.currentTimeMillis());
+ ThreadPool.schedule(new finishChamp(), _enddate - System.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
index 3c2251e64a..6574116a1d 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
@@ -28,7 +28,7 @@ import java.util.Set;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.csv.DoorTable;
@@ -321,7 +321,7 @@ public class FourSepulchersManager extends GrandBossManager
// check
{
clean();
- _changeEntryTimeTask = ThreadPoolManager.schedule(new ChangeEntryTime(), 0);
+ _changeEntryTimeTask = ThreadPool.schedule(new ChangeEntryTime(), 0);
LOGGER.info("FourSepulchersManager: Beginning in Entry time");
}
else if ((currentTime >= _entryTimeEnd) && (currentTime < _warmUpTimeEnd)) // warmup
@@ -329,7 +329,7 @@ public class FourSepulchersManager extends GrandBossManager
// check
{
clean();
- _changeWarmUpTimeTask = ThreadPoolManager.schedule(new ChangeWarmUpTime(), 0);
+ _changeWarmUpTimeTask = ThreadPool.schedule(new ChangeWarmUpTime(), 0);
LOGGER.info("FourSepulchersManager: Beginning in WarmUp time");
}
else if ((currentTime >= _warmUpTimeEnd) && (currentTime < _attackTimeEnd)) // attack
@@ -337,14 +337,14 @@ public class FourSepulchersManager extends GrandBossManager
// check
{
clean();
- _changeAttackTimeTask = ThreadPoolManager.schedule(new ChangeAttackTime(), 0);
+ _changeAttackTimeTask = ThreadPool.schedule(new ChangeAttackTime(), 0);
LOGGER.info("FourSepulchersManager: Beginning in Attack time");
}
else
// else cooldown time and without cleanup because it's already
// implemented
{
- _changeCoolDownTimeTask = ThreadPoolManager.schedule(new ChangeCoolDownTime(), 0);
+ _changeCoolDownTimeTask = ThreadPool.schedule(new ChangeCoolDownTime(), 0);
LOGGER.info("FourSepulchersManager: Beginning in Cooldown time");
}
}
@@ -1783,7 +1783,7 @@ public class FourSepulchersManager extends GrandBossManager
// cannot be
// more than
// 59
- ThreadPoolManager.schedule(new ManagerSay(), 5 * 60000);
+ ThreadPool.schedule(new ManagerSay(), 5 * 60000);
}
// attack time ending chat
else if ((tmp.get(Calendar.MINUTE) + 5) >= Config.FS_TIME_ATTACK)
@@ -1826,8 +1826,8 @@ public class FourSepulchersManager extends GrandBossManager
}
// launching saying process...
- ThreadPoolManager.schedule(new ManagerSay(), 0);
- _changeWarmUpTimeTask = ThreadPoolManager.schedule(new ChangeWarmUpTime(), interval);
+ ThreadPool.schedule(new ManagerSay(), 0);
+ _changeWarmUpTimeTask = ThreadPool.schedule(new ChangeWarmUpTime(), interval);
if (_changeEntryTimeTask != null)
{
_changeEntryTimeTask.cancel(true);
@@ -1860,7 +1860,7 @@ public class FourSepulchersManager extends GrandBossManager
{
interval = Config.FS_TIME_WARMUP * 60000;
}
- _changeAttackTimeTask = ThreadPoolManager.schedule(new ChangeAttackTime(), interval);
+ _changeAttackTimeTask = ThreadPool.schedule(new ChangeAttackTime(), interval);
if (_changeWarmUpTimeTask != null)
{
@@ -1907,14 +1907,14 @@ public class FourSepulchersManager extends GrandBossManager
// + " minute of this hour.");
final Calendar inter = Calendar.getInstance();
inter.set(Calendar.MINUTE, (int) min);
- ThreadPoolManager.schedule(new ManagerSay(), inter.getTimeInMillis() - Calendar.getInstance().getTimeInMillis());
+ ThreadPool.schedule(new ManagerSay(), inter.getTimeInMillis() - Calendar.getInstance().getTimeInMillis());
break;
}
}
}
else
{
- ThreadPoolManager.schedule(new ManagerSay(), 5 * 60400);
+ ThreadPool.schedule(new ManagerSay(), 5 * 60400);
}
// searching time when attack time will be ended:
// counting difference between time when attack time ends and
@@ -1928,7 +1928,7 @@ public class FourSepulchersManager extends GrandBossManager
{
interval = Config.FS_TIME_ATTACK * 60000;
}
- _changeCoolDownTimeTask = ThreadPoolManager.schedule(new ChangeCoolDownTime(), interval);
+ _changeCoolDownTimeTask = ThreadPool.schedule(new ChangeCoolDownTime(), interval);
if (_changeAttackTimeTask != null)
{
@@ -1967,7 +1967,7 @@ public class FourSepulchersManager extends GrandBossManager
}
final long interval = time.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
- _changeEntryTimeTask = ThreadPoolManager.schedule(new ChangeEntryTime(), interval);
+ _changeEntryTimeTask = ThreadPool.schedule(new ChangeEntryTime(), interval);
if (_changeCoolDownTimeTask != null)
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 42835b1d22..083b26bc54 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -25,7 +25,7 @@ import java.util.List;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
@@ -69,7 +69,7 @@ public class ItemsOnGroundManager
if (Config.SAVE_DROPPED_ITEM_INTERVAL > 0)
{
- ThreadPoolManager.scheduleAtFixedRate(new StoreInDb(), Config.SAVE_DROPPED_ITEM_INTERVAL, Config.SAVE_DROPPED_ITEM_INTERVAL);
+ ThreadPool.scheduleAtFixedRate(new StoreInDb(), Config.SAVE_DROPPED_ITEM_INTERVAL, Config.SAVE_DROPPED_ITEM_INTERVAL);
}
}
@@ -208,7 +208,7 @@ public class ItemsOnGroundManager
return;
}
- ThreadPoolManager.execute(new StoreInDb());
+ ThreadPool.execute(new StoreInDb());
}
public void cleanUp()
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/MercTicketManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/MercTicketManager.java
index 1114f7f3f3..dd671506ce 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/MercTicketManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/MercTicketManager.java
@@ -23,7 +23,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
import com.l2jmobius.gameserver.handler.AutoChatHandler;
@@ -894,7 +894,7 @@ public class MercTicketManager
if (despawnDelay > 0)
{
- ThreadPoolManager.schedule(() -> npc.deleteMe(), despawnDelay);
+ ThreadPool.schedule(() -> npc.deleteMe(), despawnDelay);
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java
index c7519028fd..30c951e1b3 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java
@@ -28,7 +28,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.GmListTable;
@@ -201,7 +201,7 @@ public class RaidBossSpawnManager
info.set("respawnTime", respawnTime);
ScheduledFuture> futureSpawn;
- futureSpawn = ThreadPoolManager.schedule(new SpawnSchedule(boss.getNpcId()), respawn_delay);
+ futureSpawn = ThreadPool.schedule(new SpawnSchedule(boss.getNpcId()), respawn_delay);
_schedules.put(boss.getNpcId(), futureSpawn);
@@ -274,7 +274,7 @@ public class RaidBossSpawnManager
ScheduledFuture> futureSpawn;
final long spawnTime = respawnTime - Calendar.getInstance().getTimeInMillis();
- futureSpawn = ThreadPoolManager.schedule(new SpawnSchedule(bossId), spawnTime);
+ futureSpawn = ThreadPool.schedule(new SpawnSchedule(bossId), spawnTime);
_schedules.put(bossId, futureSpawn);
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/CursedWeapon.java
index cbbe9511db..0b085811e3 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/CursedWeapon.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Point3D;
import com.l2jmobius.commons.util.Rnd;
@@ -341,7 +341,7 @@ public class CursedWeapon
}
else
{
- _removeTask = ThreadPoolManager.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000L, _durationLost * 12000L);
+ _removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000L, _durationLost * 12000L);
}
}
@@ -356,7 +356,7 @@ public class CursedWeapon
// 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;
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/DropProtection.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/DropProtection.java
index 772b0ca9ac..df58cdb12a 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/DropProtection.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/DropProtection.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model;
import java.util.concurrent.ScheduledFuture;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
@@ -105,6 +105,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);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Effect.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Effect.java
index 4da38b24c1..3b7323d3ba 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Effect.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Effect.java
@@ -22,7 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.model.L2Skill.SkillType;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -247,7 +247,7 @@ public abstract class L2Effect
final int duration = _period - _periodfirsttime;
// LOGGER.warning("Period: "+_period+"-"+_periodfirsttime+"="+duration);
_currentTask = new EffectTask(duration * 1000, -1);
- _currentFuture = ThreadPoolManager.schedule(_currentTask, duration * 1000);
+ _currentFuture = ThreadPool.schedule(_currentTask, duration * 1000);
}
}
@@ -338,7 +338,7 @@ public abstract class L2Effect
{
stopEffectTask();
_currentTask = new EffectTask(duration, -1);
- _currentFuture = ThreadPoolManager.schedule(_currentTask, duration);
+ _currentFuture = ThreadPool.schedule(_currentTask, duration);
if (_state == EffectState.ACTING)
{
@@ -358,7 +358,7 @@ public abstract class L2Effect
{
stopEffectTask();
_currentTask = new EffectTask(delay, rate);
- _currentFuture = ThreadPoolManager.scheduleAtFixedRate(_currentTask, delay, rate);
+ _currentFuture = ThreadPool.scheduleAtFixedRate(_currentTask, delay, rate);
if (_state == EffectState.ACTING)
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Fishing.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Fishing.java
index d28ceca93a..6806e504f2 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Fishing.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Fishing.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model;
import java.util.concurrent.Future;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
import com.l2jmobius.gameserver.instancemanager.FishingChampionshipManager;
@@ -113,7 +113,7 @@ public class L2Fishing implements Runnable
if (_fishAiTask == null)
{
- _fishAiTask = ThreadPoolManager.scheduleAtFixedRate(this, 1000, 1000);
+ _fishAiTask = ThreadPool.scheduleAtFixedRate(this, 1000, 1000);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Party.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Party.java
index b39094b2c2..3ab9a1247a 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Party.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Party.java
@@ -22,7 +22,7 @@ import java.util.NoSuchElementException;
import java.util.concurrent.Future;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.datatables.xml.ItemTable;
@@ -395,7 +395,7 @@ public class L2Party
// activate position task
if (_positionBroadcastTask == null)
{
- _positionBroadcastTask = ThreadPoolManager.scheduleAtFixedRate(new PositionBroadcast(), PARTY_POSITION_BROADCAST / 2, PARTY_POSITION_BROADCAST);
+ _positionBroadcastTask = ThreadPool.scheduleAtFixedRate(new PositionBroadcast(), PARTY_POSITION_BROADCAST / 2, PARTY_POSITION_BROADCAST);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Potion.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Potion.java
index 2a75087780..f6533c34d5 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Potion.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Potion.java
@@ -20,7 +20,7 @@ import java.util.concurrent.Future;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Character;
/**
@@ -189,7 +189,7 @@ public class L2Potion extends L2Object
private void startPotionMpRegeneration(L2Character activeChar)
{
- _potionmpRegTask = ThreadPoolManager.scheduleAtFixedRate(new PotionMpHealing(activeChar), 1000, _milliseconds);
+ _potionmpRegTask = ThreadPool.scheduleAtFixedRate(new PotionMpHealing(activeChar), 1000, _milliseconds);
if (Config.DEBUG)
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Radar.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Radar.java
index 1981599892..bfcbe6b516 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Radar.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Radar.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model;
import java.util.Vector;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.RadarControl;
@@ -127,7 +127,7 @@ public final class L2Radar
return;
}
_me.sendPacket(new RadarControl(0, 1, _myTarget.getX(), _myTarget.getY(), _myTarget.getZ()));
- ThreadPoolManager.schedule(new RadarOnPlayer(_myTarget, _me), 15000);
+ ThreadPool.schedule(new RadarOnPlayer(_myTarget, _me), 15000);
}
catch (Throwable t)
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Request.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Request.java
index 762dc86768..8a754d14a5 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Request.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2Request.java
@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.model;
-import com.l2jmobius.commons.concurrent.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.L2GameClientPacket;
@@ -128,7 +128,7 @@ public class L2Request
_isRequestor = isRequestor ? true : false;
_isAnswerer = isRequestor ? false : true;
- ThreadPoolManager.schedule(() -> clear(), REQUEST_TIMEOUT * 1000);
+ ThreadPool.schedule(() -> clear(), REQUEST_TIMEOUT * 1000);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 69b6404a17..f2c4c19073 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.object.L2ObjectSet;
import com.l2jmobius.gameserver.ai.L2AttackableAI;
import com.l2jmobius.gameserver.ai.L2FortSiegeGuardAI;
@@ -350,7 +350,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);
}
/**
@@ -367,7 +367,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);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
index cdb84c90a9..71903019e1 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
@@ -22,7 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
@@ -472,7 +472,7 @@ public class L2Attackable extends L2NpcInstance
{
_commandChannelTimer = new CommandChannelTimer(this);
_commandChannelLastAttack = System.currentTimeMillis();
- ThreadPoolManager.schedule(_commandChannelTimer, 10000); // check for last attack
+ ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastToChannelMembers(new CreatureSay(0, Say2.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
}
@@ -3401,7 +3401,7 @@ public class L2Attackable extends L2NpcInstance
}
else
{
- ThreadPoolManager.schedule(this, 10000); // 10sec
+ ThreadPool.schedule(this, 10000); // 10sec
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index 93c23922f6..3163772981 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -29,7 +29,7 @@ import java.util.concurrent.Future;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Point3D;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
@@ -1186,7 +1186,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
if (getCurrentMp() < mpConsume)
{
// If L2PcInstance doesn't have enough MP, stop the attack
- ThreadPoolManager.schedule(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), 1000);
+ ThreadPool.schedule(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), 1000);
sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_MP));
sendPacket(ActionFailed.STATIC_PACKET);
@@ -1201,7 +1201,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
else
{
// Cancel the action because the bow can't be re-use at this moment
- ThreadPoolManager.schedule(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), 1000);
+ ThreadPool.schedule(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), 1000);
sendPacket(ActionFailed.STATIC_PACKET);
return;
@@ -1392,7 +1392,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
// Notify AI with EVT_READY_TO_ACT
- ThreadPoolManager.schedule(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), timeAtk + reuse);
+ ThreadPool.schedule(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), timeAtk + reuse);
}
/**
@@ -1455,7 +1455,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
// Create a new hit task with Medium priority
- ThreadPoolManager.schedule(new HitTask(target, damage1, crit1, miss1, attack.soulshot, shld1), sAtk);
+ ThreadPool.schedule(new HitTask(target, damage1, crit1, miss1, attack.soulshot, shld1), sAtk);
// Calculate and set the disable delay of the bow in function of the Attack Speed
_disableBowAttackEndTime = ((sAtk + reuse) / GameTimeController.MILLIS_IN_TICK) + GameTimeController.getGameTicks();
@@ -1526,10 +1526,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
// Create a new hit task with Medium priority for hit 1
- ThreadPoolManager.schedule(new HitTask(target, damage1, crit1, miss1, attack.soulshot, shld1), sAtk / 2);
+ ThreadPool.schedule(new HitTask(target, damage1, crit1, miss1, attack.soulshot, shld1), sAtk / 2);
// Create a new hit task with Medium priority for hit 2 with a higher delay
- ThreadPoolManager.schedule(new HitTask(target, damage2, crit2, miss2, attack.soulshot, shld2), sAtk);
+ ThreadPool.schedule(new HitTask(target, damage2, crit2, miss2, attack.soulshot, shld2), sAtk);
// Add those hits to the Server-Client packet Attack
attack.addHit(target, damage1, miss1, crit1, shld1);
@@ -1690,7 +1690,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
// Create a new hit task with Medium priority
- ThreadPoolManager.schedule(new HitTask(target, damage1, crit1, miss1, attack.soulshot, shld1), sAtk);
+ ThreadPool.schedule(new HitTask(target, damage1, crit1, miss1, attack.soulshot, shld1), sAtk);
// Add this hit to the Server-Client packet Attack
attack.addHit(target, damage1, miss1, crit1, shld1);
@@ -2128,20 +2128,20 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
{
if (skill.isPotion())
{
- _potionCast = ThreadPoolManager.schedule(new MagicUseTask(targets, skill, coolTime, 2), hitTime);
+ _potionCast = ThreadPool.schedule(new MagicUseTask(targets, skill, coolTime, 2), hitTime);
}
else
{
- _skillCast = ThreadPoolManager.schedule(new MagicUseTask(targets, skill, coolTime, 2), hitTime);
+ _skillCast = ThreadPool.schedule(new MagicUseTask(targets, skill, coolTime, 2), hitTime);
}
}
else if (skill.isPotion())
{
- _potionCast = ThreadPoolManager.schedule(new MagicUseTask(targets, skill, coolTime, 1), hitTime - 200);
+ _potionCast = ThreadPool.schedule(new MagicUseTask(targets, skill, coolTime, 1), hitTime - 200);
}
else
{
- _skillCast = ThreadPoolManager.schedule(new MagicUseTask(targets, skill, coolTime, 1), hitTime - 200);
+ _skillCast = ThreadPool.schedule(new MagicUseTask(targets, skill, coolTime, 1), hitTime - 200);
}
}
else
@@ -6155,7 +6155,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
if (updateKnownObjects)
{
- ThreadPoolManager.execute(new KnownListAsynchronousUpdateTask(this));
+ ThreadPool.execute(new KnownListAsynchronousUpdateTask(this));
}
}
@@ -6592,7 +6592,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// 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(CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
+ ThreadPool.schedule(new NotifyAITask(CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
}
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive to destination by GameTimeController
@@ -6675,7 +6675,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// 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(CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
+ ThreadPool.schedule(new NotifyAITask(CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
}
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive
@@ -8504,11 +8504,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
else if (skill.isPotion())
{
- _potionCast = ThreadPoolManager.schedule(new MagicUseTask(final_targets, skill, coolTime, 2), 200);
+ _potionCast = ThreadPool.schedule(new MagicUseTask(final_targets, skill, coolTime, 2), 200);
}
else
{
- _skillCast = ThreadPoolManager.schedule(new MagicUseTask(final_targets, skill, coolTime, 2), 200);
+ _skillCast = ThreadPool.schedule(new MagicUseTask(final_targets, skill, coolTime, 2), 200);
}
}
@@ -8685,11 +8685,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
else if (skill.isPotion())
{
- _potionCast = ThreadPoolManager.schedule(new MagicUseTask(targets, skill, coolTime, 3), coolTime);
+ _potionCast = ThreadPool.schedule(new MagicUseTask(targets, skill, coolTime, 3), coolTime);
}
else
{
- _skillCast = ThreadPoolManager.schedule(new MagicUseTask(targets, skill, coolTime, 3), coolTime);
+ _skillCast = ThreadPool.schedule(new MagicUseTask(targets, skill, coolTime, 3), coolTime);
}
}
@@ -8798,7 +8798,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// DON'T USE : Recursive call to useMagic() method
// currPlayer.useMagic(queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed());
- ThreadPoolManager.execute(new QueuedMagicUseTask(currPlayer, queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed()));
+ ThreadPool.execute(new QueuedMagicUseTask(currPlayer, queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed()));
}
final L2Weapon activeWeapon = getActiveWeaponItem();
@@ -8924,7 +8924,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
if (delay > 10)
{
- ThreadPoolManager.schedule(new EnableSkill(skill), delay);
+ ThreadPool.schedule(new EnableSkill(skill), delay);
}
}
@@ -9318,7 +9318,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
{
hitTime = (int) (0.70 * hitTime);
}
- ThreadPoolManager.schedule(new notifyAiTaskDelayed(CtrlEvent.EVT_ATTACKED, this, target), hitTime);
+ ThreadPool.schedule(new notifyAiTaskDelayed(CtrlEvent.EVT_ATTACKED, this, target), hitTime);
break;
}
}
@@ -9730,7 +9730,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
{
updatePvPFlag(1);
- _PvPRegTask = ThreadPoolManager.scheduleAtFixedRate(new PvPFlag(), 1000, 1000);
+ _PvPRegTask = ThreadPool.scheduleAtFixedRate(new PvPFlag(), 1000, 1000);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2BabyPetInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2BabyPetInstance.java
index c74159d37e..76e6451741 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2BabyPetInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2BabyPetInstance.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.concurrent.Future;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.model.L2Skill;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -83,7 +83,7 @@ public final class L2BabyPetInstance extends L2PetInstance
}
// start the healing task
- _healingTask = ThreadPoolManager.scheduleAtFixedRate(new Heal(this), 0, 1000);
+ _healingTask = ThreadPool.scheduleAtFixedRate(new Heal(this), 0, 1000);
}
}
@@ -121,7 +121,7 @@ public final class L2BabyPetInstance extends L2PetInstance
super.doRevive();
if (_healingTask == null)
{
- _healingTask = ThreadPoolManager.scheduleAtFixedRate(new Heal(this), 0, 1000);
+ _healingTask = ThreadPool.scheduleAtFixedRate(new Heal(this), 0, 1000);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2BoatInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2BoatInstance.java
index 71442dfb20..384ece001a 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2BoatInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2BoatInstance.java
@@ -28,7 +28,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.knownlist.BoatKnownList;
@@ -347,21 +347,21 @@ public class L2BoatInstance extends L2Character
{
_boat.say(5);
bc = new BoatCaptain(2, _boat);
- ThreadPoolManager.schedule(bc, 240000);
+ ThreadPool.schedule(bc, 240000);
break;
}
case 2:
{
_boat.say(1);
bc = new BoatCaptain(3, _boat);
- ThreadPoolManager.schedule(bc, 40000);
+ ThreadPool.schedule(bc, 40000);
break;
}
case 3:
{
_boat.say(0);
bc = new BoatCaptain(4, _boat);
- ThreadPoolManager.schedule(bc, 20000);
+ ThreadPool.schedule(bc, 20000);
break;
}
case 4:
@@ -402,14 +402,14 @@ public class L2BoatInstance extends L2Character
{
_state++;
Boatrun bc = new Boatrun(_state, _boat);
- ThreadPoolManager.schedule(bc, time);
+ ThreadPool.schedule(bc, time);
}
else if (time == 0)
{
_boat._cycle = 2;
_boat.say(10);
BoatCaptain bc = new BoatCaptain(1, _boat);
- ThreadPoolManager.schedule(bc, 300000);
+ ThreadPool.schedule(bc, 300000);
}
else
{
@@ -425,14 +425,14 @@ public class L2BoatInstance extends L2Character
{
_state++;
Boatrun bc = new Boatrun(_state, _boat);
- ThreadPoolManager.schedule(bc, time);
+ ThreadPool.schedule(bc, time);
}
else if (time == 0)
{
_boat._cycle = 1;
_boat.say(10);
BoatCaptain bc = new BoatCaptain(1, _boat);
- ThreadPoolManager.schedule(bc, 300000);
+ ThreadPool.schedule(bc, 300000);
}
else
{
@@ -452,7 +452,7 @@ public class L2BoatInstance extends L2Character
{
// _runstate++;
Boatrun bc = new Boatrun(_runstate, this);
- ThreadPoolManager.schedule(bc, 10);
+ ThreadPool.schedule(bc, 10);
_runstate = 0;
}
}
@@ -477,7 +477,7 @@ public class L2BoatInstance extends L2Character
{
say(10);
BoatCaptain bc = new BoatCaptain(1, this);
- ThreadPoolManager.schedule(bc, 300000);
+ ThreadPool.schedule(bc, 300000);
}
private int lastx = -1;
@@ -559,7 +559,7 @@ public class L2BoatInstance extends L2Character
}
}
Boatrun bc = new Boatrun(0, this);
- ThreadPoolManager.schedule(bc, 0);
+ ThreadPool.schedule(bc, 0);
}
else if (_cycle == 2)
{
@@ -596,7 +596,7 @@ public class L2BoatInstance extends L2Character
}
}
Boatrun bc = new Boatrun(0, this);
- ThreadPoolManager.schedule(bc, 0);
+ ThreadPool.schedule(bc, 0);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CabaleBufferInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CabaleBufferInstance.java
index 6c38266d52..70384ab3d4 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CabaleBufferInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CabaleBufferInstance.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.concurrent.ScheduledFuture;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.model.L2Object;
@@ -187,7 +187,7 @@ public class L2CabaleBufferInstance extends L2NpcInstance
_aiTask.cancel(true);
}
- _aiTask = ThreadPoolManager.scheduleAtFixedRate(new CabalaAI(this), 3000, 3000);
+ _aiTask = ThreadPool.scheduleAtFixedRate(new CabalaAI(this), 3000, 3000);
}
@Override
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CastleTeleporterInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CastleTeleporterInstance.java
index 2e4b8f47e2..93df7e1826 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CastleTeleporterInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CastleTeleporterInstance.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.StringTokenizer;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.templates.chars.L2NpcTemplate;
@@ -70,7 +70,7 @@ public final class L2CastleTeleporterInstance extends L2NpcInstance
}
setTask(true);
- ThreadPoolManager.schedule(new oustAllPlayers(), delay);
+ ThreadPool.schedule(new oustAllPlayers(), delay);
}
final String filename = "data/html/castleteleporter/MassGK-1.htm";
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CubicInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CubicInstance.java
index 8e71923502..6d89dfd083 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CubicInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2CubicInstance.java
@@ -22,7 +22,7 @@ import java.util.concurrent.Future;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.datatables.SkillTable;
@@ -303,7 +303,7 @@ public class L2CubicInstance
break;
}
}
- _disappearTask = ThreadPoolManager.schedule(new Disappear(), totallifetime); // disappear
+ _disappearTask = ThreadPool.schedule(new Disappear(), totallifetime); // disappear
}
/**
@@ -333,12 +333,12 @@ public class L2CubicInstance
case SMART_CUBIC_EVATEMPLAR:
case SMART_CUBIC_SHILLIENTEMPLAR:
{
- _actionTask = ThreadPoolManager.scheduleAtFixedRate(new Action(_activationchance), 0, _activationtime);
+ _actionTask = ThreadPool.scheduleAtFixedRate(new Action(_activationchance), 0, _activationtime);
break;
}
case LIFE_CUBIC:
{
- _actionTask = ThreadPoolManager.scheduleAtFixedRate(new Heal(), 0, _activationtime);
+ _actionTask = ThreadPool.scheduleAtFixedRate(new Heal(), 0, _activationtime);
break;
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
index 9f9ca19439..db96fa9410 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.L2CharacterAI;
import com.l2jmobius.gameserver.ai.L2DoorAI;
@@ -411,7 +411,7 @@ public class L2DoorInstance extends L2Character
if (actionDelay > -1)
{
AutoOpenClose ao = new AutoOpenClose();
- ThreadPoolManager.scheduleAtFixedRate(ao, actionDelay, actionDelay);
+ ThreadPool.scheduleAtFixedRate(ao, actionDelay, actionDelay);
}
else if (_autoActionTask != null)
{
@@ -870,7 +870,7 @@ public class L2DoorInstance extends L2Character
*/
public void onOpen()
{
- ThreadPoolManager.schedule(new CloseTask(), 60000);
+ ThreadPool.schedule(new CloseTask(), 60000);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GrandBossInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GrandBossInstance.java
index c7b01fca08..445ed72e8b 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GrandBossInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GrandBossInstance.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.actor.instance;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
import com.l2jmobius.gameserver.instancemanager.RaidBossPointsManager;
@@ -104,7 +104,7 @@ public final class L2GrandBossInstance extends L2MonsterInstance
protected void manageMinions()
{
_minionList.spawnMinions();
- _minionMaintainTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _minionMaintainTask = ThreadPool.scheduleAtFixedRate(() ->
{
// Teleport raid boss home if it's too far from home location
final L2Spawn bossSpawn = getSpawn();
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java
index ba6d9f13bf..152aaae1ea 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.L2AttackableAI;
@@ -93,7 +93,7 @@ public final class L2GuardInstance extends L2Attackable
super(objectId, template);
getKnownList(); // init knownlist
- ThreadPoolManager.scheduleAtFixedRate(new ReturnTask(), RETURN_INTERVAL, RETURN_INTERVAL + Rnd.nextInt(60000));
+ ThreadPool.scheduleAtFixedRate(new ReturnTask(), RETURN_INTERVAL, RETURN_INTERVAL + Rnd.nextInt(60000));
}
/*
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardNoHTMLInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardNoHTMLInstance.java
index 249dbbd4f7..f5d507dd1c 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardNoHTMLInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardNoHTMLInstance.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.L2AttackableAI;
@@ -91,7 +91,7 @@ public final class L2GuardNoHTMLInstance extends L2Attackable
{
super(objectId, template);
getKnownList(); // init knownlist
- ThreadPoolManager.scheduleAtFixedRate(new ReturnTask(), RETURN_INTERVAL, RETURN_INTERVAL + Rnd.nextInt(60000));
+ ThreadPool.scheduleAtFixedRate(new ReturnTask(), RETURN_INTERVAL, RETURN_INTERVAL + Rnd.nextInt(60000));
}
/*
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2ItemInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2ItemInstance.java
index c6c4159608..03dc8c929a 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2ItemInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2ItemInstance.java
@@ -26,7 +26,7 @@ import java.util.logging.LogRecord;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.xml.ItemTable;
@@ -1033,7 +1033,7 @@ public final class L2ItemInstance extends L2Object
private void scheduleConsumeManaTask()
{
_consumingMana = true;
- ThreadPoolManager.schedule(new ScheduleConsumeManaTask(this), MANA_CONSUMPTION_RATE);
+ ThreadPool.schedule(new ScheduleConsumeManaTask(this), MANA_CONSUMPTION_RATE);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java
index 7714296985..6aad936cf1 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java
@@ -21,7 +21,7 @@ import java.util.List;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -90,7 +90,7 @@ public class L2MonsterInstance extends L2Attackable
*/
public void returnHome()
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
L2Spawn mobSpawn = getSpawn();
if (!isInCombat() && !isAlikeDead() && !isDead() && (mobSpawn != null) && !isInsideRadius(mobSpawn.getX(), mobSpawn.getY(), Config.MAX_DRIFT_RANGE, false))
@@ -183,7 +183,7 @@ public class L2MonsterInstance extends L2Attackable
*/
protected void manageMinions()
{
- _minionMaintainTask = ThreadPoolManager.schedule(() -> _minionList.spawnMinions(), getMaintenanceInterval());
+ _minionMaintainTask = ThreadPool.schedule(() -> _minionList.spawnMinions(), getMaintenanceInterval());
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java
index b993733094..b2ef37d82f 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java
@@ -23,7 +23,7 @@ import java.util.ArrayList;
import java.util.List;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.cache.HtmCache;
@@ -249,7 +249,7 @@ public class L2NpcInstance extends L2Character
// Create a RandomAnimation Task that will be launched after the calculated delay
_rAniTask = new RandomAnimationTask();
- ThreadPoolManager.schedule(_rAniTask, interval);
+ ThreadPool.schedule(_rAniTask, interval);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
index 44bfe2000d..259c8b15be 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
@@ -39,7 +39,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.crypt.nProtect;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Point3D;
@@ -4231,7 +4231,7 @@ public final class L2PcInstance extends L2Playable
return;
}
- ThreadPoolManager.execute(launchedMovingTask);
+ ThreadPool.execute(launchedMovingTask);
}
}
@@ -4322,7 +4322,7 @@ public final class L2PcInstance extends L2Playable
broadcastPacket(new ChangeWaitType(this, ChangeWaitType.WT_SITTING));
sittingTaskLaunched = true;
// Schedule a sit down task to wait for the animation to finish
- ThreadPoolManager.schedule(new SitDownTask(this), 2500);
+ ThreadPool.schedule(new SitDownTask(this), 2500);
setIsParalyzed(true);
}
}
@@ -4406,7 +4406,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
setIsImobilised(true);
- ThreadPoolManager.schedule(new StandUpTask(this), 2000);
+ ThreadPool.schedule(new StandUpTask(this), 2000);
stopFakeDeath(null);
}
@@ -4442,7 +4442,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
setIsImobilised(true);
- ThreadPoolManager.schedule(new StandUpTask(this), 2500);
+ ThreadPool.schedule(new StandUpTask(this), 2500);
}
}
@@ -4890,7 +4890,7 @@ public final class L2PcInstance extends L2Playable
else
{
_herbstask += 100;
- ThreadPoolManager.schedule(new HerbTask(process, itemId, count, reference, sendMessage), _herbstask);
+ ThreadPool.schedule(new HerbTask(process, itemId, count, reference, sendMessage), _herbstask);
}
}
else
@@ -5612,7 +5612,7 @@ public final class L2PcInstance extends L2Playable
if (protect)
{
- ThreadPoolManager.schedule(new TeleportProtectionFinalizer(this), (Config.PLAYER_SPAWN_PROTECTION - 1) * 1000);
+ ThreadPool.schedule(new TeleportProtectionFinalizer(this), (Config.PLAYER_SPAWN_PROTECTION - 1) * 1000);
}
}
@@ -5631,7 +5631,7 @@ public final class L2PcInstance extends L2Playable
if (protect)
{
- ThreadPoolManager.schedule(new TeleportProtectionFinalizer(this), (Config.PLAYER_TELEPORT_PROTECTION - 1) * 1000);
+ ThreadPool.schedule(new TeleportProtectionFinalizer(this), (Config.PLAYER_TELEPORT_PROTECTION - 1) * 1000);
}
}
@@ -7392,7 +7392,7 @@ public final class L2PcInstance extends L2Playable
pk.sendMessage("You are a teamkiller !!! Teamkills not counting.");
}
sendMessage("You will be revived and teleported to team spot in " + (Config.TVT_REVIVE_DELAY / 1000) + " seconds!");
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
teleToLocation((TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, (TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)), false);
doRevive();
@@ -7404,7 +7404,7 @@ public final class L2PcInstance extends L2Playable
if (TvT.is_teleport() || TvT.is_started())
{
sendMessage("You will be revived and teleported to team spot in " + (Config.TVT_REVIVE_DELAY / 1000) + " seconds!");
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
teleToLocation(TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)), false);
doRevive();
@@ -7421,7 +7421,7 @@ public final class L2PcInstance extends L2Playable
{
removeCTFFlagOnDie();
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
teleToLocation(CTF._teamsX.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsY.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsZ.get(CTF._teams.indexOf(_teamNameCTF)), false);
doRevive();
@@ -7448,7 +7448,7 @@ public final class L2PcInstance extends L2Playable
}
sendMessage("You will be revived and teleported to spot in 20 seconds!");
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
final Location p_loc = DM.get_playersSpawnLocation();
teleToLocation(p_loc._x, p_loc._y, p_loc._z, false);
@@ -7461,7 +7461,7 @@ public final class L2PcInstance extends L2Playable
if (DM.is_teleport() || DM.is_started())
{
sendMessage("You will be revived and teleported to spot in 20 seconds!");
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
final Location players_loc = DM.get_playersSpawnLocation();
teleToLocation(players_loc._x, players_loc._y, players_loc._z, false);
@@ -7485,7 +7485,7 @@ public final class L2PcInstance extends L2Playable
else
{
sendMessage("You will be revived and teleported to team spot in 20 seconds!");
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
doRevive();
if (_isVIP)
@@ -12759,7 +12759,7 @@ public final class L2PcInstance extends L2Playable
{
_inventoryDisable = true;
- ThreadPoolManager.schedule(new InventoryEnable(), 1500);
+ ThreadPool.schedule(new InventoryEnable(), 1500);
}
/**
@@ -13093,7 +13093,7 @@ public final class L2PcInstance extends L2Playable
*/
public void rechargeAutoSoulShot(boolean physical, boolean magic, boolean summon, int atkTime)
{
- ThreadPoolManager.schedule(() -> rechargeAutoSoulShot(physical, magic, summon), atkTime);
+ ThreadPool.schedule(() -> rechargeAutoSoulShot(physical, magic, summon), atkTime);
}
/**
@@ -14868,7 +14868,7 @@ public final class L2PcInstance extends L2Playable
{
if (_taskWarnUserTakeBreak == null)
{
- _taskWarnUserTakeBreak = ThreadPoolManager.scheduleAtFixedRate(new WarnUserTakeBreak(), 7200000, 7200000);
+ _taskWarnUserTakeBreak = ThreadPool.scheduleAtFixedRate(new WarnUserTakeBreak(), 7200000, 7200000);
}
}
@@ -14904,7 +14904,7 @@ public final class L2PcInstance extends L2Playable
{
if (_taskRentPet == null)
{
- _taskRentPet = ThreadPoolManager.scheduleAtFixedRate(new RentPetTask(), seconds * 1000L, seconds * 1000L);
+ _taskRentPet = ThreadPool.scheduleAtFixedRate(new RentPetTask(), seconds * 1000L, seconds * 1000L);
}
}
@@ -14948,7 +14948,7 @@ public final class L2PcInstance extends L2Playable
final int timeinwater = 86000;
sendPacket(new SetupGauge(2, timeinwater));
- _taskWater = ThreadPoolManager.scheduleAtFixedRate(new WaterTask(), timeinwater, 1000);
+ _taskWater = ThreadPool.scheduleAtFixedRate(new WaterTask(), timeinwater, 1000);
}
}
@@ -16415,7 +16415,7 @@ public final class L2PcInstance extends L2Playable
_shortBuffTask.cancel(false);
_shortBuffTask = null;
}
- _shortBuffTask = ThreadPoolManager.schedule(new ShortBuffTask(this), 15000);
+ _shortBuffTask = ThreadPool.schedule(new ShortBuffTask(this), 15000);
sendPacket(new ShortBuffStatusUpdate(magicId, level, time));
}
@@ -16617,7 +16617,7 @@ public final class L2PcInstance extends L2Playable
checkDelay = Math.round((float) (_fish.getGutsCheckTime() * 0.66));
}
}
- _taskforfish = ThreadPoolManager.scheduleAtFixedRate(new LookingForFishTask(_fish.getWaitTime(), _fish.getFishGuts(), _fish.getType(), isNoob, isUpperGrade), 10000, checkDelay);
+ _taskforfish = ThreadPool.scheduleAtFixedRate(new LookingForFishTask(_fish.getWaitTime(), _fish.getFishGuts(), _fish.getType(), isNoob, isUpperGrade), 10000, checkDelay);
}
}
@@ -18781,7 +18781,7 @@ public final class L2PcInstance extends L2Playable
// start the countdown
final int minutes = (int) (delayInMilliseconds / 60000);
- _punishTask = ThreadPoolManager.schedule(new PunishTask(this), _punishTimer);
+ _punishTask = ThreadPool.schedule(new PunishTask(this), _punishTimer);
sendMessage("You are chat banned for " + minutes + " minutes.");
}
else
@@ -18803,7 +18803,7 @@ public final class L2PcInstance extends L2Playable
_punishTimer = delayInMilliseconds; // Delay in milliseconds
// start the countdown
- _punishTask = ThreadPoolManager.schedule(new PunishTask(this), _punishTimer);
+ _punishTask = ThreadPool.schedule(new PunishTask(this), _punishTimer);
sendMessage("You are in jail for " + (delayInMilliseconds / 60000) + " minutes.");
}
@@ -18897,7 +18897,7 @@ public final class L2PcInstance extends L2Playable
// If punish timer exists, restart punishtask.
if (_punishTimer > 0)
{
- _punishTask = ThreadPoolManager.schedule(new PunishTask(this), _punishTimer);
+ _punishTask = ThreadPool.schedule(new PunishTask(this), _punishTimer);
sendMessage("You are still " + getPunishLevel().string() + " for " + (_punishTimer / 60000) + " minutes.");
}
if (getPunishLevel() == PunishLevel.JAIL)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
index 053d9958e9..1a2db58fef 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
@@ -23,7 +23,7 @@ import java.util.concurrent.Future;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.sql.L2PetDataTable;
@@ -1121,7 +1121,7 @@ public class L2PetInstance extends L2Summon
_feedTime = 1;
}
- _feedTask = ThreadPoolManager.scheduleAtFixedRate(new FeedTask(), 60000 / _feedTime, 60000 / _feedTime);
+ _feedTask = ThreadPool.scheduleAtFixedRate(new FeedTask(), 60000 / _feedTime, 60000 / _feedTime);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2ProtectorInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2ProtectorInstance.java
index b342a2a315..079e84a526 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2ProtectorInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2ProtectorInstance.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.model.L2Skill;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -128,7 +128,7 @@ public class L2ProtectorInstance extends L2NpcInstance
_aiTask.cancel(true);
}
- _aiTask = ThreadPoolManager.scheduleAtFixedRate(new ProtectorAI(this), 3000, 3000);
+ _aiTask = ThreadPool.scheduleAtFixedRate(new ProtectorAI(this), 3000, 3000);
}
@Override
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
index f0bad3dd9b..e5d1a67bd8 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.ArrayList;
import java.util.List;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.model.actor.knownlist.RaceManagerKnownList;
import com.l2jmobius.gameserver.model.entity.MonsterRace;
@@ -96,26 +96,26 @@ public class L2RaceManagerInstance extends L2NpcInstance
// _history = new ArrayList();
_managers = new ArrayList<>();
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_AVAILABLE_FOR_S1_RACE), 0, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_NOW_AVAILABLE_FOR_S1_RACE), 30 * SECOND, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_AVAILABLE_FOR_S1_RACE), MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_NOW_AVAILABLE_FOR_S1_RACE), MINUTE + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_STOP_IN_S1_MINUTES), 2 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_STOP_IN_S1_MINUTES), 3 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_STOP_IN_S1_MINUTES), 4 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_STOP_IN_S1_MINUTES), 5 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_STOP_IN_S1_MINUTES), 6 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKET_SALES_CLOSED), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_MINUTES), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_MINUTES), 8 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_SECONDS), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_SECONDS), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_SECONDS), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_SECONDS), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_SECONDS), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_RACE_START), 9 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_AVAILABLE_FOR_S1_RACE), 0, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_NOW_AVAILABLE_FOR_S1_RACE), 30 * SECOND, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_AVAILABLE_FOR_S1_RACE), MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_NOW_AVAILABLE_FOR_S1_RACE), MINUTE + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_STOP_IN_S1_MINUTES), 2 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_STOP_IN_S1_MINUTES), 3 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_STOP_IN_S1_MINUTES), 4 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_STOP_IN_S1_MINUTES), 5 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKETS_STOP_IN_S1_MINUTES), 6 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_TICKET_SALES_CLOSED), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_MINUTES), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_MINUTES), 8 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_SECONDS), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_SECONDS), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_SECONDS), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_SECONDS), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_BEGINS_IN_S1_SECONDS), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSRACE_RACE_START), 9 * MINUTE, 10 * MINUTE);
}
_managers.add(this);
}
@@ -238,7 +238,7 @@ public class L2RaceManagerInstance extends L2NpcInstance
_packet = new MonRaceInfo(_codes[1][0], _codes[1][1], race.getMonsters(), race.getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunRace(), 5000);
+ ThreadPool.schedule(new RunRace(), 5000);
}
else
{
@@ -513,7 +513,7 @@ public class L2RaceManagerInstance extends L2NpcInstance
{
_packet = new MonRaceInfo(_codes[2][0], _codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunEnd(), 30000);
+ ThreadPool.schedule(new RunEnd(), 30000);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
index 040602be3f..1ed6174c1e 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.actor.instance;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.instancemanager.RaidBossPointsManager;
import com.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
@@ -132,7 +132,7 @@ public final class L2RaidBossInstance extends L2MonsterInstance
protected void manageMinions()
{
_minionList.spawnMinions();
- _minionMaintainTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _minionMaintainTask = ThreadPool.scheduleAtFixedRate(() ->
{
// teleport raid boss home if it's too far from home location
L2Spawn bossSpawn = getSpawn();
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherMonsterInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherMonsterInstance.java
index 2c8e08ce1e..0b94f86921 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherMonsterInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherMonsterInstance.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.concurrent.Future;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
import com.l2jmobius.gameserver.model.L2Skill;
@@ -65,12 +65,12 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_victimSpawnKeyBoxTask.cancel(true);
}
- _victimSpawnKeyBoxTask = ThreadPoolManager.schedule(new VictimSpawnKeyBox(this), 300000);
+ _victimSpawnKeyBoxTask = ThreadPool.schedule(new VictimSpawnKeyBox(this), 300000);
if (_victimShout != null)
{
_victimShout.cancel(true);
}
- _victimShout = ThreadPoolManager.schedule(new VictimShout(this), 5000);
+ _victimShout = ThreadPool.schedule(new VictimShout(this), 5000);
break;
}
case 18196:
@@ -110,7 +110,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_changeImmortalTask.cancel(true);
}
- _changeImmortalTask = ThreadPoolManager.schedule(new ChangeImmortal(this), 1600);
+ _changeImmortalTask = ThreadPool.schedule(new ChangeImmortal(this), 1600);
break;
}
case 18256:
@@ -166,7 +166,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_onDeadEventTask.cancel(true);
}
- _onDeadEventTask = ThreadPoolManager.schedule(new OnDeadEvent(this), 3500);
+ _onDeadEventTask = ThreadPool.schedule(new OnDeadEvent(this), 3500);
break;
}
case 18150:
@@ -192,7 +192,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_onDeadEventTask.cancel(true);
}
- _onDeadEventTask = ThreadPoolManager.schedule(new OnDeadEvent(this), 3500);
+ _onDeadEventTask = ThreadPool.schedule(new OnDeadEvent(this), 3500);
break;
}
case 18141:
@@ -210,7 +210,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_onDeadEventTask.cancel(true);
}
- _onDeadEventTask = ThreadPoolManager.schedule(new OnDeadEvent(this), 3500);
+ _onDeadEventTask = ThreadPool.schedule(new OnDeadEvent(this), 3500);
}
break;
}
@@ -242,7 +242,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_onDeadEventTask.cancel(true);
}
- _onDeadEventTask = ThreadPoolManager.schedule(new OnDeadEvent(this), 3500);
+ _onDeadEventTask = ThreadPool.schedule(new OnDeadEvent(this), 3500);
}
break;
}
@@ -256,7 +256,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_onDeadEventTask.cancel(true);
}
- _onDeadEventTask = ThreadPoolManager.schedule(new OnDeadEvent(this), 8500);
+ _onDeadEventTask = ThreadPool.schedule(new OnDeadEvent(this), 8500);
break;
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherNpcInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
index a252ae1c38..e445d441e9 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
@@ -22,7 +22,7 @@ import java.util.Map;
import java.util.concurrent.Future;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.csv.DoorTable;
@@ -230,7 +230,7 @@ public class L2SepulcherNpcInstance extends L2NpcInstance
{
_spawnMonsterTask.cancel(true);
}
- _spawnMonsterTask = ThreadPoolManager.schedule(new SpawnMonster(getNpcId()), 3500);
+ _spawnMonsterTask = ThreadPool.schedule(new SpawnMonster(getNpcId()), 3500);
break;
}
case 31455:
@@ -383,12 +383,12 @@ public class L2SepulcherNpcInstance extends L2NpcInstance
{
_closeTask.cancel(true);
}
- _closeTask = ThreadPoolManager.schedule(new CloseNextDoor(doorId), 10000);
+ _closeTask = ThreadPool.schedule(new CloseNextDoor(doorId), 10000);
if (_spawnNextMysteriousBoxTask != null)
{
_spawnNextMysteriousBoxTask.cancel(true);
}
- _spawnNextMysteriousBoxTask = ThreadPoolManager.schedule(new SpawnNextMysteriousBox(npcId), 0);
+ _spawnNextMysteriousBoxTask = ThreadPool.schedule(new SpawnNextMysteriousBox(npcId), 0);
}
private class CloseNextDoor implements Runnable
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SummonInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SummonInstance.java
index 95e7efd7ef..8fa2c1c9f5 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SummonInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2SummonInstance.java
@@ -20,7 +20,7 @@ import java.util.concurrent.Future;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Skill;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -102,7 +102,7 @@ public class L2SummonInstance extends L2Summon
LOGGER.warning("L2SummonInstance: Task Delay " + (delay / 1000) + " seconds.");
}
- _summonLifeTask = ThreadPoolManager.scheduleAtFixedRate(new SummonLifetime(getOwner(), this), delay, delay);
+ _summonLifeTask = ThreadPool.scheduleAtFixedRate(new SummonLifetime(getOwner(), this), delay, delay);
}
@Override
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
index 61c3ca8038..05a0064ce2 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
@@ -20,7 +20,7 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.concurrent.Future;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Point3D;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
@@ -199,7 +199,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);
}
}
@@ -292,7 +292,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
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2TownPetInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2TownPetInstance.java
index da8a79acb1..bfe2990fd4 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2TownPetInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2TownPetInstance.java
@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.model.actor.instance;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.model.actor.position.Location;
@@ -37,7 +37,7 @@ public class L2TownPetInstance extends L2NpcInstance
{
super(objectId, template);
- ThreadPoolManager.scheduleAtFixedRate(new RandomWalkTask(), 2000, 2000);
+ ThreadPool.scheduleAtFixedRate(new RandomWalkTask(), 2000, 2000);
}
@Override
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2XmassTreeInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2XmassTreeInstance.java
index 7664413b31..2b6e3fa2c8 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2XmassTreeInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2XmassTreeInstance.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.concurrent.ScheduledFuture;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.model.L2Object;
@@ -74,7 +74,7 @@ public class L2XmassTreeInstance extends L2NpcInstance
public L2XmassTreeInstance(int objectId, L2NpcTemplate template)
{
super(objectId, template);
- _aiTask = ThreadPoolManager.scheduleAtFixedRate(new XmassAI(this), 3000, 3000);
+ _aiTask = ThreadPool.scheduleAtFixedRate(new XmassAI(this), 3000, 3000);
}
@Override
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
index b1e6cef795..ce57f76414 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
@@ -22,7 +22,7 @@ import java.util.concurrent.Future;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.instancemanager.DuelManager;
@@ -358,7 +358,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);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/Auction.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/Auction.java
index 6a66274aff..177b960f40 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/Auction.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/Auction.java
@@ -24,7 +24,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.sql.ClanTable;
import com.l2jmobius.gameserver.idfactory.IdFactory;
@@ -355,7 +355,7 @@ public class Auction
taskDelay = _endDate - currentTime;
}
- ThreadPoolManager.schedule(new AutoEndTask(), taskDelay);
+ ThreadPool.schedule(new AutoEndTask(), taskDelay);
}
/**
@@ -613,7 +613,7 @@ public class Auction
else
{
/** Task waiting ClanHallManager is loaded every 3s */
- ThreadPoolManager.schedule(new AutoEndTask(), 3000);
+ ThreadPool.schedule(new AutoEndTask(), 3000);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/ClanHall.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
index d0dce85150..579971c3e9 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
@@ -26,7 +26,7 @@ import java.util.Map;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.csv.DoorTable;
import com.l2jmobius.gameserver.datatables.sql.ClanTable;
@@ -252,11 +252,11 @@ public class ClanHall
if (_endDate > currentTime)
{
- ThreadPoolManager.schedule(new FunctionTask(), _endDate - currentTime);
+ ThreadPool.schedule(new FunctionTask(), _endDate - currentTime);
}
else
{
- ThreadPoolManager.schedule(new FunctionTask(), 0);
+ ThreadPool.schedule(new FunctionTask(), 0);
}
}
@@ -313,7 +313,7 @@ public class ClanHall
LOGGER.warning("deducted " + fee + " adena from " + getName() + " owner's cwh for function id : " + getType());
}
- ThreadPoolManager.schedule(new FunctionTask(), getRate());
+ ThreadPool.schedule(new FunctionTask(), getRate());
}
else
{
@@ -862,22 +862,22 @@ public class ClanHall
if (_paidUntil > currentTime)
{
- ThreadPoolManager.schedule(new FeeTask(), _paidUntil - currentTime);
+ ThreadPool.schedule(new FeeTask(), _paidUntil - currentTime);
}
else if (!_paid && !forced)
{
if ((System.currentTimeMillis() + (1000 * 60 * 60 * 24)) <= (_paidUntil + _chRate))
{
- ThreadPoolManager.schedule(new FeeTask(), System.currentTimeMillis() + (1000 * 60 * 60 * 24));
+ ThreadPool.schedule(new FeeTask(), System.currentTimeMillis() + (1000 * 60 * 60 * 24));
}
else
{
- ThreadPoolManager.schedule(new FeeTask(), (_paidUntil + _chRate) - System.currentTimeMillis());
+ ThreadPool.schedule(new FeeTask(), (_paidUntil + _chRate) - System.currentTimeMillis());
}
}
else
{
- ThreadPoolManager.schedule(new FeeTask(), 0);
+ ThreadPool.schedule(new FeeTask(), 0);
}
}
@@ -919,7 +919,7 @@ public class ClanHall
LOGGER.warning("deducted " + getLease() + " adena from " + getName() + " owner's cwh for ClanHall _paidUntil" + _paidUntil);
}
- ThreadPoolManager.schedule(new FeeTask(), _paidUntil - System.currentTimeMillis());
+ ThreadPool.schedule(new FeeTask(), _paidUntil - System.currentTimeMillis());
_paid = true;
updateDb();
}
@@ -936,7 +936,7 @@ public class ClanHall
}
else
{
- ThreadPoolManager.schedule(new FeeTask(), 3000);
+ ThreadPool.schedule(new FeeTask(), 3000);
}
}
else
@@ -948,11 +948,11 @@ public class ClanHall
if ((System.currentTimeMillis() + (1000 * 60 * 60 * 24)) <= (_paidUntil + _chRate))
{
- ThreadPoolManager.schedule(new FeeTask(), System.currentTimeMillis() + (1000 * 60 * 60 * 24));
+ ThreadPool.schedule(new FeeTask(), System.currentTimeMillis() + (1000 * 60 * 60 * 24));
}
else
{
- ThreadPoolManager.schedule(new FeeTask(), (_paidUntil + _chRate) - System.currentTimeMillis());
+ ThreadPool.schedule(new FeeTask(), (_paidUntil + _chRate) - System.currentTimeMillis());
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/Duel.java
index 87f657e00d..a75336223d 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/Duel.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/Duel.java
@@ -24,7 +24,7 @@ import java.util.Map;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.instancemanager.DuelManager;
import com.l2jmobius.gameserver.instancemanager.OlympiadStadiaManager;
@@ -163,7 +163,7 @@ public class Duel
broadcastToTeam2(sm);
}
// Schedule duel start
- ThreadPoolManager.schedule(new ScheduleStartDuelTask(this), 3000);
+ ThreadPool.schedule(new ScheduleStartDuelTask(this), 3000);
}
// ===============================================================
@@ -341,11 +341,11 @@ public class Duel
{
setFinished(true);
playKneelAnimation();
- ThreadPoolManager.schedule(new ScheduleEndDuelTask(_duel, status), 5000);
+ ThreadPool.schedule(new ScheduleEndDuelTask(_duel, status), 5000);
}
else
{
- ThreadPoolManager.schedule(this, 1000);
+ ThreadPool.schedule(this, 1000);
}
}
catch (Throwable t)
@@ -408,11 +408,11 @@ public class Duel
}
// 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
{
@@ -624,7 +624,7 @@ public class Duel
ps = null;
// start duelling task
- ThreadPoolManager.schedule(new ScheduleDuelTask(this), 1000);
+ ThreadPool.schedule(new ScheduleDuelTask(this), 1000);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/CTF.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/CTF.java
index e7d7fb7ebe..857f0078ea 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/CTF.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/CTF.java
@@ -24,7 +24,7 @@ import java.util.Vector;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.SkillTable;
@@ -848,7 +848,7 @@ public class CTF implements EventTask
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!");
setUserData();
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
sit();
afterTeleportOperations();
@@ -1138,7 +1138,7 @@ public class CTF implements EventTask
sit();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!");
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
synchronized (_players)
{
@@ -1244,7 +1244,7 @@ public class CTF implements EventTask
*/
public static void autoEvent()
{
- ThreadPoolManager.execute(new AutoEventTask());
+ ThreadPool.execute(new AutoEventTask());
}
// start without restart
@@ -3343,7 +3343,7 @@ public class CTF implements EventTask
player.sendPacket(new RadarControl(0, 1, hasFlag.getX(), hasFlag.getY(), hasFlag.getZ()));
final L2Radar rdr = new L2Radar(player);
final L2Radar.RadarOnPlayer radar = rdr.new RadarOnPlayer(hasFlag, player);
- ThreadPoolManager.schedule(radar, 10000 + Rnd.get(30000));
+ ThreadPool.schedule(radar, 10000 + Rnd.get(30000));
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/DM.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/DM.java
index ec0e9d1226..0bf8d056bf 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/DM.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/DM.java
@@ -25,7 +25,7 @@ import java.util.Vector;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.SkillTable;
@@ -797,7 +797,7 @@ public class DM implements EventTask
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!");
setUserData();
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
sit();
afterTeleportOperations();
@@ -1063,7 +1063,7 @@ public class DM implements EventTask
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!");
removeUserData();
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// final Vector players = getPlayers();
synchronized (_players)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/Lottery.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/Lottery.java
index 440f7567ee..bcfc273460 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/Lottery.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/Lottery.java
@@ -24,7 +24,7 @@ import java.util.Calendar;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.model.actor.instance.L2ItemInstance;
@@ -163,12 +163,12 @@ public class Lottery
if (_enddate > System.currentTimeMillis())
{
_isStarted = true;
- ThreadPoolManager.schedule(new finishLottery(), _enddate - System.currentTimeMillis());
+ ThreadPool.schedule(new finishLottery(), _enddate - System.currentTimeMillis());
if (_enddate > (System.currentTimeMillis() + (12 * MINUTE)))
{
_isSellingTickets = true;
- ThreadPoolManager.schedule(new stopSellingTickets(), _enddate - System.currentTimeMillis() - (10 * MINUTE));
+ ThreadPool.schedule(new stopSellingTickets(), _enddate - System.currentTimeMillis() - (10 * MINUTE));
}
rset.close();
statement.close();
@@ -212,8 +212,8 @@ public class Lottery
_enddate = finishtime.getTimeInMillis();
}
- ThreadPoolManager.schedule(new stopSellingTickets(), _enddate - System.currentTimeMillis() - (10 * MINUTE));
- ThreadPoolManager.schedule(new finishLottery(), _enddate - System.currentTimeMillis());
+ ThreadPool.schedule(new stopSellingTickets(), _enddate - System.currentTimeMillis() - (10 * MINUTE));
+ ThreadPool.schedule(new finishLottery(), _enddate - System.currentTimeMillis());
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
@@ -460,7 +460,7 @@ public class Lottery
LOGGER.warning("Lottery: Could not store finished lottery data: " + e);
}
- ThreadPoolManager.schedule(new startLottery(), MINUTE);
+ ThreadPool.schedule(new startLottery(), MINUTE);
_number++;
_isStarted = false;
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/TvT.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/TvT.java
index be2399946a..82941476cc 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/TvT.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/TvT.java
@@ -24,7 +24,7 @@ import java.util.Vector;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.SkillTable;
@@ -799,7 +799,7 @@ public class TvT implements EventTask
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!");
setUserData();
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
sit();
@@ -1071,7 +1071,7 @@ public class TvT implements EventTask
sit();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!");
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
synchronized (_players)
{
@@ -1177,7 +1177,7 @@ public class TvT implements EventTask
*/
public static void autoEvent()
{
- ThreadPoolManager.execute(new AutoEventTask());
+ ThreadPool.execute(new AutoEventTask());
}
// start without restart
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/VIP.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/VIP.java
index 7d029b9ef0..2bb7e91f32 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/VIP.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/VIP.java
@@ -24,7 +24,7 @@ import java.util.Random;
import java.util.Vector;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
import com.l2jmobius.gameserver.datatables.sql.SpawnTable;
@@ -335,7 +335,7 @@ public class VIP
Announcements.getInstance().gameAnnounceToAll("Vip event has started.Use .vipjoin to join or .vipleave to leave.");
spawnJoinNPC();
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
_joining = false;
_started = true;
@@ -348,7 +348,7 @@ public class VIP
Announcements.getInstance().gameAnnounceToAll("Registration for the VIP event involving " + _teamName + " has ended.");
Announcements.getInstance().gameAnnounceToAll("Players will be teleported to their locations in 20 seconds.");
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
teleportPlayers();
chooseVIP();
@@ -357,13 +357,13 @@ public class VIP
Announcements.getInstance().gameAnnounceToAll("VIP event will start in 20 seconds.");
spawnEndNPC();
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
Announcements.getInstance().gameAnnounceToAll("VIP event has started. " + _teamName + "'s VIP must get to the starter city and talk with " + getNPCName(_endNPC, null) + ". The opposing team must kill the VIP. All players except the VIP will respawn at their current locations.");
Announcements.getInstance().gameAnnounceToAll("VIP event will end if the " + _teamName + " team makes it to their town or when " + (_time / 1000 / 60) + " mins have elapsed.");
VIP.sit();
- ThreadPoolManager.schedule(() -> endEventTime(), _time);
+ ThreadPool.schedule(() -> endEventTime(), _time);
}, 20000);
}, 20000);
}
@@ -617,7 +617,7 @@ public class VIP
{
Announcements.getInstance().gameAnnounceToAll("Teleporting VIP players back to the Registration area in 20 seconds.");
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
for (L2PcInstance player1 : _playersVIP)
{
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/manager/EventsGlobalTask.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/manager/EventsGlobalTask.java
index da6839c472..49cf6c3c37 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/manager/EventsGlobalTask.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/event/manager/EventsGlobalTask.java
@@ -23,7 +23,7 @@ import java.util.Iterator;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
/**
* @author Shyla
@@ -41,7 +41,7 @@ public class EventsGlobalTask implements Runnable
private EventsGlobalTask()
{
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
}
public static EventsGlobalTask getInstance()
@@ -238,7 +238,7 @@ public class EventsGlobalTask implements Runnable
{
for (EventTask actualEvent : registeredEventsAtCurrentTime)
{
- ThreadPoolManager.schedule(actualEvent, 5000);
+ ThreadPool.schedule(actualEvent, 5000);
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/olympiad/Olympiad.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/olympiad/Olympiad.java
index f0365deb56..d345b287ed 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/olympiad/Olympiad.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/olympiad/Olympiad.java
@@ -41,7 +41,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.instancemanager.OlympiadStadiaManager;
import com.l2jmobius.gameserver.model.L2World;
@@ -241,7 +241,7 @@ public class Olympiad
{
if (_validationEnd > Calendar.getInstance().getTimeInMillis())
{
- _scheduledValdationTask = ThreadPoolManager.schedule(new ValidationEndTask(), getMillisToValidationEnd());
+ _scheduledValdationTask = ThreadPool.schedule(new ValidationEndTask(), getMillisToValidationEnd());
}
else
{
@@ -402,7 +402,7 @@ public class Olympiad
_scheduledOlympiadEnd.cancel(true);
}
- _scheduledOlympiadEnd = ThreadPoolManager.schedule(new OlympiadEndTask(), getMillisToOlympiadEnd());
+ _scheduledOlympiadEnd = ThreadPool.schedule(new OlympiadEndTask(), getMillisToOlympiadEnd());
updateCompStatus();
}
@@ -436,7 +436,7 @@ public class Olympiad
final Calendar validationEnd = Calendar.getInstance();
_validationEnd = validationEnd.getTimeInMillis() + VALIDATION_PERIOD;
- _scheduledValdationTask = ThreadPoolManager.schedule(new ValidationEndTask(), getMillisToValidationEnd());
+ _scheduledValdationTask = ThreadPool.schedule(new ValidationEndTask(), getMillisToValidationEnd());
}
}
@@ -806,7 +806,7 @@ public class Olympiad
LOGGER.info("Olympiad System: Event starts/started : " + _compStart.getTime());
}
- _scheduledCompStart = ThreadPoolManager.schedule(() ->
+ _scheduledCompStart = ThreadPool.schedule(() ->
{
if (isOlympiadEnd())
{
@@ -825,10 +825,10 @@ public class Olympiad
final long regEnd = getMillisToCompEnd() - 600000;
if (regEnd > 0)
{
- ThreadPoolManager.schedule(() -> Announcements.getInstance().announceToAll(new SystemMessage(SystemMessageId.OLYMPIAD_REGISTRATION_PERIOD_ENDED)), regEnd);
+ ThreadPool.schedule(() -> Announcements.getInstance().announceToAll(new SystemMessage(SystemMessageId.OLYMPIAD_REGISTRATION_PERIOD_ENDED)), regEnd);
}
- _scheduledCompEnd = ThreadPoolManager.schedule(() ->
+ _scheduledCompEnd = ThreadPool.schedule(() ->
{
if (isOlympiadEnd())
{
@@ -870,7 +870,7 @@ public class Olympiad
_scheduledOlympiadEnd.cancel(true);
}
- _scheduledOlympiadEnd = ThreadPoolManager.schedule(new OlympiadEndTask(), 0);
+ _scheduledOlympiadEnd = ThreadPool.schedule(new OlympiadEndTask(), 0);
}
protected long getMillisToValidationEnd()
@@ -1001,7 +1001,7 @@ public class Olympiad
return;
}
- _scheduledWeeklyTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _scheduledWeeklyTask = ThreadPool.scheduleAtFixedRate(() ->
{
addWeeklyPoints();
LOGGER.info("Olympiad System: Added weekly points to nobles");
@@ -1771,7 +1771,7 @@ public class Olympiad
break;
}
- _scheduledWeeklyTask = ThreadPoolManager.scheduleAtFixedRate(new OlympiadPointsRestoreTask(final_change_period), getMillisToWeekChange(), final_change_period);
+ _scheduledWeeklyTask = ThreadPool.scheduleAtFixedRate(new OlympiadPointsRestoreTask(final_change_period), getMillisToWeekChange(), final_change_period);
}
class OlympiadPointsRestoreTask implements Runnable
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSigns.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSigns.java
index 3ac67d51a5..8cc0e4a720 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSigns.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSigns.java
@@ -26,7 +26,7 @@ import java.util.Map;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.csv.MapRegionTable;
import com.l2jmobius.gameserver.handler.AutoChatHandler;
@@ -306,7 +306,7 @@ public class SevenSigns
final long milliToChange = getMilliToPeriodChange();
SevenSignsPeriodChange sspc = new SevenSignsPeriodChange();
- ThreadPoolManager.schedule(sspc, milliToChange);
+ ThreadPool.schedule(sspc, milliToChange);
// Thanks to http://rainbow.arch.scriptmania.com/scripts/timezone_countdown.html for help with this.
final double numSecs = (milliToChange / 1000) % 60;
@@ -1849,7 +1849,7 @@ public class SevenSigns
setCalendarForNextPeriodChange();
SevenSignsPeriodChange sspc = new SevenSignsPeriodChange();
- ThreadPoolManager.schedule(sspc, getMilliToPeriodChange());
+ ThreadPool.schedule(sspc, getMilliToPeriodChange());
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java
index b1f957dd36..28889f66e2 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java
@@ -28,7 +28,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
@@ -3248,7 +3248,7 @@ public class SevenSignsFestival implements SpawnListener
_festivalData = new HashMap<>();
restoreFestivalData();
- ThreadPoolManager.scheduleAtFixedRate(new RestoreStatus(), 7200000, 10800000);
+ ThreadPool.scheduleAtFixedRate(new RestoreStatus(), 7200000, 10800000);
if (SevenSigns.getInstance().isSealValidationPeriod())
{
@@ -3400,7 +3400,7 @@ public class SevenSignsFestival implements SpawnListener
// at the specified time, then invoke it automatically after every cycle.
FestivalManager fm = new FestivalManager();
setNextFestivalStart(Config.ALT_FESTIVAL_MANAGER_START + FESTIVAL_SIGNUP_TIME);
- _managerScheduledTask = ThreadPoolManager.scheduleAtFixedRate(fm, Config.ALT_FESTIVAL_MANAGER_START, Config.ALT_FESTIVAL_CYCLE_LENGTH);
+ _managerScheduledTask = ThreadPool.scheduleAtFixedRate(fm, Config.ALT_FESTIVAL_MANAGER_START, Config.ALT_FESTIVAL_CYCLE_LENGTH);
LOGGER.info("SevenSignsFestival: The first Festival of Darkness cycle begins in " + (Config.ALT_FESTIVAL_MANAGER_START / 60000) + " minute(s).");
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Castle.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Castle.java
index 782efecd9e..807f071209 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Castle.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Castle.java
@@ -27,7 +27,7 @@ import java.util.Map;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.csv.DoorTable;
import com.l2jmobius.gameserver.datatables.sql.ClanTable;
@@ -567,7 +567,7 @@ public class Castle
if (getOwnerId() > 0)
{
L2Clan clan = ClanTable.getInstance().getClan(getOwnerId()); // Try to find clan instance
- ThreadPoolManager.schedule(new CastleUpdater(clan, 1), 3600000); // Schedule owner tasks to start running
+ ThreadPool.schedule(new CastleUpdater(clan, 1), 3600000); // Schedule owner tasks to start running
}
rs.close();
@@ -704,7 +704,7 @@ public class Castle
// give crowns
CrownManager.getInstance().checkCrowns(clan);
- ThreadPoolManager.schedule(new CastleUpdater(clan, 1), 3600000); // Schedule owner tasks to start running
+ ThreadPool.schedule(new CastleUpdater(clan, 1), 3600000); // Schedule owner tasks to start running
}
}
catch (Exception e)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Fort.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Fort.java
index cc4a81af53..d7fe3d68d2 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Fort.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Fort.java
@@ -24,7 +24,7 @@ import java.util.Calendar;
import java.util.List;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.csv.DoorTable;
import com.l2jmobius.gameserver.datatables.sql.ClanTable;
@@ -75,7 +75,7 @@ public class Fort
public void EndOfSiege(L2Clan clan)
{
- ThreadPoolManager.schedule(new endFortressSiege(this, clan), 1000);
+ ThreadPool.schedule(new endFortressSiege(this, clan), 1000);
}
public void Engrave(L2Clan clan, int objId)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/FortSiege.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/FortSiege.java
index 1b49b694a8..34044442cc 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/FortSiege.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/FortSiege.java
@@ -24,7 +24,7 @@ import java.util.Calendar;
import java.util.List;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.crypt.nProtect;
import com.l2jmobius.commons.crypt.nProtect.RestrictionType;
import com.l2jmobius.commons.database.DatabaseFactory;
@@ -120,33 +120,33 @@ public class FortSiege
if (timeRemaining > 3600000)
{
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_fortInst), timeRemaining - 3600000); // Prepare task for 1 hr left.
+ ThreadPool.schedule(new ScheduleEndSiegeTask(_fortInst), timeRemaining - 3600000); // Prepare task for 1 hr left.
}
else if ((timeRemaining <= 3600000) && (timeRemaining > 600000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getFort().getName() + " siege conclusion.", true);
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_fortInst), timeRemaining - 600000); // Prepare task for 10 minute left.
+ ThreadPool.schedule(new ScheduleEndSiegeTask(_fortInst), timeRemaining - 600000); // Prepare task for 10 minute left.
}
else if ((timeRemaining <= 600000) && (timeRemaining > 300000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getFort().getName() + " siege conclusion.", true);
// Prepare task for 5 minute left.
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_fortInst), timeRemaining - 300000);
+ ThreadPool.schedule(new ScheduleEndSiegeTask(_fortInst), timeRemaining - 300000);
}
else if ((timeRemaining <= 300000) && (timeRemaining > 10000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getFort().getName() + " siege conclusion.", true);
// Prepare task for 10 seconds count down
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_fortInst), timeRemaining - 10000);
+ ThreadPool.schedule(new ScheduleEndSiegeTask(_fortInst), timeRemaining - 10000);
}
else if ((timeRemaining <= 10000) && (timeRemaining > 0))
{
announceToPlayer(getFort().getName() + " siege " + (timeRemaining / 1000) + " second(s) left!", true);
// Prepare task for second count down
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_fortInst), timeRemaining);
+ ThreadPool.schedule(new ScheduleEndSiegeTask(_fortInst), timeRemaining);
}
else
{
@@ -190,19 +190,19 @@ public class FortSiege
if (timeRemaining > 86400000)
{
// Prepare task for 24 before siege start to end registration
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining - 86400000);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining - 86400000);
}
else if ((timeRemaining <= 86400000) && (timeRemaining > 13600000))
{
// Prepare task for 1 hr left before siege start.
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining - 13600000);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining - 13600000);
}
else if ((timeRemaining <= 13600000) && (timeRemaining > 600000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getFort().getName() + " siege begin.", false);
// Prepare task for 10 minute left.
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining - 600000);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining - 600000);
}
else if ((timeRemaining <= 600000) && (timeRemaining > 300000))
{
@@ -213,21 +213,21 @@ public class FortSiege
clearSiegeWaitingClan();
// Prepare task for 5 minute left.
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining - 300000);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining - 300000);
}
else if ((timeRemaining <= 300000) && (timeRemaining > 10000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getFort().getName() + " siege begin.", false);
// Prepare task for 10 seconds count down
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining - 10000);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining - 10000);
}
else if ((timeRemaining <= 10000) && (timeRemaining > 0))
{
announceToPlayer(getFort().getName() + " siege " + (timeRemaining / 1000) + " second(s) to start!", false);
// Prepare task for second count down
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_fortInst), timeRemaining);
}
else
{
@@ -506,7 +506,7 @@ public class FortSiege
FortSiege.class,
this
});
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(getFort()), 1000); // Prepare auto end task
+ ThreadPool.schedule(new ScheduleEndSiegeTask(getFort()), 1000); // Prepare auto end task
announceToPlayer("The siege of " + getFort().getName() + " has started!", false);
saveFortSiege();
@@ -1089,7 +1089,7 @@ public class FortSiege
_siegeRegistrationEndDate.add(Calendar.MINUTE, -10);
// Schedule siege auto start
- ThreadPoolManager.schedule(new FortSiege.ScheduleStartSiegeTask(getFort()), 1000);
+ ThreadPool.schedule(new FortSiege.ScheduleStartSiegeTask(getFort()), 1000);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Siege.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Siege.java
index 99de079b62..953aaeace3 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Siege.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/Siege.java
@@ -26,7 +26,7 @@ import java.util.Date;
import java.util.List;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.crypt.nProtect;
import com.l2jmobius.commons.crypt.nProtect.RestrictionType;
import com.l2jmobius.commons.database.DatabaseFactory;
@@ -176,35 +176,35 @@ public class Siege
if (timeRemaining > 3600000)
{
// Prepare task for 1 hr left.
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 3600000);
+ ThreadPool.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 3600000);
}
else if ((timeRemaining <= 3600000) && (timeRemaining > 600000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getCastle().getName() + " siege conclusion.", true);
// Prepare task for 10 minute left.
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 600000);
+ ThreadPool.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 600000);
}
else if ((timeRemaining <= 600000) && (timeRemaining > 300000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getCastle().getName() + " siege conclusion.", true);
// Prepare task for 5 minute left.
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 300000);
+ ThreadPool.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 300000);
}
else if ((timeRemaining <= 300000) && (timeRemaining > 10000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getCastle().getName() + " siege conclusion.", true);
// Prepare task for 10 seconds count down
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 10000);
+ ThreadPool.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining - 10000);
}
else if ((timeRemaining <= 10000) && (timeRemaining > 0))
{
announceToPlayer(getCastle().getName() + " siege " + (timeRemaining / 1000) + " second(s) left!", true);
// Prepare task for second count down
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining);
+ ThreadPool.schedule(new ScheduleEndSiegeTask(_castleInst), timeRemaining);
}
else
{
@@ -253,7 +253,7 @@ public class Siege
if (timeRemaining > 86400000)
{
// Prepare task for 24 before siege start to end registration
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 86400000);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 86400000);
}
else if ((timeRemaining <= 86400000) && (timeRemaining > 13600000))
{
@@ -262,35 +262,35 @@ public class Siege
clearSiegeWaitingClan();
// Prepare task for 1 hr left before siege start.
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 13600000);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 13600000);
}
else if ((timeRemaining <= 13600000) && (timeRemaining > 600000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getCastle().getName() + " siege begin.", false);
// Prepare task for 10 minute left.
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 600000);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 600000);
}
else if ((timeRemaining <= 600000) && (timeRemaining > 300000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getCastle().getName() + " siege begin.", false);
// Prepare task for 5 minute left.
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 300000);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 300000);
}
else if ((timeRemaining <= 300000) && (timeRemaining > 10000))
{
announceToPlayer((timeRemaining / 60000) + " minute(s) until " + getCastle().getName() + " siege begin.", false);
// Prepare task for 10 seconds count down
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 10000);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining - 10000);
}
else if ((timeRemaining <= 10000) && (timeRemaining > 0))
{
announceToPlayer(getCastle().getName() + " siege " + (timeRemaining / 1000) + " second(s) to start!", false);
// Prepare task for second count down
- ThreadPoolManager.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining);
+ ThreadPool.schedule(new ScheduleStartSiegeTask(_castleInst), timeRemaining);
}
else
{
@@ -673,7 +673,7 @@ public class Siege
this
});
// Prepare auto end task
- ThreadPoolManager.schedule(new ScheduleEndSiegeTask(getCastle()), 1000);
+ ThreadPool.schedule(new ScheduleEndSiegeTask(getCastle()), 1000);
announceToPlayer("The siege of " + getCastle().getName() + " has started!", false);
@@ -1206,7 +1206,7 @@ public class Siege
_siegeRegistrationEndDate.add(Calendar.DAY_OF_MONTH, -1);
// Schedule siege auto start
- ThreadPoolManager.schedule(new Siege.ScheduleStartSiegeTask(getCastle()), 1000);
+ ThreadPool.schedule(new Siege.ScheduleStartSiegeTask(getCastle()), 1000);
}
/**
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/BanditStrongholdSiege.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/BanditStrongholdSiege.java
index 56fa81c335..f5256a32a5 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/BanditStrongholdSiege.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/BanditStrongholdSiege.java
@@ -24,7 +24,7 @@ import java.util.Map;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.csv.DoorTable;
import com.l2jmobius.gameserver.datatables.sql.ClanTable;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
@@ -116,8 +116,8 @@ public class BanditStrongholdSiege extends ClanHallSiege
spawnFlags();
gateControl(1);
anonce("Take place at the siege of his headquarters.", 1);
- ThreadPoolManager.schedule(new startFirstStep(), 5 * 60000);
- _midTimer = ThreadPoolManager.schedule(new midSiegeStep(), 25 * 60000);
+ ThreadPool.schedule(new startFirstStep(), 5 * 60000);
+ _midTimer = ThreadPool.schedule(new midSiegeStep(), 25 * 60000);
_siegeEndDate = Calendar.getInstance();
_siegeEndDate.add(Calendar.MINUTE, 60);
@@ -139,7 +139,7 @@ public class BanditStrongholdSiege extends ClanHallSiege
gateControl(1);
_finalStage = true;
anonce("Take place at the siege of his headquarters.", 1);
- ThreadPoolManager.schedule(new startFirstStep(), 5 * 60000);
+ ThreadPool.schedule(new startFirstStep(), 5 * 60000);
}
public void endSiege(boolean par)
@@ -682,7 +682,7 @@ public class BanditStrongholdSiege extends ClanHallSiege
else
{
_midTimer.cancel(false);
- ThreadPoolManager.schedule(new midSiegeStep(), 5000);
+ ThreadPool.schedule(new midSiegeStep(), 5000);
}
}
else
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/DevastatedCastle.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/DevastatedCastle.java
index 12a3d350cc..a441eb3143 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/DevastatedCastle.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/DevastatedCastle.java
@@ -28,7 +28,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
import com.l2jmobius.gameserver.instancemanager.ClanHallManager;
@@ -137,7 +137,7 @@ public class DevastatedCastle
final long milliToSiege = getMilliToSiege();
RunMessengerSpawn rms = new RunMessengerSpawn();
- ThreadPoolManager.schedule(rms, milliToSiege);
+ ThreadPool.schedule(rms, milliToSiege);
final long total_millis = System.currentTimeMillis() + milliToSiege;
@@ -230,11 +230,11 @@ public class DevastatedCastle
}
RunSiege rs = new RunSiege();
- ThreadPoolManager.schedule(rs, 14400000); // 4 * 60 * 60 * 1000
+ ThreadPool.schedule(rs, 14400000); // 4 * 60 * 60 * 1000
- ThreadPoolManager.schedule(new DeSpawnTimer(result), 7200000); // 2 * 60 * 60 * 1000
- ThreadPoolManager.schedule(new AnnounceInfo("Siege registration of Devastated castle is over!"), 7200000);
- ThreadPoolManager.schedule(new AnnounceInfo("2 hours until siege begin."), 7200000);
+ ThreadPool.schedule(new DeSpawnTimer(result), 7200000); // 2 * 60 * 60 * 1000
+ ThreadPool.schedule(new AnnounceInfo("Siege registration of Devastated castle is over!"), 7200000);
+ ThreadPool.schedule(new AnnounceInfo("2 hours until siege begin."), 7200000);
}
protected class AnnounceInfo implements Runnable
@@ -290,7 +290,7 @@ public class DevastatedCastle
spawn.setZ(-2194);
spawn.stopRespawn();
result = spawn.spawnOne();
- _gustav = ThreadPoolManager.schedule(new DeSpawnTimer(result), 3600000); // 60 * 60 * 1000
+ _gustav = ThreadPool.schedule(new DeSpawnTimer(result), 3600000); // 60 * 60 * 1000
template = NpcTable.getInstance().getTemplate(BOSS1_ID);
spawn = new L2Spawn(template);
@@ -299,7 +299,7 @@ public class DevastatedCastle
spawn.setZ(-2195);
spawn.stopRespawn();
_minion1 = spawn.spawnOne();
- _dietrich = ThreadPoolManager.schedule(new DeSpawnTimer(_minion1), 3600000); // 60 * 60 * 1000
+ _dietrich = ThreadPool.schedule(new DeSpawnTimer(_minion1), 3600000); // 60 * 60 * 1000
template = NpcTable.getInstance().getTemplate(BOSS2_ID);
spawn = new L2Spawn(template);
@@ -308,7 +308,7 @@ public class DevastatedCastle
spawn.setZ(-2194);
spawn.stopRespawn();
_minion2 = spawn.spawnOne();
- _mikhail = ThreadPoolManager.schedule(new DeSpawnTimer(_minion2), 3600000); // 60 * 60 * 1000
+ _mikhail = ThreadPool.schedule(new DeSpawnTimer(_minion2), 3600000); // 60 * 60 * 1000
spawnMonsters();
}
@@ -737,7 +737,7 @@ public class DevastatedCastle
e.printStackTrace();
}
}
- _monsterdespawn = ThreadPoolManager.schedule(new DeSpawnMonsters(), 3600000); // 60 * 60 * 1000
+ _monsterdespawn = ThreadPool.schedule(new DeSpawnMonsters(), 3600000); // 60 * 60 * 1000
}
protected class DeSpawnMonsters implements Runnable
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/FortressOfResistance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/FortressOfResistance.java
index c1762c88a7..f49774a971 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/FortressOfResistance.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/FortressOfResistance.java
@@ -27,7 +27,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
import com.l2jmobius.gameserver.instancemanager.ClanHallManager;
@@ -127,7 +127,7 @@ public class FortressOfResistance
final long milliToCapture = getMilliToCapture();
RunMessengerSpawn rms = new RunMessengerSpawn();
- ThreadPoolManager.schedule(rms, milliToCapture);
+ ThreadPool.schedule(rms, milliToCapture);
final long total_millis = System.currentTimeMillis() + milliToCapture;
@@ -219,9 +219,9 @@ public class FortressOfResistance
e.printStackTrace();
}
final RunBossSpawn rbs = new RunBossSpawn();
- ThreadPoolManager.schedule(rbs, 3600000); // 60 * 60 * 1000
+ ThreadPool.schedule(rbs, 3600000); // 60 * 60 * 1000
LOGGER.info("Fortress of Resistanse: Messenger spawned!");
- ThreadPoolManager.schedule(new DeSpawnTimer(result), 3600000); // 60 * 60 * 1000
+ ThreadPool.schedule(new DeSpawnTimer(result), 3600000); // 60 * 60 * 1000
}
protected class RunBossSpawn implements Runnable
@@ -261,8 +261,8 @@ public class FortressOfResistance
Announce("Capture of Partisan Hideout has begun!");
Announce("You have one hour to kill Nurka!");
- _nurka = ThreadPoolManager.schedule(new DeSpawnTimer(result), 3600000); // 60 * 60 * 1000
- _announce = ThreadPoolManager.schedule(new AnnounceInfo("No one can`t kill Nurka! Partisan Hideout set free until next week!"), 3600000);
+ _nurka = ThreadPool.schedule(new DeSpawnTimer(result), 3600000); // 60 * 60 * 1000
+ _announce = ThreadPool.schedule(new AnnounceInfo("No one can`t kill Nurka! Partisan Hideout set free until next week!"), 3600000);
}
protected class DeSpawnTimer implements Runnable
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/WildBeastFarmSiege.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/WildBeastFarmSiege.java
index e2ec6e1f21..f8f41a21e2 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/WildBeastFarmSiege.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/entity/siege/clanhalls/WildBeastFarmSiege.java
@@ -24,7 +24,7 @@ import java.util.Map;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.csv.DoorTable;
import com.l2jmobius.gameserver.datatables.sql.ClanTable;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
@@ -110,8 +110,8 @@ public class WildBeastFarmSiege extends ClanHallSiege
spawnFlags();
gateControl(1);
anonce("Take place at the siege of his headquarters.", 1);
- ThreadPoolManager.schedule(new startFirstStep(), 5 * 60000);
- _midTimer = ThreadPoolManager.schedule(new midSiegeStep(), 25 * 60000);
+ ThreadPool.schedule(new startFirstStep(), 5 * 60000);
+ _midTimer = ThreadPool.schedule(new midSiegeStep(), 25 * 60000);
_siegeEndDate = Calendar.getInstance();
_siegeEndDate.add(Calendar.MINUTE, 60);
_endSiegeTask.schedule(1000);
@@ -131,7 +131,7 @@ public class WildBeastFarmSiege extends ClanHallSiege
gateControl(1);
_finalStage = true;
anonce("Take place at the siege of his headquarters.", 1);
- ThreadPoolManager.schedule(new startFirstStep(), 5 * 60000);
+ ThreadPool.schedule(new startFirstStep(), 5 * 60000);
}
public void endSiege(boolean par)
@@ -665,7 +665,7 @@ public class WildBeastFarmSiege extends ClanHallSiege
else
{
_midTimer.cancel(false);
- ThreadPoolManager.schedule(new midSiegeStep(), 5000);
+ ThreadPool.schedule(new midSiegeStep(), 5000);
}
}
else
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestSpawn.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestSpawn.java
index b145522fa9..3209e7afa9 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestSpawn.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestSpawn.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.quest;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -140,7 +140,7 @@ public final class QuestSpawn
if (despawnDelay > 0)
{
- ThreadPoolManager.schedule(new DeSpawnScheduleTimerTask(result), despawnDelay);
+ ThreadPool.schedule(new DeSpawnScheduleTimerTask(result), despawnDelay);
}
return result;
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestStateManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestStateManager.java
index 7524929dc0..f61f7f47e9 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestStateManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestStateManager.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.quest;
import java.util.ArrayList;
import java.util.List;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
public class QuestStateManager
@@ -34,7 +34,7 @@ public class QuestStateManager
try
{
cleanUp();
- ThreadPoolManager.schedule(new ScheduleTimerTask(), 60000);
+ ThreadPool.schedule(new ScheduleTimerTask(), 60000);
}
catch (Throwable t)
{
@@ -51,7 +51,7 @@ public class QuestStateManager
// Constructor
public QuestStateManager()
{
- ThreadPoolManager.schedule(new ScheduleTimerTask(), 60000);
+ ThreadPool.schedule(new ScheduleTimerTask(), 60000);
}
// =========================================================
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
index 78e335f59a..435409ccef 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.quest;
import java.util.concurrent.ScheduledFuture;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -71,11 +71,11 @@ public class QuestTimer
_isRepeating = repeating;
if (repeating)
{
- _schedular = ThreadPoolManager.scheduleAtFixedRate(new ScheduleTimerTask(), time, time); // Prepare auto end task
+ _schedular = ThreadPool.scheduleAtFixedRate(new ScheduleTimerTask(), time, time); // Prepare auto end task
}
else
{
- _schedular = ThreadPoolManager.schedule(new ScheduleTimerTask(), time); // Prepare auto end task
+ _schedular = ThreadPool.schedule(new ScheduleTimerTask(), time); // Prepare auto end task
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/scripts/L2RBManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/scripts/L2RBManager.java
index cebd74802a..8485a24bef 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/scripts/L2RBManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/scripts/L2RBManager.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.scripts;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ai.CtrlIntention;
@@ -49,7 +49,7 @@ public class L2RBManager
player.sendPacket(sg);
final RaidbossLevel40 ef = new RaidbossLevel40(player);
- player.setSkillCast(ThreadPoolManager.schedule(ef, unstuckTimer));
+ player.setSkillCast(ThreadPool.schedule(ef, unstuckTimer));
player.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + (unstuckTimer / GameTimeController.MILLIS_IN_TICK));
}
@@ -196,7 +196,7 @@ public class L2RBManager
player.sendPacket(sg);
final RaidbossLevel45 ef = new RaidbossLevel45(player);
- player.setSkillCast(ThreadPoolManager.schedule(ef, unstuckTimer));
+ player.setSkillCast(ThreadPool.schedule(ef, unstuckTimer));
player.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + (unstuckTimer / GameTimeController.MILLIS_IN_TICK));
}
@@ -296,7 +296,7 @@ public class L2RBManager
player.sendPacket(sg);
final RaidbossLevel50 ef = new RaidbossLevel50(player);
- player.setSkillCast(ThreadPoolManager.schedule(ef, unstuckTimer));
+ player.setSkillCast(ThreadPool.schedule(ef, unstuckTimer));
player.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + (unstuckTimer / GameTimeController.MILLIS_IN_TICK));
}
@@ -416,7 +416,7 @@ public class L2RBManager
player.sendPacket(sg);
final RaidbossLevel55 ef = new RaidbossLevel55(player);
- player.setSkillCast(ThreadPoolManager.schedule(ef, unstuckTimer));
+ player.setSkillCast(ThreadPool.schedule(ef, unstuckTimer));
player.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + (unstuckTimer / GameTimeController.MILLIS_IN_TICK));
}
@@ -529,7 +529,7 @@ public class L2RBManager
player.sendPacket(sg);
final RaidbossLevel60 ef = new RaidbossLevel60(player);
- player.setSkillCast(ThreadPoolManager.schedule(ef, unstuckTimer));
+ player.setSkillCast(ThreadPool.schedule(ef, unstuckTimer));
player.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + (unstuckTimer / GameTimeController.MILLIS_IN_TICK));
}
@@ -622,7 +622,7 @@ public class L2RBManager
player.sendPacket(sg);
final RaidbossLevel65 ef = new RaidbossLevel65(player);
- player.setSkillCast(ThreadPoolManager.schedule(ef, unstuckTimer));
+ player.setSkillCast(ThreadPool.schedule(ef, unstuckTimer));
player.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + (unstuckTimer / GameTimeController.MILLIS_IN_TICK));
}
@@ -738,7 +738,7 @@ public class L2RBManager
player.sendPacket(sg);
final RaidbossLevel70 ef = new RaidbossLevel70(player);
- player.setSkillCast(ThreadPoolManager.schedule(ef, unstuckTimer));
+ player.setSkillCast(ThreadPool.schedule(ef, unstuckTimer));
player.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + (unstuckTimer / GameTimeController.MILLIS_IN_TICK));
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/AutoSpawn.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/AutoSpawn.java
index 81d2103f43..a423afab58 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/AutoSpawn.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/AutoSpawn.java
@@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.csv.MapRegionTable;
@@ -297,11 +297,11 @@ public class AutoSpawn
if (spawnInst._desDelay > 0)
{
- spawnTask = ThreadPoolManager.scheduleAtFixedRate(rs, spawnInst._initDelay, spawnInst._resDelay);
+ spawnTask = ThreadPool.scheduleAtFixedRate(rs, spawnInst._initDelay, spawnInst._resDelay);
}
else
{
- spawnTask = ThreadPoolManager.schedule(rs, spawnInst._initDelay);
+ spawnTask = ThreadPool.schedule(rs, spawnInst._initDelay);
}
synchronized (_runningSpawns)
@@ -323,7 +323,7 @@ public class AutoSpawn
spawnTask.cancel(false);
}
- ThreadPoolManager.schedule(rd, 0);
+ ThreadPool.schedule(rd, 0);
}
spawnInst.setSpawnActive(isActive);
@@ -604,7 +604,7 @@ public class AutoSpawn
if (spawnInst.getDespawnDelay() > 0)
{
AutoDespawner rd = new AutoDespawner(_objectId);
- ThreadPoolManager.schedule(rd, spawnInst.getDespawnDelay() - 1000);
+ ThreadPool.schedule(rd, spawnInst.getDespawnDelay() - 1000);
}
}
catch (Exception e)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2Spawn.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2Spawn.java
index ceb9564ffa..fa37120033 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2Spawn.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/spawn/L2Spawn.java
@@ -22,7 +22,7 @@ import java.util.List;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.sql.TerritoryTable;
import com.l2jmobius.gameserver.idfactory.IdFactory;
@@ -422,7 +422,7 @@ public class L2Spawn
_scheduledCount++;
// Create a new SpawnTask to launch after the respawn Delay
- ThreadPoolManager.schedule(new SpawnTask(), _respawnDelay);
+ ThreadPool.schedule(new SpawnTask(), _respawnDelay);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
index 30ff6312be..0ec47f15e9 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.Collection;
import java.util.concurrent.Future;
-import com.l2jmobius.commons.concurrent.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.zone.L2ZoneType;
@@ -59,7 +59,7 @@ public class L2DamageZone extends L2ZoneType
{
if (_task == null)
{
- _task = ThreadPoolManager.scheduleAtFixedRate(new ApplyDamage(this), 10, 1000);
+ _task = ThreadPool.scheduleAtFixedRate(new ApplyDamage(this), 10, 1000);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2DynamicZone.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2DynamicZone.java
index 840424f693..d48a9b3188 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2DynamicZone.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2DynamicZone.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.concurrent.Future;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.L2Skill;
import com.l2jmobius.gameserver.model.L2WorldRegion;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -49,7 +49,7 @@ public class L2DynamicZone extends L2ZoneType
_skill = skill;
Runnable r = () -> remove();
- setTask(ThreadPoolManager.schedule(r, skill.getBuffDuration()));
+ setTask(ThreadPool.schedule(r, skill.getBuffDuration()));
}
@Override
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
index 238417451e..984ad18eff 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.commons.util.StringUtil;
import com.l2jmobius.gameserver.datatables.SkillTable;
@@ -138,7 +138,7 @@ public class L2EffectZone extends L2ZoneType
{
if (_task == null)
{
- _task = ThreadPoolManager.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse);
+ _task = ThreadPool.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse);
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
index a4863de94e..725c923d4e 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.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.zone.L2ZoneType;
@@ -73,7 +73,7 @@ public class L2JailZone extends L2ZoneType
if (((L2PcInstance) character).isInJail())
{
// when a player wants to exit jail even if he is still jailed, teleport him back to jail
- ThreadPoolManager.schedule(new BackToJail(character), 2000);
+ ThreadPool.schedule(new BackToJail(character), 2000);
((L2PcInstance) character).sendMessage("You can't cheat your way out of here. You must wait until your jail time is over.");
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2PoisonZone.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2PoisonZone.java
index c75027253e..a0941ecaf2 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2PoisonZone.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/zone/type/L2PoisonZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.concurrent.Future;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.model.L2Skill;
@@ -106,7 +106,7 @@ public class L2PoisonZone extends L2ZoneType
{
if ((((character instanceof L2Playable) && _target.equalsIgnoreCase("pc")) || ((character instanceof L2PcInstance) && _target.equalsIgnoreCase("pc_only")) || ((character instanceof L2MonsterInstance) && _target.equalsIgnoreCase("npc"))) && (_task == null))
{
- _task = ThreadPoolManager.scheduleAtFixedRate(new ApplySkill(/* this */), _initialDelay, _reuse);
+ _task = ThreadPool.scheduleAtFixedRate(new ApplySkill(/* this */), _initialDelay, _reuse);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/L2GameClient.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/L2GameClient.java
index 8cad04dfd6..0e79af29be 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/L2GameClient.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/L2GameClient.java
@@ -31,7 +31,7 @@ import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.crypt.nProtect;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.mmocore.MMOClient;
@@ -125,7 +125,7 @@ public final class L2GameClient extends MMOClient> i
_packetQueue = new ArrayBlockingQueue<>(NetcoreConfig.getInstance().CLIENT_PACKET_QUEUE_SIZE);
_guardCheckTask = nProtect.getInstance().startTask(this);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (_closenow)
{
@@ -605,7 +605,7 @@ public final class L2GameClient extends MMOClient> i
// no long running tasks here, do it async
try
{
- ThreadPoolManager.execute(new DisconnectTask());
+ ThreadPool.execute(new DisconnectTask());
}
catch (RejectedExecutionException e)
@@ -636,7 +636,7 @@ public final class L2GameClient extends MMOClient> i
{
cancelCleanup();
}
- _cleanupTask = ThreadPoolManager.schedule(new CleanupTask(), delay); // delayed
+ _cleanupTask = ThreadPool.schedule(new CleanupTask(), delay); // delayed
}
stopGuardTask();
nProtect.getInstance().closeSession(this);
@@ -993,11 +993,11 @@ public final class L2GameClient extends MMOClient> i
return;
}
- ThreadPoolManager.execute(this);
+ ThreadPool.execute(this);
}
else
{
- ThreadPoolManager.execute(this);
+ ThreadPool.execute(this);
}
}
catch (RejectedExecutionException e)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 85f07964a1..b4288ac24e 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -26,7 +26,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.crypt.nProtect;
import com.l2jmobius.commons.crypt.nProtect.RestrictionType;
import com.l2jmobius.gameserver.GameTimeController;
@@ -538,7 +538,7 @@ public class EnterWorld extends L2GameClientPacket
{
activeChar.setIsImobilised(true);
activeChar.disableAllSkills();
- ThreadPoolManager.schedule(new Disconnection(activeChar), 20000);
+ ThreadPool.schedule(new Disconnection(activeChar), 20000);
}
// Elrokian Trap like L2OFF
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 8dab714b9e..5f5e65ae5f 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.network.clientpackets;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.csv.MapRegionTable;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.ClanHallManager;
@@ -250,7 +250,7 @@ public final class RequestRestartPoint extends L2GameClientPacket
if ((activeChar.getClan() != null) && castle.getSiege().checkIsAttacker(activeChar.getClan()))
{
// Schedule respawn delay for attacker
- ThreadPoolManager.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
+ ThreadPool.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
activeChar.sendMessage("You will be re-spawned in " + (castle.getSiege().getAttackerRespawnDelay() / 1000) + " seconds");
return;
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestWearItem.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestWearItem.java
index 4611e08bb0..9b8f60224b 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestWearItem.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestWearItem.java
@@ -21,7 +21,7 @@ import java.util.concurrent.Future;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.TradeController;
import com.l2jmobius.gameserver.datatables.xml.ItemTable;
import com.l2jmobius.gameserver.model.L2Object;
@@ -272,7 +272,7 @@ public final class RequestWearItem extends L2GameClientPacket
// All weared items should be removed in ALLOW_WEAR_DELAY sec.
if (_removeWearItemsTask == null)
{
- _removeWearItemsTask = ThreadPoolManager.schedule(new RemoveWearItemsTask(), Config.WEAR_DELAY * 1000);
+ _removeWearItemsTask = ThreadPool.schedule(new RemoveWearItemsTask(), Config.WEAR_DELAY * 1000);
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/script/faenor/FaenorEventParser.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/script/faenor/FaenorEventParser.java
index 6502418692..7de2ce8c33 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/script/faenor/FaenorEventParser.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/script/faenor/FaenorEventParser.java
@@ -25,7 +25,7 @@ import javax.script.ScriptContext;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.script.DateRange;
import com.l2jmobius.gameserver.script.IntList;
import com.l2jmobius.gameserver.script.Parser;
@@ -56,7 +56,7 @@ public class FaenorEventParser extends FaenorParser
if (_eventDates.getStartDate().after(currentDate))
{
_log.info("Event ID: (" + ID + ") is not active yet... Ignored.");
- ThreadPoolManager.schedule(() -> parseEventDropAndMessage(eventNode), _eventDates.getStartDate().getTime() - currentDate.getTime());
+ ThreadPool.schedule(() -> parseEventDropAndMessage(eventNode), _eventDates.getStartDate().getTime() - currentDate.getTime());
return;
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/scripting/L2ScriptEngineManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/scripting/L2ScriptEngineManager.java
index 3a7423b114..dce4aea9b5 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/scripting/L2ScriptEngineManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/scripting/L2ScriptEngineManager.java
@@ -41,7 +41,7 @@ import javax.script.ScriptException;
import javax.script.SimpleScriptContext;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jserver.script.jython.JythonScriptEngine;
/**
@@ -79,7 +79,7 @@ public final class L2ScriptEngineManager
{
_cache = null;
}
- ThreadPoolManager.scheduleAtFixedRate(new CleaneCache(), 43200000, 43200000);
+ ThreadPool.scheduleAtFixedRate(new CleaneCache(), 43200000, 43200000);
LOGGER.info("Initializing Script Engine Manager");
for (ScriptEngineFactory factory : factories)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 88c95a09f3..3fd5aa3afe 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -20,7 +20,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Summon;
import com.l2jmobius.gameserver.model.actor.instance.L2CubicInstance;
@@ -40,7 +40,7 @@ public class AttackStanceTaskManager
private AttackStanceTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
+ ThreadPool.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
}
public static AttackStanceTaskManager getInstance()
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 9cac12f87b..f740248ee6 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -21,7 +21,7 @@ import java.util.NoSuchElementException;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2RaidBossInstance;
@@ -37,7 +37,7 @@ public class DecayTaskManager
public DecayTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new DecayScheduler(), 10000, 5000);
+ ThreadPool.scheduleAtFixedRate(new DecayScheduler(), 10000, 5000);
}
public static DecayTaskManager getInstance()
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/ExclusiveTask.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/ExclusiveTask.java
index 2d5129b64e..13c4521d2b 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/ExclusiveTask.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/ExclusiveTask.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.taskmanager;
import java.util.concurrent.Future;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
/**
* @author NB4L1
@@ -59,19 +59,19 @@ public abstract class ExclusiveTask
{
cancel();
- _future = ThreadPoolManager.schedule(_runnable, delay);
+ _future = ThreadPool.schedule(_runnable, delay);
}
public final synchronized void execute()
{
- ThreadPoolManager.execute(_runnable);
+ ThreadPool.execute(_runnable);
}
public final synchronized void scheduleAtFixedRate(long delay, long period)
{
cancel();
- _future = ThreadPoolManager.scheduleAtFixedRate(_runnable, delay, period);
+ _future = ThreadPool.scheduleAtFixedRate(_runnable, delay, period);
}
private final Runnable _runnable = () ->
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/KnownListUpdateTaskManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/KnownListUpdateTaskManager.java
index 151c462445..582be07c0e 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/KnownListUpdateTaskManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/KnownListUpdateTaskManager.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.taskmanager;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.L2WorldRegion;
@@ -33,7 +33,7 @@ public class KnownListUpdateTaskManager
public KnownListUpdateTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new KnownListUpdate(), 1000, 750);
+ ThreadPool.scheduleAtFixedRate(new KnownListUpdate(), 1000, 750);
}
public static KnownListUpdateTaskManager getInstance()
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
index 616398b1a8..e52cf35b20 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -38,7 +38,7 @@ import java.util.Map;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskOlympiadSave;
@@ -258,7 +258,7 @@ public final class TaskManager
else if (type == TYPE_SHEDULED)
{
final long delay = Long.valueOf(task.getParams()[0]);
- task.scheduled = ThreadPoolManager.schedule(task, delay);
+ task.scheduled = ThreadPool.schedule(task, delay);
return true;
}
else if (type == TYPE_FIXED_SHEDULED)
@@ -266,7 +266,7 @@ public final class TaskManager
final long delay = Long.valueOf(task.getParams()[0]);
final long interval = Long.valueOf(task.getParams()[1]);
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
else if (type == TYPE_TIME)
@@ -277,7 +277,7 @@ public final class TaskManager
final long diff = desired.getTime() - System.currentTimeMillis();
if (diff >= 0)
{
- task.scheduled = ThreadPoolManager.schedule(task, diff);
+ task.scheduled = ThreadPool.schedule(task, diff);
return true;
}
LOGGER.info("Task " + task.getId() + " is obsoleted.");
@@ -329,7 +329,7 @@ public final class TaskManager
delay += interval;
}
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/thread/daemons/ItemsAutoDestroy.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/thread/daemons/ItemsAutoDestroy.java
index 13690a4735..7c5b8d3468 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/thread/daemons/ItemsAutoDestroy.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/thread/daemons/ItemsAutoDestroy.java
@@ -21,7 +21,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2ItemInstance;
@@ -42,7 +42,7 @@ public class ItemsAutoDestroy
{
_sleep = 3600000;
}
- ThreadPoolManager.scheduleAtFixedRate(new CheckItemsForDestroy(), 5000, 5000);
+ ThreadPool.scheduleAtFixedRate(new CheckItemsForDestroy(), 5000, 5000);
}
public static ItemsAutoDestroy getInstance()
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/updaters/CastleUpdater.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/updaters/CastleUpdater.java
index 48a555cfab..dab76488b7 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/updaters/CastleUpdater.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/updaters/CastleUpdater.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.updaters;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.model.ItemContainer;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -61,7 +61,7 @@ public class CastleUpdater implements Runnable
_runCount++;
final CastleUpdater cu = new CastleUpdater(_clan, _runCount);
- ThreadPoolManager.schedule(cu, 3600000);
+ ThreadPool.schedule(cu, 3600000);
}
}
catch (Throwable e)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/util/Util.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/util/Util.java
index 69d22050e9..b93c365c51 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/util/Util.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/util/Util.java
@@ -20,7 +20,7 @@ import java.io.File;
import java.io.IOException;
import java.util.Collection;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
@@ -52,7 +52,7 @@ public final class Util
public static void handleIllegalPlayerAction(L2PcInstance actor, String message, int punishment)
{
- ThreadPoolManager.schedule(new IllegalPlayerAction(actor, message, punishment), 5000);
+ ThreadPool.schedule(new IllegalPlayerAction(actor, message, punishment), 5000);
}
public static String getRelativePath(File base, File file)
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/GameStatusThread.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/GameStatusThread.java
index 1ebedef93f..c21141b01d 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/GameStatusThread.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/GameStatusThread.java
@@ -44,7 +44,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.object.L2ObjectMap;
import com.l2jmobius.gameserver.GameTimeController;
@@ -315,7 +315,7 @@ public class GameStatusThread extends Thread
}
else if (_usrCommand.equals("performance"))
{
- for (String line : ThreadPoolManager.getStats())
+ for (String line : ThreadPool.getStats())
{
_print.println(line);
}
@@ -323,10 +323,10 @@ public class GameStatusThread extends Thread
}
else if (_usrCommand.equals("purge"))
{
- ThreadPoolManager.purge();
+ ThreadPool.purge();
_print.println("STATUS OF THREAD POOLS AFTER PURGE COMMAND:");
_print.println("");
- for (String line : ThreadPoolManager.getStats())
+ for (String line : ThreadPool.getStats())
{
_print.println(line);
}
@@ -1223,7 +1223,7 @@ public class GameStatusThread extends Thread
checkForDeadlocks(sb);
sb.append("\n\n## Thread Pool Manager Statistics ##\n");
- for (String line : ThreadPoolManager.getStats())
+ for (String line : ThreadPool.getStats())
{
sb.append(line);
sb.append('\n');
diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/Status.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/Status.java
index fea01ff5e1..ef251060d2 100644
--- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/Status.java
+++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/status/Status.java
@@ -29,7 +29,7 @@ import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.Server;
-import com.l2jmobius.commons.concurrent.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
public class Status extends Thread
@@ -60,7 +60,7 @@ public class Status extends Thread
final GameStatusThread gst = new GameStatusThread(connection, _uptime, _statusPw);
if (!connection.isClosed())
{
- ThreadPoolManager.execute(gst);
+ ThreadPool.execute(gst);
}
}
else if (_mode == Server.MODE_LOGINSERVER)
@@ -68,7 +68,7 @@ public class Status extends Thread
final LoginStatusThread lst = new LoginStatusThread(connection, _uptime, _statusPw);
if (!connection.isClosed())
{
- ThreadPoolManager.execute(lst);
+ ThreadPool.execute(lst);
_loginStatus.add(lst);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/fantasy_isle/Parade.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/fantasy_isle/Parade.java
index 4d7e572a77..c2a0feec22 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/fantasy_isle/Parade.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/fantasy_isle/Parade.java
@@ -20,8 +20,8 @@ import java.text.SimpleDateFormat;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
+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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -131,7 +131,7 @@ public final class Parade extends AbstractNpcAI
// Starts at 8:00 and repeats every 6 hours.
final long diff = timeLeftMilli(8, 0, 0), cycle = 3600000L;
- ThreadPoolManager.scheduleAtFixedRate(new Start(), diff, cycle);
+ ThreadPool.scheduleAtFixedRate(new Start(), diff, cycle);
// Test - Starts 3 minutes after server startup and repeats every 20 minutes.
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000L;
@@ -169,9 +169,9 @@ public final class Parade extends AbstractNpcAI
public void run()
{
load();
- spawnTask = ThreadPoolManager.scheduleAtFixedRate(new Spawn(), 0, 5000);
- deleteTask = ThreadPoolManager.scheduleAtFixedRate(new Delete(), 10000, 1000);
- cleanTask = ThreadPoolManager.schedule(new Clean(), 420000);
+ spawnTask = ThreadPool.scheduleAtFixedRate(new Spawn(), 0, 5000);
+ deleteTask = ThreadPool.scheduleAtFixedRate(new Delete(), 10000, 1000);
+ cleanTask = ThreadPool.schedule(new Clean(), 420000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/group_template/DenOfEvil.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/group_template/DenOfEvil.java
index e9d40f8caf..daf2faab95 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/group_template/DenOfEvil.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/group_template/DenOfEvil.java
@@ -16,7 +16,7 @@
*/
package ai.group_template;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
@@ -128,7 +128,7 @@ public final class DenOfEvil extends AbstractNpcAI
zone.addSkill(skillId, skillLevel + 1);
if (skillLevel == 3) // 3+1=4
{
- ThreadPoolManager.schedule(new KashaDestruction(zone), 2 * 60 * 1000l);
+ ThreadPool.schedule(new KashaDestruction(zone), 2 * 60 * 1000l);
zone.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.KASHA_S_EYE_PITCHES_AND_TOSSES_LIKE_IT_S_ABOUT_TO_EXPLODE));
}
else if (skillLevel == 2)
@@ -141,7 +141,7 @@ public final class DenOfEvil extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
- ThreadPoolManager.schedule(new RespawnNewEye(npc.getLocation()), 15000);
+ ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
if (zone == null)
{
@@ -216,7 +216,7 @@ public final class DenOfEvil extends AbstractNpcAI
final L2Npc npc = (L2Npc) character;
if (Util.contains(EYE_IDS, npc.getId()))
{
- ThreadPoolManager.schedule(new RespawnNewEye(npc.getLocation()), 15000);
+ ThreadPool.schedule(new RespawnNewEye(npc.getLocation()), 15000);
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/group_template/RandomSpawn.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/group_template/RandomSpawn.java
index 0a7bee71bb..9aa0a4c1c9 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/group_template/RandomSpawn.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/group_template/RandomSpawn.java
@@ -19,7 +19,7 @@ package ai.group_template;
import java.util.HashMap;
import java.util.Map;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -91,7 +91,7 @@ public final class RandomSpawn extends AbstractNpcAI
if (!npc.isInsideRadius(loc, 200, false, false))
{
npc.getSpawn().setLocation(loc);
- ThreadPoolManager.schedule(new Teleport(npc, loc), 100);
+ ThreadPool.schedule(new Teleport(npc, loc), 100);
}
return super.onSpawn(npc);
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/individual/QueenAnt.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/individual/QueenAnt.java
index f2182e27d2..c3713cc8b1 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/individual/QueenAnt.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/individual/QueenAnt.java
@@ -21,7 +21,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.ai.CtrlIntention;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
import com.l2jmobius.gameserver.model.Location;
@@ -246,7 +246,7 @@ public final class QueenAnt extends AbstractNpcAI
}
case QUEEN:
{
- _task = ThreadPoolManager.scheduleAtFixedRate(new QueenAntTask(), 5 * 1000, 5 * 1000);
+ _task = ThreadPool.scheduleAtFixedRate(new QueenAntTask(), 5 * 1000, 5 * 1000);
break;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java
index 9e52de84df..6c27dab784 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java
@@ -25,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.L2Territory;
@@ -55,8 +55,8 @@ public class TarBeetleSpawn implements IXmlReader
parseDatapackFile("data/spawnZones/tar_beetle.xml");
if (!zones.isEmpty())
{
- spawnTask = ThreadPoolManager.scheduleAtFixedRate(() -> zones.forEach(SpawnZone::refreshSpawn), 1000, 60000);
- shotTask = ThreadPoolManager.scheduleAtFixedRate(() -> zones.forEach(SpawnZone::refreshShots), 300000, 300000);
+ spawnTask = ThreadPool.scheduleAtFixedRate(() -> zones.forEach(SpawnZone::refreshSpawn), 1000, 60000);
+ shotTask = ThreadPool.scheduleAtFixedRate(() -> zones.forEach(SpawnZone::refreshShots), 300000, 300000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBufferAI.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBufferAI.java
index 6ad24ec99e..d063895b2a 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBufferAI.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBufferAI.java
@@ -16,7 +16,7 @@
*/
package ai.npc.NpcBuffers;
-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.instance.L2PcInstance;
@@ -110,7 +110,7 @@ public class NpcBufferAI implements Runnable
break;
}
}
- ThreadPoolManager.schedule(this, _skillData.getDelay());
+ ThreadPool.schedule(this, _skillData.getDelay());
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffers.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffers.java
index 4eb2134add..63f99d5ed2 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffers.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffers.java
@@ -16,7 +16,7 @@
*/
package ai.npc.NpcBuffers;
-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;
@@ -54,7 +54,7 @@ public final class NpcBuffers extends AbstractNpcAI
final NpcBufferData data = _npcBuffers.getNpcBuffer(npc.getId());
for (NpcBufferSkillData skill : data.getSkills())
{
- ThreadPoolManager.schedule(new NpcBufferAI(npc, skill), skill.getInitialDelay());
+ ThreadPool.schedule(new NpcBufferAI(npc, skill), skill.getInitialDelay());
}
return super.onSpawn(npc);
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/impl/CabaleBuffer.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/impl/CabaleBuffer.java
index 99472b9e85..978a755910 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/impl/CabaleBuffer.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/impl/CabaleBuffer.java
@@ -18,8 +18,8 @@ package ai.npc.NpcBuffers.impl;
import java.util.Collection;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.SevenSigns;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -76,8 +76,8 @@ public final class CabaleBuffer extends AbstractNpcAI
@Override
public String onSpawn(L2Npc npc)
{
- ThreadPoolManager.schedule(new CabaleAI(npc), 3000);
- ThreadPoolManager.schedule(new Talk(npc), 60000);
+ ThreadPool.schedule(new CabaleAI(npc), 3000);
+ ThreadPool.schedule(new Talk(npc), 60000);
return super.onSpawn(npc);
}
@@ -101,7 +101,7 @@ public final class CabaleBuffer extends AbstractNpcAI
messages = PREACHER_MSG;
}
broadcastSay(_npc, messages[getRandom(messages.length)], null, -1);
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
}
}
}
@@ -224,7 +224,7 @@ public final class CabaleBuffer extends AbstractNpcAI
break;
}
}
- ThreadPoolManager.schedule(this, 3000);
+ ThreadPool.schedule(this, 3000);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/FortressOfTheDead/FortressOfTheDead.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/FortressOfTheDead/FortressOfTheDead.java
index 4d57f6b97f..8fd9e86d3d 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/FortressOfTheDead/FortressOfTheDead.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/FortressOfTheDead/FortressOfTheDead.java
@@ -20,8 +20,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -159,7 +159,7 @@ public final class FortressOfTheDead extends ClanHallSiegeEngine
{
cancelSiegeTask();
final long scheduleTime = (24 - hoursLeft) * 10 * 60000;
- _siegeTask = ThreadPoolManager.schedule(new SiegeStarts(), scheduleTime);
+ _siegeTask = ThreadPool.schedule(new SiegeStarts(), scheduleTime);
}
else
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java
index 5a50ca67d1..de462e3d2f 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java
@@ -29,8 +29,8 @@ import java.util.Map;
import java.util.concurrent.ScheduledFuture;
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.cache.HtmCache;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.datatables.SpawnTable;
@@ -116,7 +116,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
}
if (_acceptedClans.size() >= 2)
{
- _nextSiege = ThreadPoolManager.schedule(new SiegeStart(), 3600000);
+ _nextSiege = ThreadPool.schedule(new SiegeStart(), 3600000);
_rainbow.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
}
else
@@ -140,7 +140,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
// XXX _rainbow.siegeStarts();
spawnGourds();
- _siegeEnd = ThreadPoolManager.schedule(new SiegeEnd(null), _rainbow.getSiegeLenght() - 120000);
+ _siegeEnd = ThreadPool.schedule(new SiegeEnd(null), _rainbow.getSiegeLenght() - 120000);
}
}
@@ -178,10 +178,10 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
// XXX _rainbow.siegeEnds();
- ThreadPoolManager.schedule(new SetFinalAttackers(), _rainbow.getNextSiegeTime());
+ ThreadPool.schedule(new SetFinalAttackers(), _rainbow.getNextSiegeTime());
setRegistrationEndString((_rainbow.getNextSiegeTime() + System.currentTimeMillis()) - 3600000);
// Teleport out of the arenas is made 2 mins after game ends
- ThreadPoolManager.schedule(new TeleportBack(), 120000);
+ ThreadPool.schedule(new TeleportBack(), 120000);
}
}
@@ -287,7 +287,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
if (delay > -1)
{
setRegistrationEndString(delay - 3600000);
- _nextSiege = ThreadPoolManager.schedule(new SetFinalAttackers(), delay);
+ _nextSiege = ThreadPool.schedule(new SetFinalAttackers(), delay);
}
else
{
@@ -625,7 +625,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
{
_siegeEnd.cancel(false);
}
- ThreadPoolManager.execute(new SiegeEnd(clan));
+ ThreadPool.execute(new SiegeEnd(clan));
}
}
@@ -905,7 +905,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
public static void launchSiege()
{
_nextSiege.cancel(false);
- ThreadPoolManager.execute(new SiegeStart());
+ ThreadPool.execute(new SiegeStart());
}
@Override
@@ -915,7 +915,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
{
_siegeEnd.cancel(false);
}
- ThreadPoolManager.execute(new SiegeEnd(null));
+ ThreadPool.execute(new SiegeEnd(null));
}
public static void updateAdminDate(long date)
@@ -932,7 +932,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
}
date -= 3600000;
setRegistrationEndString(date);
- _nextSiege = ThreadPoolManager.schedule(new SetFinalAttackers(), _rainbow.getNextSiegeTime());
+ _nextSiege = ThreadPool.schedule(new SetFinalAttackers(), _rainbow.getNextSiegeTime());
}
public static void main(String[] args)
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java
index e45df52b7d..95934662ee 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java
@@ -25,8 +25,8 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+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.ai.L2SpecialSiegeGuardAI;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
@@ -402,7 +402,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
doUnSpawns(data);
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
for (int doorId : INNER_DOORS_TO_OPEN)
{
@@ -457,7 +457,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
Broadcast.toAllOnlinePlayers(msg);
_hall.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
- _siegeTask = ThreadPoolManager.schedule(new SiegeStarts(), 3600000);
+ _siegeTask = ThreadPool.schedule(new SiegeStarts(), 3600000);
}
@Override
@@ -499,7 +499,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
}
// Schedule open doors closement and siege start in 2 minutes
- ThreadPoolManager.schedule(new CloseOutterDoorsTask(this), 300000);
+ ThreadPool.schedule(new CloseOutterDoorsTask(this), 300000);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/events/Elpies/Elpies.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/events/Elpies/Elpies.java
index 8d9c942116..d1ac0ad152 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/events/Elpies/Elpies.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/events/Elpies/Elpies.java
@@ -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.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2EventMonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -111,7 +111,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();
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/events/Race/Race.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/events/Race/Race.java
index e86930ab65..15c7c48988 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/events/Race/Race.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/events/Race/Race.java
@@ -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.datatables.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -137,7 +137,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;
@@ -180,7 +180,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
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/AI/EnergySeeds.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/AI/EnergySeeds.java
index 1eb7cc7c6b..3dc2c2eb6a 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/AI/EnergySeeds.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/AI/EnergySeeds.java
@@ -23,7 +23,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.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
@@ -977,7 +977,7 @@ public class EnergySeeds extends AbstractNpcAI
public void scheduleRespawn(long waitTime)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// if the AI is inactive, do not spawn the NPC
if (isSeedActive(_seedId))
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java
index 64d20b2519..429d5688c0 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java
@@ -21,7 +21,7 @@ import java.util.Calendar;
import java.util.List;
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.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.SoIManager;
@@ -561,8 +561,8 @@ public class HallOfErosionAttack extends AbstractNpcAI
npc.deleteMe();
world.deadTumor = addSpawn(TUMOR_DEAD, loc, world.getInstanceId());
world.deadTumors.add(world.deadTumor);
- ThreadPoolManager.schedule(new TumorRevival(world.deadTumor, world), tumorRespawnTime);
- ThreadPoolManager.schedule(new RegenerationCoffinSpawn(world.deadTumor, world), 20000);
+ ThreadPool.schedule(new TumorRevival(world.deadTumor, world), tumorRespawnTime);
+ ThreadPool.schedule(new RegenerationCoffinSpawn(world.deadTumor, world), 20000);
if (world.tumorCount >= 1)
{
broadCastPacket(world, new ExShowScreenMessage(NpcStringId.THE_TUMOR_INSIDE_S1_HAS_BEEN_DESTROYED_NIN_ORDER_TO_DRAW_OUT_THE_COWARDLY_COHEMENES_YOU_MUST_DESTROY_ALL_THE_TUMORS, 2, 8000));
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java
index 457840d315..253b64ec8f 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java
@@ -21,7 +21,7 @@ import java.util.List;
import java.util.concurrent.ScheduledFuture;
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.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2CommandChannel;
@@ -358,7 +358,7 @@ public class HallOfErosionDefence extends AbstractNpcAI
world.addAllowed(player.getObjectId());
}
- ((HEDWorld) world).finishTask = ThreadPoolManager.schedule(new FinishTask((HEDWorld) world), 20 * 60000);
+ ((HEDWorld) world).finishTask = ThreadPool.schedule(new FinishTask((HEDWorld) world), 20 * 60000);
runTumors((HEDWorld) world);
}
}
@@ -391,7 +391,7 @@ public class HallOfErosionDefence extends AbstractNpcAI
{
final L2Npc npc = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.getInstanceId());
world.deadTumors.add(npc);
- ThreadPoolManager.schedule(new RegenerationCoffinSpawn(npc, world), 1000);
+ ThreadPool.schedule(new RegenerationCoffinSpawn(npc, world), 1000);
}
}
@@ -403,7 +403,7 @@ public class HallOfErosionDefence extends AbstractNpcAI
}
}
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (!conquestEnded)
{
@@ -544,7 +544,7 @@ public class HallOfErosionDefence extends AbstractNpcAI
world.deadTumor = addSpawn(TUMOR_DEAD, npc.getLocation(), world.getInstanceId());
world.deadTumors.add(world.deadTumor);
broadCastPacket(world, new ExShowScreenMessage(NpcStringId.THE_TUMOR_INSIDE_S1_HAS_BEEN_DESTROYED_NTHE_NEARBY_UNDEAD_THAT_WERE_ATTACKING_SEED_OF_LIFE_START_LOSING_THEIR_ENERGY_AND_RUN_AWAY, 2, 8000));
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
world.deadTumor.deleteMe();
final L2Npc tumor = addSpawn(TUMOR_ALIVE, world.deadTumor.getLocation(), world.getInstanceId());
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityAttack/HeartInfinityAttack.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityAttack/HeartInfinityAttack.java
index d4a688d536..cb7b3037c2 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityAttack/HeartInfinityAttack.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityAttack/HeartInfinityAttack.java
@@ -22,7 +22,7 @@ import java.util.List;
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.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
@@ -358,7 +358,7 @@ public class HeartInfinityAttack extends Quest
}
conquestBegun = true;
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
for (int objId : world.getAllowed())
{
@@ -366,7 +366,7 @@ public class HeartInfinityAttack extends Quest
player.showQuestMovie(2); // ExStartScenePlayer.SCENE_ECHMUS_OPENING
}
- ThreadPoolManager.schedule(() -> conquestBegins(world), 62500);
+ ThreadPool.schedule(() -> conquestBegins(world), 62500);
}, 20000);
}
@@ -420,7 +420,7 @@ public class HeartInfinityAttack extends Quest
world.hounds.add(addSpawn(HOUND, -179224, 209624, -15504, 16384, false, 0, false, world.getInstanceId()));
world.hounds.add(addSpawn(HOUND, -179880, 209464, -15504, 16384, false, 0, false, world.getInstanceId()));
world.startTime = System.currentTimeMillis();
- world.timerTask = ThreadPoolManager.scheduleAtFixedRate(new TimerTask(world), 298 * 1000, 5 * 60 * 1000);
+ world.timerTask = ThreadPool.scheduleAtFixedRate(new TimerTask(world), 298 * 1000, 5 * 60 * 1000);
}
@Override
@@ -607,8 +607,8 @@ public class HeartInfinityAttack extends Quest
npc.deleteMe();
world.deadTumor = addSpawn(DEADTUMOR, loc, world.getInstanceId());
world.deadTumors.add(world.deadTumor);
- ThreadPoolManager.schedule(new TumorRevival(world.deadTumor, world), tumorRespawnTime);
- ThreadPoolManager.schedule(new RegenerationCoffinSpawn(world.deadTumor, world), 20000);
+ ThreadPool.schedule(new TumorRevival(world.deadTumor, world), tumorRespawnTime);
+ ThreadPool.schedule(new RegenerationCoffinSpawn(world.deadTumor, world), 20000);
if (world.tumorCount < 1)
{
houndBlocked = true;
@@ -839,7 +839,7 @@ public class HeartInfinityAttack extends Quest
}
}
- ThreadPoolManager.schedule(() -> broadCastPacket(world, new ExShowScreenMessage(NpcStringId.EKIMUS_HAS_SENSED_ABNORMAL_ACTIVITY_NTHE_ADVANCING_PARTY_IS_FORCEFULLY_EXPELLED, 2, 8000)), 10000);
+ ThreadPool.schedule(() -> broadCastPacket(world, new ExShowScreenMessage(NpcStringId.EKIMUS_HAS_SENSED_ABNORMAL_ACTIVITY_NTHE_ADVANCING_PARTY_IS_FORCEFULLY_EXPELLED, 2, 8000)), 10000);
}
protected void conquestConclusion(HIAWorld world)
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java
index da1b7bec00..ef53500c4f 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java
@@ -21,7 +21,7 @@ import java.util.List;
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.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
@@ -365,15 +365,15 @@ public class HeartInfinityDefence extends Quest
}
}
((HIDWorld) world).startTime = System.currentTimeMillis();
- ((HIDWorld) world).finishTask = ThreadPoolManager.schedule(new FinishTask((HIDWorld) world), 30 * 60000);
- ((HIDWorld) world).timerTask = ThreadPoolManager.scheduleAtFixedRate(new TimerTask((HIDWorld) world), 298 * 1000, 5 * 60 * 1000);
+ ((HIDWorld) world).finishTask = ThreadPool.schedule(new FinishTask((HIDWorld) world), 30 * 60000);
+ ((HIDWorld) world).timerTask = ThreadPool.scheduleAtFixedRate(new TimerTask((HIDWorld) world), 298 * 1000, 5 * 60 * 1000);
conquestBegins((HIDWorld) world);
}
}
private void conquestBegins(HIDWorld world)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
broadCastPacket(world, new ExShowScreenMessage(NpcStringId.YOU_CAN_HEAR_THE_UNDEAD_OF_EKIMUS_RUSHING_TOWARD_YOU_S1_S2_IT_HAS_NOW_BEGUN, 2, 8000));
for (int[] spawn1 : ROOMS_MOBS)
@@ -406,7 +406,7 @@ public class HeartInfinityDefence extends Quest
InstanceManager.getInstance().getInstance(world.getInstanceId()).getDoor(14240102).openMe();
preawakenedEchmus = addSpawn(29161, -179534, 208510, -15496, 16342, false, 0, false, world.getInstanceId());
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (!conquestEnded)
{
@@ -423,7 +423,7 @@ public class HeartInfinityDefence extends Quest
}
}, 60000);
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (!conquestEnded)
{
@@ -452,7 +452,7 @@ public class HeartInfinityDefence extends Quest
}
}, tumorRespawnTime);
- world.wagonSpawnTask = ThreadPoolManager.scheduleAtFixedRate(() -> addSpawn(SOULWAGON, -179544, 207400, -15496, 0, false, 0, false, world.getInstanceId()), 1000, wagonRespawnTime);
+ world.wagonSpawnTask = ThreadPool.scheduleAtFixedRate(() -> addSpawn(SOULWAGON, -179544, 207400, -15496, 0, false, 0, false, world.getInstanceId()), 1000, wagonRespawnTime);
}, 20000);
}
@@ -593,7 +593,7 @@ public class HeartInfinityDefence extends Quest
wagonRespawnTime += 10000;
broadCastPacket(world, new ExShowScreenMessage(NpcStringId.THE_TUMOR_INSIDE_S1_HAS_BEEN_DESTROYED_NTHE_SPEED_THAT_EKIMUS_CALLS_OUT_HIS_PREY_HAS_SLOWED_DOWN, 2, 8000));
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
world.deadTumor.deleteMe();
final L2Npc alivetumor = addSpawn(ALIVETUMOR, loc, world.getInstanceId());
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/vehicles/AirShipController.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/vehicles/AirShipController.java
index 1ee06458a5..42872fb411 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/vehicles/AirShipController.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/vehicles/AirShipController.java
@@ -20,7 +20,7 @@ import java.util.concurrent.Future;
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.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.AirShipManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -307,11 +307,11 @@ public abstract class AirShipController extends Quest
}
}
- ThreadPoolManager.schedule(_decayTask, 1000);
+ ThreadPool.schedule(_decayTask, 1000);
}
else
{
- _departSchedule = ThreadPoolManager.schedule(_departTask, DEPART_INTERVAL);
+ _departSchedule = ThreadPool.schedule(_departTask, DEPART_INTERVAL);
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/vehicles/AirShipGludioGracia/AirShipGludioGracia.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
index 8d170bda31..d80d70060d 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/vehicles/AirShipGludioGracia/AirShipGludioGracia.java
@@ -16,7 +16,7 @@
*/
package gracia.vehicles.AirShipGludioGracia;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.AirShipManager;
import com.l2jmobius.gameserver.model.L2Object;
@@ -255,7 +255,7 @@ public final class AirShipGludioGracia extends Quest implements Runnable
{
// _ship.teleToLocation(-167874, 256731, -509, 41035, false);
_ship.setOustLoc(OUST_GRACIA);
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
break;
}
case 2:
@@ -268,7 +268,7 @@ public final class AirShipGludioGracia extends Quest implements Runnable
broadcastInGracia(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_ADEN_CONTINENT_IN_1_MINUTE);
_ship.setInDock(GRACIA_DOCK_ID);
_ship.oustPlayers();
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
case 4:
@@ -282,7 +282,7 @@ public final class AirShipGludioGracia extends Quest implements Runnable
{
// _ship.teleToLocation(-157261, 255664, 221, 64781, false);
_ship.setOustLoc(OUST_GLUDIO);
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
break;
}
case 6:
@@ -295,7 +295,7 @@ public final class AirShipGludioGracia extends Quest implements Runnable
broadcastInGludio(NpcStringId.THE_REGULARLY_SCHEDULED_AIRSHIP_HAS_ARRIVED_IT_WILL_DEPART_FOR_THE_GRACIA_CONTINENT_IN_1_MINUTE);
_ship.setInDock(GLUDIO_DOCK_ID);
_ship.oustPlayers();
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java
index b2949c8334..89fc474fb3 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java
@@ -29,8 +29,8 @@ import java.util.StringTokenizer;
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.CharNameTable;
import com.l2jmobius.gameserver.data.xml.impl.ClassListData;
import com.l2jmobius.gameserver.data.xml.impl.TransformData;
@@ -385,7 +385,7 @@ public class AdminEditChar implements IAdminCommandHandler
if ((race != player.getRace()) || (((race == Race.HUMAN) || (race == Race.ORC)) && (isMage != player.isMageClass())))
{
TransformData.getInstance().transformPlayer(105, player);
- ThreadPoolManager.schedule(new Untransform(player), 200);
+ ThreadPool.schedule(new Untransform(player), 200);
}
}
else
@@ -493,7 +493,7 @@ public class AdminEditChar implements IAdminCommandHandler
player.broadcastUserInfo();
// Transform-untransorm player quickly to force the client to reload the character textures
TransformData.getInstance().transformPlayer(105, player);
- ThreadPoolManager.schedule(new Untransform(player), 200);
+ ThreadPool.schedule(new Untransform(player), 200);
}
else if (command.startsWith("admin_setcolor"))
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
index 45bb8f1ef5..8c1d650804 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminMonsterRace.java
@@ -16,8 +16,8 @@
*/
package handlers.admincommandhandlers;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.MonsterRace;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -109,7 +109,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunRace(codes, activeChar), 5000);
+ ThreadPool.schedule(new RunRace(codes, activeChar), 5000);
}
}
@@ -139,7 +139,7 @@ public class AdminMonsterRace implements IAdminCommandHandler
final MonRaceInfo spk = new MonRaceInfo(codes[2][0], codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
- ThreadPoolManager.schedule(new RunEnd(activeChar), 30000);
+ ThreadPool.schedule(new RunEnd(activeChar), 30000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java
index 83237dfc5f..9858be96c2 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java
@@ -22,9 +22,9 @@ import java.util.Collection;
import java.util.LinkedList;
import java.util.StringTokenizer;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.mmocore.NioNetStringBuffer;
import com.l2jmobius.gameserver.GameServer;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
@@ -603,7 +603,7 @@ public final class AdminPForge implements IAdminCommandHandler
p.setBuffers(bb, activeChar.getClient(), new NioNetStringBuffer(2000));
if (p.read())
{
- ThreadPoolManager.execute(p);
+ ThreadPool.execute(p);
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
index b048d5e331..e9a4f17e03 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
@@ -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.datatables.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);
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
index 5f9a7c2f99..5452b372bc 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
@@ -16,7 +16,7 @@
*/
package handlers.effecthandlers;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.conditions.Condition;
@@ -74,7 +74,7 @@ public final class ServitorShare extends AbstractEffect
final L2Character effected = info.getEffected().isPlayer() ? info.getEffected().getSummon() : info.getEffected().getActingPlayer();
if (effected != null)
{
- ThreadPoolManager.schedule(new ScheduledEffectExitTask(effected, info.getSkill().getId()), 100);
+ ThreadPool.schedule(new ScheduledEffectExitTask(effected, info.getSkill().getId()), 100);
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 443532fdff..a6978fc8f5 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -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;
@@ -168,7 +168,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();
@@ -204,7 +204,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();
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java
index 723313fe73..aaa51a0e89 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java
@@ -33,9 +33,9 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
+import com.l2jmobius.commons.concurrent.ThreadPool;
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.handler.ITelnetHandler;
@@ -200,7 +200,7 @@ public class DebugHandler implements ITelnetHandler
}
sb.append("\n\n## Thread Pool Manager Statistics ##\n");
- for (String line : ThreadPoolManager.getStats())
+ for (String line : ThreadPool.getStats())
{
sb.append(line);
sb.append('\n');
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/ThreadHandler.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/ThreadHandler.java
index c1e1fdeee4..ab11b91861 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/ThreadHandler.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/ThreadHandler.java
@@ -19,7 +19,7 @@ package handlers.telnethandlers;
import java.io.PrintWriter;
import java.net.Socket;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.handler.ITelnetHandler;
/**
@@ -38,7 +38,7 @@ public class ThreadHandler implements ITelnetHandler
{
if (command.equals("performance"))
{
- for (String line : ThreadPoolManager.getStats())
+ for (String line : ThreadPool.getStats())
{
_print.println(line);
}
@@ -46,10 +46,10 @@ public class ThreadHandler implements ITelnetHandler
}
else if (command.equals("purge"))
{
- ThreadPoolManager.purge();
+ ThreadPool.purge();
_print.println("STATUS OF THREAD POOLS AFTER PURGE COMMAND:");
_print.println("");
- for (String line : ThreadPoolManager.getStats())
+ for (String line : ThreadPool.getStats())
{
_print.println(line);
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/usercommandhandlers/Unstuck.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/usercommandhandlers/Unstuck.java
index efe8144536..a0d66e8d16 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/usercommandhandlers/Unstuck.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/usercommandhandlers/Unstuck.java
@@ -17,8 +17,8 @@
package handlers.usercommandhandlers;
import com.l2jmobius.Config;
+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.datatables.SkillData;
import com.l2jmobius.gameserver.handler.IUserCommandHandler;
@@ -111,7 +111,7 @@ public class Unstuck implements IUserCommandHandler
// End SoE Animation section
// continue execution later
- activeChar.setSkillCast(ThreadPoolManager.schedule(new EscapeFinalizer(activeChar), unstuckTimer));
+ activeChar.setSkillCast(ThreadPool.schedule(new EscapeFinalizer(activeChar), unstuckTimer));
return true;
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
index 7f2ed62f90..856942597c 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
@@ -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;
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/voicedcommandhandlers/Wedding.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/voicedcommandhandlers/Wedding.java
index 8b054d83a0..b2ea983622 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/voicedcommandhandlers/Wedding.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/voicedcommandhandlers/Wedding.java
@@ -23,10 +23,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.GameTimeController;
import com.l2jmobius.gameserver.SevenSigns;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.PlayerAction;
@@ -472,7 +472,7 @@ public class Wedding implements IVoicedCommandHandler
final EscapeFinalizer ef = new EscapeFinalizer(activeChar, partner.getLocation(), partner.isIn7sDungeon());
// continue execution later
- activeChar.setSkillCast(ThreadPoolManager.schedule(ef, teleportTimer));
+ activeChar.setSkillCast(ThreadPool.schedule(ef, teleportTimer));
activeChar.forceIsCasting(GameTimeController.getInstance().getGameTicks() + (teleportTimer / GameTimeController.MILLIS_IN_TICK));
return true;
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Chimeras.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Chimeras.java
index e1ec5a5513..31416f0971 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Chimeras.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Chimeras.java
@@ -17,7 +17,7 @@
package hellbound.AI;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -76,7 +76,7 @@ public final class Chimeras extends AbstractNpcAI
if (!npc.isInsideRadius(loc, 200, false, false))
{
npc.getSpawn().setLocation(loc);
- ThreadPoolManager.schedule(new Teleport(npc, loc), 100);
+ ThreadPool.schedule(new Teleport(npc, loc), 100);
}
}
return super.onSpawn(npc);
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TowerOfNaia/TowerOfNaia.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TowerOfNaia/TowerOfNaia.java
index e870316d39..f904ee24ea 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TowerOfNaia/TowerOfNaia.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TowerOfNaia/TowerOfNaia.java
@@ -26,7 +26,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicInteger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.datatables.SkillData;
@@ -557,7 +557,7 @@ public final class TowerOfNaia extends AbstractNpcAI
{
removeForeigners(npcId, party);
startRoom(npcId);
- ThreadPoolManager.schedule(new StopRoomTask(npcId), 300000);
+ ThreadPool.schedule(new StopRoomTask(npcId), 300000);
}
else
{
@@ -853,7 +853,7 @@ public final class TowerOfNaia extends AbstractNpcAI
}
else
{
- ThreadPoolManager.schedule(() -> addSpawn(MUTATED_ELPY, -45474, 247450, -13994, 49152, false, 0, false), respawnTime - System.currentTimeMillis());
+ ThreadPool.schedule(() -> addSpawn(MUTATED_ELPY, -45474, 247450, -13994, 49152, false, 0, false), respawnTime - System.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TullyWorkshop/TullyWorkshop.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TullyWorkshop/TullyWorkshop.java
index 1e9fc6be9f..3e8d8dff42 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TullyWorkshop/TullyWorkshop.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TullyWorkshop/TullyWorkshop.java
@@ -26,7 +26,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.datatables.SkillData;
@@ -1207,7 +1207,7 @@ public final class TullyWorkshop extends AbstractNpcAI
DoorData.getInstance().getDoor(19260052).openMe();
countdownTime = 600000;
- _countdown = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _countdown = ThreadPool.scheduleAtFixedRate(() ->
{
countdownTime -= 10000;
L2Npc _npc = null;
@@ -1570,20 +1570,20 @@ public final class TullyWorkshop extends AbstractNpcAI
{
DoorData.getInstance().getDoor(20250005).openMe();
DoorData.getInstance().getDoor(20250004).openMe();
- ThreadPoolManager.schedule(new DoorTask(new int[]
+ ThreadPool.schedule(new DoorTask(new int[]
{
20250006,
20250007
}, STATE_OPEN), 2000);
- ThreadPoolManager.schedule(new DoorTask(new int[]
+ ThreadPool.schedule(new DoorTask(new int[]
{
20250778
}, STATE_CLOSE), 3000);
- ThreadPoolManager.schedule(new DoorTask(new int[]
+ ThreadPool.schedule(new DoorTask(new int[]
{
20250777
}, STATE_CLOSE), 6000);
- ThreadPoolManager.schedule(new DoorTask(new int[]
+ ThreadPool.schedule(new DoorTask(new int[]
{
20250009,
20250008
@@ -1594,12 +1594,12 @@ public final class TullyWorkshop extends AbstractNpcAI
{
DoorData.getInstance().getDoor(20250009).closeMe();
DoorData.getInstance().getDoor(20250008).closeMe();
- ThreadPoolManager.schedule(new DoorTask(new int[]
+ ThreadPool.schedule(new DoorTask(new int[]
{
20250777,
20250778
}, STATE_OPEN), 1000);
- ThreadPoolManager.schedule(new DoorTask(new int[]
+ ThreadPool.schedule(new DoorTask(new int[]
{
20250005,
20250004,
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/Instances/UrbanArea/UrbanArea.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/Instances/UrbanArea/UrbanArea.java
index 55de951377..5864fc46e3 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/Instances/UrbanArea/UrbanArea.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/hellbound/Instances/UrbanArea/UrbanArea.java
@@ -18,7 +18,7 @@ package hellbound.Instances.UrbanArea;
import java.util.concurrent.ScheduledFuture;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Party;
@@ -167,7 +167,7 @@ public final class UrbanArea extends AbstractInstance
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
inst.setDuration(5 * 60000);
inst.setEmptyDestroyTime(0);
- ThreadPoolManager.schedule(new ExitInstance(party, world), 285000);
+ ThreadPool.schedule(new ExitInstance(party, world), 285000);
htmltext = "32343-02d.htm";
}
}
@@ -221,7 +221,7 @@ public final class UrbanArea extends AbstractInstance
world.activeAmaskariCall.cancel(true);
}
- world.activeAmaskariCall = ThreadPoolManager.schedule(new CallAmaskari(npc), 25000);
+ world.activeAmaskariCall = ThreadPool.schedule(new CallAmaskari(npc), 25000);
}
}
}
@@ -267,7 +267,7 @@ public final class UrbanArea extends AbstractInstance
{
world.activeAmaskariCall.cancel(true);
}
- world.activeAmaskariCall = ThreadPoolManager.schedule(new CallAmaskari(npc), 25000);
+ world.activeAmaskariCall = ThreadPool.schedule(new CallAmaskari(npc), 25000);
}
}
}
@@ -319,7 +319,7 @@ public final class UrbanArea extends AbstractInstance
{
world.activeAmaskariCall.cancel(true);
}
- world.activeAmaskariCall = ThreadPoolManager.schedule(new CallAmaskari(npc), 25000);
+ world.activeAmaskariCall = ThreadPool.schedule(new CallAmaskari(npc), 25000);
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/ChambersOfDelusion/Chamber.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/ChambersOfDelusion/Chamber.java
index ffbf666bf5..bc469a55ce 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/ChambersOfDelusion/Chamber.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/ChambersOfDelusion/Chamber.java
@@ -21,7 +21,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
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.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
@@ -61,7 +61,7 @@ public abstract class Chamber extends AbstractInstance
{
currentRoom = 0;
partyInside = party;
- _banishTask = ThreadPoolManager.scheduleAtFixedRate(new BanishTask(), 60000, 60000);
+ _banishTask = ThreadPool.scheduleAtFixedRate(new BanishTask(), 60000, 60000);
}
protected L2Party getPartyInside()
@@ -77,7 +77,7 @@ public abstract class Chamber extends AbstractInstance
// Schedule next room change only if remaining time is enough
if ((inst.getInstanceEndTime() - System.currentTimeMillis()) > nextInterval)
{
- _roomChangeTask = ThreadPoolManager.schedule(new ChangeRoomTask(), nextInterval - 5000);
+ _roomChangeTask = ThreadPool.schedule(new ChangeRoomTask(), nextInterval - 5000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java
index 7afb9bbee9..a59d3b8abd 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java
@@ -30,7 +30,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-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.geoengine.GeoEngine;
@@ -624,7 +624,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
{
openDoor(doorId, world.getInstanceId());
}
- ThreadPoolManager.schedule(new IntroTask(world, 0), 600000);
+ ThreadPool.schedule(new IntroTask(world, 0), 600000);
break;
}
case 3: // first morph
@@ -641,7 +641,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
}
handleReenterTime(world);
world.activeScarlet.doCast(FIRST_MORPH_SKILL.getSkill());
- ThreadPoolManager.schedule(new SongTask(world, 2), 1500);
+ ThreadPool.schedule(new SongTask(world, 2), 1500);
break;
}
case 4: // second morph
@@ -653,8 +653,8 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
world.songEffectTask.cancel(false);
}
world.songEffectTask = null;
- ThreadPoolManager.schedule(new IntroTask(world, 23), 2000);
- ThreadPoolManager.schedule(new IntroTask(world, 24), 2100);
+ ThreadPool.schedule(new IntroTask(world, 23), 2000);
+ ThreadPool.schedule(new IntroTask(world, 24), 2100);
break;
}
case 5: // raid success
@@ -671,7 +671,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
}
world.songTask = null;
world.songEffectTask = null;
- ThreadPoolManager.schedule(new IntroTask(world, 33), 500);
+ ThreadPool.schedule(new IntroTask(world, 33), 500);
break;
}
case 6: // open doors
@@ -759,7 +759,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
updateKnownList(_world, demon);
_world.demons.add(demon);
}
- ThreadPoolManager.schedule(new DemonSpawnTask(_world), TIME_BETWEEN_DEMON_SPAWNS);
+ ThreadPool.schedule(new DemonSpawnTask(_world), TIME_BETWEEN_DEMON_SPAWNS);
}
}
@@ -803,7 +803,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
{
if (_world.isVideo)
{
- _world.songTask = ThreadPoolManager.schedule(new SongTask(_world, 0), 1000);
+ _world.songTask = ThreadPool.schedule(new SongTask(_world, 0), 1000);
}
else if ((_world.frintezza != null) && !_world.frintezza.isDead())
{
@@ -817,15 +817,15 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
_world.OnSong = element;
broadCastPacket(_world, new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 4000, false, null, element.songName, null));
broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, element.skill.getSkillId(), element.skill.getSkillLvl(), element.skill.getSkill().getHitTime(), 0));
- _world.songEffectTask = ThreadPoolManager.schedule(new SongTask(_world, 1), element.skill.getSkill().getHitTime() - 10000);
- _world.songTask = ThreadPoolManager.schedule(new SongTask(_world, 0), element.skill.getSkill().getHitTime());
+ _world.songEffectTask = ThreadPool.schedule(new SongTask(_world, 1), element.skill.getSkill().getHitTime() - 10000);
+ _world.songTask = ThreadPool.schedule(new SongTask(_world, 0), element.skill.getSkill().getHitTime());
break;
}
}
}
else
{
- ThreadPoolManager.schedule(new SoulBreakingArrow(_world.frintezza), 35000);
+ ThreadPool.schedule(new SoulBreakingArrow(_world.frintezza), 35000);
}
}
break;
@@ -898,8 +898,8 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
{
case 0:
{
- ThreadPoolManager.schedule(new IntroTask(_world, 1), 27000);
- ThreadPoolManager.schedule(new IntroTask(_world, 2), 30000);
+ ThreadPool.schedule(new IntroTask(_world, 1), 27000);
+ ThreadPool.schedule(new IntroTask(_world, 2), 30000);
broadCastPacket(_world, new Earthquake(-87784, -155083, -9087, 45, 27));
break;
}
@@ -943,7 +943,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
_world.scarletDummy.setIsInvul(true);
_world.scarletDummy.setIsImmobilized(true);
stopPc();
- ThreadPoolManager.schedule(new IntroTask(_world, 3), 1000);
+ ThreadPool.schedule(new IntroTask(_world, 3), 1000);
break;
}
case 3:
@@ -964,46 +964,46 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
updateKnownList(_world, demon);
_world.demons.add(demon);
}
- ThreadPoolManager.schedule(new IntroTask(_world, 4), 6500);
+ ThreadPool.schedule(new IntroTask(_world, 4), 6500);
break;
}
case 4:
{
broadCastPacket(_world, new SpecialCamera(_world.frintezzaDummy, 1800, 90, 8, 6500, 7000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 5), 900);
+ ThreadPool.schedule(new IntroTask(_world, 5), 900);
break;
}
case 5:
{
broadCastPacket(_world, new SpecialCamera(_world.frintezzaDummy, 140, 90, 10, 2500, 4500, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 6), 4000);
+ ThreadPool.schedule(new IntroTask(_world, 6), 4000);
break;
}
case 6:
{
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 40, 75, -10, 0, 1000, 0, 0, 1, 0, 0));
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 40, 75, -10, 0, 12000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 7), 1350);
+ ThreadPool.schedule(new IntroTask(_world, 7), 1350);
break;
}
case 7:
{
broadCastPacket(_world, new SocialAction(_world.frintezza.getObjectId(), 2));
- ThreadPoolManager.schedule(new IntroTask(_world, 8), 7000);
+ ThreadPool.schedule(new IntroTask(_world, 8), 7000);
break;
}
case 8:
{
_world.frintezzaDummy.deleteMe();
_world.frintezzaDummy = null;
- ThreadPoolManager.schedule(new IntroTask(_world, 9), 1000);
+ ThreadPool.schedule(new IntroTask(_world, 9), 1000);
break;
}
case 9:
{
broadCastPacket(_world, new SocialAction(_world.demons.get(1).getObjectId(), 1));
broadCastPacket(_world, new SocialAction(_world.demons.get(2).getObjectId(), 1));
- ThreadPoolManager.schedule(new IntroTask(_world, 10), 400);
+ ThreadPool.schedule(new IntroTask(_world, 10), 400);
break;
}
case 10:
@@ -1012,7 +1012,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
broadCastPacket(_world, new SocialAction(_world.demons.get(3).getObjectId(), 1));
sendPacketX(new SpecialCamera(_world.portraitDummy1, 1000, 118, 0, 0, 1000, 0, 0, 1, 0, 0), new SpecialCamera(_world.portraitDummy3, 1000, 62, 0, 0, 1000, 0, 0, 1, 0, 0), -87784);
sendPacketX(new SpecialCamera(_world.portraitDummy1, 1000, 118, 0, 0, 10000, 0, 0, 1, 0, 0), new SpecialCamera(_world.portraitDummy3, 1000, 62, 0, 0, 10000, 0, 0, 1, 0, 0), -87784);
- ThreadPoolManager.schedule(new IntroTask(_world, 11), 2000);
+ ThreadPool.schedule(new IntroTask(_world, 11), 2000);
break;
}
case 11:
@@ -1024,19 +1024,19 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
_world.portraitDummy3.deleteMe();
_world.portraitDummy1 = null;
_world.portraitDummy3 = null;
- ThreadPoolManager.schedule(new IntroTask(_world, 12), 4500);
+ ThreadPool.schedule(new IntroTask(_world, 12), 4500);
break;
}
case 12:
{
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 100, 195, 35, 0, 10000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 13), 700);
+ ThreadPool.schedule(new IntroTask(_world, 13), 700);
break;
}
case 13:
{
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 100, 195, 35, 0, 10000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 14), 1300);
+ ThreadPool.schedule(new IntroTask(_world, 14), 1300);
break;
}
case 14:
@@ -1044,19 +1044,19 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
broadCastPacket(_world, new ExShowScreenMessage(NpcStringId.MOURNFUL_CHORALE_PRELUDE, 2, 5000));
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 120, 180, 45, 1500, 10000, 0, 0, 1, 0, 0));
broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, 5006, 1, 34000, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 15), 1500);
+ ThreadPool.schedule(new IntroTask(_world, 15), 1500);
break;
}
case 15:
{
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 520, 135, 45, 8000, 10000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 16), 7500);
+ ThreadPool.schedule(new IntroTask(_world, 16), 7500);
break;
}
case 16:
{
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 1500, 110, 25, 10000, 13000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 17), 9500);
+ ThreadPool.schedule(new IntroTask(_world, 17), 9500);
break;
}
case 17:
@@ -1064,7 +1064,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
broadCastPacket(_world, new SpecialCamera(_world.overheadDummy, 930, 160, -20, 0, 1000, 0, 0, 1, 0, 0));
broadCastPacket(_world, new SpecialCamera(_world.overheadDummy, 600, 180, -25, 0, 10000, 0, 0, 1, 0, 0));
broadCastPacket(_world, new MagicSkillUse(_world.scarletDummy, _world.overheadDummy, 5004, 1, 5800, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 18), 5000);
+ ThreadPool.schedule(new IntroTask(_world, 18), 5000);
break;
}
case 18:
@@ -1077,20 +1077,20 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
updateKnownList(_world, _world.activeScarlet);
broadCastPacket(_world, new SocialAction(_world.activeScarlet.getObjectId(), 3));
broadCastPacket(_world, new SpecialCamera(_world.scarletDummy, 800, 180, 10, 1000, 10000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 19), 2100);
+ ThreadPool.schedule(new IntroTask(_world, 19), 2100);
break;
}
case 19:
{
broadCastPacket(_world, new SpecialCamera(_world.activeScarlet, 300, 60, 8, 0, 10000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 20), 2000);
+ ThreadPool.schedule(new IntroTask(_world, 20), 2000);
break;
}
case 20:
{
broadCastPacket(_world, new SpecialCamera(_world.activeScarlet, 500, 90, 10, 3000, 5000, 0, 0, 1, 0, 0));
- _world.songTask = ThreadPoolManager.schedule(new SongTask(_world, 0), 100);
- ThreadPoolManager.schedule(new IntroTask(_world, 21), 3000);
+ _world.songTask = ThreadPool.schedule(new SongTask(_world, 0), 100);
+ ThreadPool.schedule(new IntroTask(_world, 21), 3000);
break;
}
case 21:
@@ -1105,7 +1105,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
_world.scarletDummy.deleteMe();
_world.overheadDummy = null;
_world.scarletDummy = null;
- ThreadPoolManager.schedule(new IntroTask(_world, 22), 2000);
+ ThreadPool.schedule(new IntroTask(_world, 22), 2000);
break;
}
case 22:
@@ -1124,7 +1124,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
_world.frintezza.disableCoreAI(true);
_world.frintezza.setIsMortal(false);
startPc();
- ThreadPoolManager.schedule(new DemonSpawnTask(_world), TIME_BETWEEN_DEMON_SPAWNS);
+ ThreadPool.schedule(new DemonSpawnTask(_world), TIME_BETWEEN_DEMON_SPAWNS);
break;
}
case 23:
@@ -1142,20 +1142,20 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
_world.activeScarlet.setIsInvul(true);
_world.activeScarlet.setIsImmobilized(true);
_world.activeScarlet.disableAllSkills();
- ThreadPoolManager.schedule(new IntroTask(_world, 25), 7000);
+ ThreadPool.schedule(new IntroTask(_world, 25), 7000);
break;
}
case 25:
{
broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, 5006, 1, 34000, 0));
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 500, 70, 15, 3000, 10000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 26), 3000);
+ ThreadPool.schedule(new IntroTask(_world, 26), 3000);
break;
}
case 26:
{
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 2500, 90, 12, 6000, 10000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 27), 3000);
+ ThreadPool.schedule(new IntroTask(_world, 27), 3000);
break;
}
case 27:
@@ -1174,15 +1174,15 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
}
broadCastPacket(_world, new SpecialCamera(_world.activeScarlet, 250, _world.scarlet_a, 12, 0, 1000, 0, 0, 1, 0, 0));
broadCastPacket(_world, new SpecialCamera(_world.activeScarlet, 250, _world.scarlet_a, 12, 0, 10000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 28), 500);
+ ThreadPool.schedule(new IntroTask(_world, 28), 500);
break;
}
case 28:
{
_world.activeScarlet.doDie(_world.activeScarlet);
broadCastPacket(_world, new SpecialCamera(_world.activeScarlet, 450, _world.scarlet_a, 14, 8000, 8000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 29), 6250);
- ThreadPoolManager.schedule(new IntroTask(_world, 30), 7200);
+ ThreadPool.schedule(new IntroTask(_world, 29), 6250);
+ ThreadPool.schedule(new IntroTask(_world, 30), 7200);
break;
}
case 29:
@@ -1199,13 +1199,13 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
_world.activeScarlet.disableAllSkills();
updateKnownList(_world, _world.activeScarlet);
broadCastPacket(_world, new SpecialCamera(_world.activeScarlet, 450, _world.scarlet_a, 12, 500, 14000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 31), 8100);
+ ThreadPool.schedule(new IntroTask(_world, 31), 8100);
break;
}
case 31:
{
broadCastPacket(_world, new SocialAction(_world.activeScarlet.getObjectId(), 2));
- ThreadPoolManager.schedule(new IntroTask(_world, 32), 9000);
+ ThreadPool.schedule(new IntroTask(_world, 32), 9000);
break;
}
case 32:
@@ -1221,8 +1221,8 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
{
broadCastPacket(_world, new SpecialCamera(_world.activeScarlet, 300, _world.scarlet_a - 180, 5, 0, 7000, 0, 0, 1, 0, 0));
broadCastPacket(_world, new SpecialCamera(_world.activeScarlet, 200, _world.scarlet_a, 85, 4000, 10000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 34), 7400);
- ThreadPoolManager.schedule(new IntroTask(_world, 35), 7500);
+ ThreadPool.schedule(new IntroTask(_world, 34), 7400);
+ ThreadPool.schedule(new IntroTask(_world, 35), 7500);
break;
}
case 34:
@@ -1234,13 +1234,13 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
{
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 100, 120, 5, 0, 7000, 0, 0, 1, 0, 0));
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 100, 90, 5, 5000, 15000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 36), 7000);
+ ThreadPool.schedule(new IntroTask(_world, 36), 7000);
break;
}
case 36:
{
broadCastPacket(_world, new SpecialCamera(_world.frintezza, 900, 90, 25, 7000, 10000, 0, 0, 1, 0, 0));
- ThreadPoolManager.schedule(new IntroTask(_world, 37), 9000);
+ ThreadPool.schedule(new IntroTask(_world, 37), 9000);
break;
}
case 37:
@@ -1326,7 +1326,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
{
case 0:
{
- ThreadPoolManager.schedule(new StatusTask(_world, 1), 2000);
+ ThreadPool.schedule(new StatusTask(_world, 1), 2000);
for (int doorId : FIRST_ROOM_DOORS)
{
openDoor(doorId, _world.getInstanceId());
@@ -1340,7 +1340,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
}
case 2:
{
- ThreadPoolManager.schedule(new StatusTask(_world, 3), 100);
+ ThreadPool.schedule(new StatusTask(_world, 3), 100);
for (int doorId : SECOND_ROOM_DOORS)
{
openDoor(doorId, _world.getInstanceId());
@@ -1478,7 +1478,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
final FETWorld world = (FETWorld) tmpworld;
if (npc.getId() == HALL_ALARM)
{
- ThreadPoolManager.schedule(new StatusTask(world, 0), 2000);
+ ThreadPool.schedule(new StatusTask(world, 0), 2000);
if (debug)
{
_log.info("[Final Emperial Tomb] Hall alarm is disabled, doors will open!");
@@ -1489,7 +1489,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
world.darkChoirPlayerCount--;
if (world.darkChoirPlayerCount < 1)
{
- ThreadPoolManager.schedule(new StatusTask(world, 2), 2000);
+ ThreadPool.schedule(new StatusTask(world, 2), 2000);
if (debug)
{
_log.info("[Final Emperial Tomb] All Dark Choir Players are killed, doors will open!");
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java
index 84405b08e1..f34c5371dd 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java
@@ -19,7 +19,7 @@ package quests.Q00511_AwlUnderFoot;
import java.util.HashMap;
import java.util.Map;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Party;
@@ -296,7 +296,7 @@ public final class Q00511_AwlUnderFoot extends Quest
dungeon.setReEnterTime(System.currentTimeMillis() + REENTERTIME);
InstanceManager.getInstance().addWorld(world);
_log.info("Fortress AwlUnderFoot started " + template + " Instance: " + instanceId + " created by player: " + player.getName());
- ThreadPoolManager.schedule(new spawnRaid((FAUWorld) world), RAID_SPAWN_DELAY);
+ ThreadPool.schedule(new spawnRaid((FAUWorld) world), RAID_SPAWN_DELAY);
// teleport players
if (player.getParty() == null)
@@ -398,7 +398,7 @@ public final class Q00511_AwlUnderFoot extends Quest
else
{
world.incStatus();
- ThreadPoolManager.schedule(new spawnRaid(world), RAID_SPAWN_DELAY);
+ ThreadPool.schedule(new spawnRaid(world), RAID_SPAWN_DELAY);
}
}
return null;
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00726_LightWithinTheDarkness/Q00726_LightWithinTheDarkness.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00726_LightWithinTheDarkness/Q00726_LightWithinTheDarkness.java
index 20b86ef6ae..601ed17266 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00726_LightWithinTheDarkness/Q00726_LightWithinTheDarkness.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00726_LightWithinTheDarkness/Q00726_LightWithinTheDarkness.java
@@ -19,7 +19,7 @@ package quests.Q00726_LightWithinTheDarkness;
import java.util.HashMap;
import java.util.Map;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
@@ -281,7 +281,7 @@ public class Q00726_LightWithinTheDarkness extends Quest
world.setStatus(0);
dungeon.setReEnterTime(System.currentTimeMillis() + 14400000);
InstanceManager.getInstance().addWorld(world);
- ThreadPoolManager.schedule(new spawnNpcs((PAWORLD) world), 10000);
+ ThreadPool.schedule(new spawnNpcs((PAWORLD) world), 10000);
for (L2PcInstance partyMember : party.getMembers())
{
@@ -392,7 +392,7 @@ public class Q00726_LightWithinTheDarkness extends Quest
protected void FirstWave(PAWORLD world)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
addSpawn(SEDUCED_KNIGHT, 49384, -12232, -9384, 0, false, 0, false, world.getInstanceId());
addSpawn(SEDUCED_RANGER, 49192, -12232, -9384, 0, false, 0, false, world.getInstanceId());
@@ -404,7 +404,7 @@ public class Q00726_LightWithinTheDarkness extends Quest
{
addSpawn(KANADIS_FOLLOWER1, 50536, -12232, -9384, 32768, false, 0, false, world.getInstanceId());
}
- ThreadPoolManager.schedule(() -> SecondWave(world), 8 * 60 * 1000);
+ ThreadPool.schedule(() -> SecondWave(world), 8 * 60 * 1000);
}, 10000);
}
@@ -416,7 +416,7 @@ public class Q00726_LightWithinTheDarkness extends Quest
{
addSpawn(KANADIS_FOLLOWER2, 50536, -12232, -9384, 32768, false, 0, false, world.getInstanceId());
}
- ThreadPoolManager.schedule(() -> ThirdWave(world), 8 * 60 * 1000);
+ ThreadPool.schedule(() -> ThirdWave(world), 8 * 60 * 1000);
}
protected void ThirdWave(PAWORLD world)
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00727_HopeWithinTheDarkness/Q00727_HopeWithinTheDarkness.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00727_HopeWithinTheDarkness/Q00727_HopeWithinTheDarkness.java
index 20e8634b7d..6902f1bab4 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00727_HopeWithinTheDarkness/Q00727_HopeWithinTheDarkness.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00727_HopeWithinTheDarkness/Q00727_HopeWithinTheDarkness.java
@@ -21,7 +21,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-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.instancemanager.FortManager;
@@ -477,7 +477,7 @@ public class Q00727_HopeWithinTheDarkness extends Quest
// Destroy instance after 5 minutes
inst.setDuration(5 * 60000);
inst.setEmptyDestroyTime(0);
- ThreadPoolManager.schedule(new completeDungeon(world, player), 1500);
+ ThreadPool.schedule(new completeDungeon(world, player), 1500);
}
}
}
@@ -634,7 +634,7 @@ public class Q00727_HopeWithinTheDarkness extends Quest
world.setStatus(0);
dungeon.setReEnterTime(System.currentTimeMillis() + REENTER_INTERVAL);
InstanceManager.getInstance().addWorld(world);
- ThreadPoolManager.schedule(new spawnNpcs((CAUWorld) world), INITIAL_SPAWN_DELAY);
+ ThreadPool.schedule(new spawnNpcs((CAUWorld) world), INITIAL_SPAWN_DELAY);
if (DEBUG)
{
_log.info("Castle HopeWithinTheDarkness started " + template + " Instance: " + instanceId + " created by player: " + player.getName());
@@ -681,21 +681,21 @@ public class Q00727_HopeWithinTheDarkness extends Quest
_instance.spawnGroup("victims");
_instance.spawnGroup("bosses_1");
- ThreadPoolManager.schedule(new spawnNpcs(_world), WAVE_SPAWN_DELAY);
- ThreadPoolManager.schedule(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
+ ThreadPool.schedule(new spawnNpcs(_world), WAVE_SPAWN_DELAY);
+ ThreadPool.schedule(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
}
else if (_world.getStatus() == 1)
{
_instance.spawnGroup("bosses_2");
- ThreadPoolManager.schedule(new spawnNpcs(_world), WAVE_SPAWN_DELAY);
- ThreadPoolManager.schedule(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
+ ThreadPool.schedule(new spawnNpcs(_world), WAVE_SPAWN_DELAY);
+ ThreadPool.schedule(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
}
else if (_world.getStatus() == 2)
{
_instance.spawnGroup("bosses_3");
- ThreadPoolManager.schedule(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
+ ThreadPool.schedule(new spawnPrivates(_world), PRIVATE_SPAWN_DELAY);
}
}
catch (Exception e)
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatGiranTalking.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatGiranTalking.java
index d3f180bd32..8a49c493c1 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatGiranTalking.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatGiranTalking.java
@@ -19,7 +19,7 @@ package vehicles;
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.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -162,19 +162,19 @@ public class BoatGiranTalking implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(GIRAN_DOCK, TALKING_DOCK[0], LEAVE_GIRAN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(GIRAN_DOCK, TALKING_DOCK[0], LEAVE_GIRAN1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(GIRAN_DOCK, TALKING_DOCK[0], LEAVE_GIRAN0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -183,19 +183,19 @@ public class BoatGiranTalking implements Runnable
_boat.broadcastPacket(GIRAN_SOUND);
_boat.payForRide(3946, 1, 46763, 187041, -3451);
_boat.executePath(GIRAN_TO_TALKING);
- ThreadPoolManager.schedule(this, 250000);
+ ThreadPool.schedule(this, 250000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GIRAN_DOCK, ARRIVAL_TALKING10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GIRAN_DOCK, ARRIVAL_TALKING5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 6:
@@ -216,7 +216,7 @@ public class BoatGiranTalking implements Runnable
{
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(TALKING_DOCK);
@@ -227,25 +227,25 @@ public class BoatGiranTalking implements Runnable
BoatManager.getInstance().dockShip(BoatManager.TALKING_ISLAND, true);
BoatManager.getInstance().broadcastPackets(TALKING_DOCK[0], GIRAN_DOCK, ARRIVED_AT_TALKING, ARRIVED_AT_TALKING_2);
_boat.broadcastPacket(TALKING_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 9:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GIRAN_DOCK, LEAVE_TALKING5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 10:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GIRAN_DOCK, LEAVE_TALKING1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 11:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GIRAN_DOCK, LEAVE_TALKING0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 12:
@@ -255,31 +255,31 @@ public class BoatGiranTalking implements Runnable
_boat.broadcastPacket(TALKING_SOUND);
_boat.payForRide(3945, 1, -96777, 258970, -3623);
_boat.executePath(TALKING_TO_GIRAN);
- ThreadPoolManager.schedule(this, 200000);
+ ThreadPool.schedule(this, 200000);
break;
}
case 13:
{
BoatManager.getInstance().broadcastPacket(GIRAN_DOCK, TALKING_DOCK[0], ARRIVAL_GIRAN20);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 14:
{
BoatManager.getInstance().broadcastPacket(GIRAN_DOCK, TALKING_DOCK[0], ARRIVAL_GIRAN15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 15:
{
BoatManager.getInstance().broadcastPacket(GIRAN_DOCK, TALKING_DOCK[0], ARRIVAL_GIRAN10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 16:
{
BoatManager.getInstance().broadcastPacket(GIRAN_DOCK, TALKING_DOCK[0], ARRIVAL_GIRAN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 17:
@@ -291,7 +291,7 @@ public class BoatGiranTalking implements Runnable
{
BoatManager.getInstance().broadcastPackets(GIRAN_DOCK, TALKING_DOCK[0], ARRIVED_AT_GIRAN, ARRIVED_AT_GIRAN_2);
_boat.broadcastPacket(GIRAN_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatGludinRune.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatGludinRune.java
index d6f757bb05..b1eaafd9d1 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatGludinRune.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatGludinRune.java
@@ -19,7 +19,7 @@ package vehicles;
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.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -177,19 +177,19 @@ public class BoatGludinRune implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], LEAVE_GLUDIN0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -199,25 +199,25 @@ public class BoatGludinRune implements Runnable
_boat.broadcastPacket(GLUDIN_SOUND);
_boat.payForRide(7905, 1, -90015, 150422, -3610);
_boat.executePath(GLUDIN_TO_RUNE);
- ThreadPoolManager.schedule(this, 250000);
+ ThreadPool.schedule(this, 250000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 6:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_RUNE5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 7:
@@ -238,7 +238,7 @@ public class BoatGludinRune implements Runnable
{
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(RUNE_DOCK);
@@ -249,25 +249,25 @@ public class BoatGludinRune implements Runnable
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], GLUDIN_DOCK[0], ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2);
_boat.broadcastPacket(RUNE_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 10:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 11:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 12:
{
BoatManager.getInstance().broadcastPacket(RUNE_DOCK[0], GLUDIN_DOCK[0], LEAVE_RUNE0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 13:
@@ -277,25 +277,25 @@ public class BoatGludinRune implements Runnable
_boat.broadcastPacket(RUNE_SOUND);
_boat.payForRide(7904, 1, 34513, -38009, -3640);
_boat.executePath(RUNE_TO_GLUDIN);
- ThreadPoolManager.schedule(this, 60000);
+ ThreadPool.schedule(this, 60000);
break;
}
case 14:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 15:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 16:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVAL_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 17:
@@ -316,7 +316,7 @@ public class BoatGludinRune implements Runnable
{
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(GLUDIN_DOCK);
@@ -327,7 +327,7 @@ public class BoatGludinRune implements Runnable
BoatManager.getInstance().dockShip(BoatManager.GLUDIN_HARBOR, true);
BoatManager.getInstance().broadcastPackets(GLUDIN_DOCK[0], RUNE_DOCK[0], ARRIVED_AT_GLUDIN, ARRIVED_AT_GLUDIN_2);
_boat.broadcastPacket(GLUDIN_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatInnadrilTour.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
index 921d14083d..32e220cf58 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatInnadrilTour.java
@@ -19,7 +19,7 @@ package vehicles;
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.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -120,19 +120,19 @@ public class BoatInnadrilTour implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL1);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, LEAVE_INNADRIL0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -140,31 +140,31 @@ public class BoatInnadrilTour implements Runnable
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, LEAVING_INNADRIL, INNADRIL_SOUND);
_boat.payForRide(0, 1, 107092, 219098, -3952);
_boat.executePath(TOUR);
- ThreadPoolManager.schedule(this, 650000);
+ ThreadPool.schedule(this, 650000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL20);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL15);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 6:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 7:
{
BoatManager.getInstance().broadcastPacket(DOCK, DOCK, ARRIVAL5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 8:
@@ -175,7 +175,7 @@ public class BoatInnadrilTour implements Runnable
case 9:
{
BoatManager.getInstance().broadcastPackets(DOCK, DOCK, ARRIVED_AT_INNADRIL, INNADRIL_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatRunePrimeval.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
index f2ee7d1348..601427d03e 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatRunePrimeval.java
@@ -19,7 +19,7 @@ package vehicles;
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.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -121,7 +121,7 @@ public class BoatRunePrimeval implements Runnable
case 1:
{
BoatManager.getInstance().broadcastPackets(PRIMEVAL_DOCK, RUNE_DOCK[0], ARRIVED_AT_PRIMEVAL, ARRIVED_AT_PRIMEVAL_2, PRIMEVAL_SOUND);
- ThreadPoolManager.schedule(this, 180000);
+ ThreadPool.schedule(this, 180000);
break;
}
case 2:
@@ -144,7 +144,7 @@ public class BoatRunePrimeval implements Runnable
{
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(RUNE_DOCK);
@@ -154,7 +154,7 @@ public class BoatRunePrimeval implements Runnable
{
BoatManager.getInstance().dockShip(BoatManager.RUNE_HARBOR, true);
BoatManager.getInstance().broadcastPackets(RUNE_DOCK[0], PRIMEVAL_DOCK, ARRIVED_AT_RUNE, ARRIVED_AT_RUNE_2, RUNE_SOUND);
- ThreadPoolManager.schedule(this, 180000);
+ ThreadPool.schedule(this, 180000);
break;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatTalkingGludin.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatTalkingGludin.java
index db0af79cbb..3881804617 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatTalkingGludin.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/vehicles/BoatTalkingGludin.java
@@ -19,7 +19,7 @@ package vehicles;
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.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.BoatManager;
import com.l2jmobius.gameserver.model.VehiclePathPoint;
@@ -146,19 +146,19 @@ public class BoatTalkingGludin implements Runnable
case 0:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GLUDIN_DOCK[0], LEAVE_TALKING5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 1:
{
BoatManager.getInstance().broadcastPackets(TALKING_DOCK[0], GLUDIN_DOCK[0], LEAVE_TALKING1, LEAVE_TALKING1_2);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 2:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GLUDIN_DOCK[0], LEAVE_TALKING0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 3:
@@ -168,19 +168,19 @@ public class BoatTalkingGludin implements Runnable
_boat.broadcastPacket(TALKING_SOUND);
_boat.payForRide(1074, 1, -96777, 258970, -3623);
_boat.executePath(TALKING_TO_GLUDIN);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 4:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], TALKING_DOCK[0], ARRIVAL_GLUDIN10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 5:
{
BoatManager.getInstance().broadcastPacket(GLUDIN_DOCK[0], TALKING_DOCK[0], ARRIVAL_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 6:
@@ -201,7 +201,7 @@ public class BoatTalkingGludin implements Runnable
{
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(GLUDIN_DOCK);
@@ -212,25 +212,25 @@ public class BoatTalkingGludin implements Runnable
BoatManager.getInstance().dockShip(BoatManager.GLUDIN_HARBOR, true);
BoatManager.getInstance().broadcastPackets(GLUDIN_DOCK[0], TALKING_DOCK[0], ARRIVED_AT_GLUDIN, ARRIVED_AT_GLUDIN_2);
_boat.broadcastPacket(GLUDIN_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 9:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GLUDIN_DOCK[0], LEAVE_GLUDIN5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 10:
{
BoatManager.getInstance().broadcastPackets(TALKING_DOCK[0], GLUDIN_DOCK[0], LEAVE_GLUDIN1, LEAVE_TALKING1_2);
- ThreadPoolManager.schedule(this, 40000);
+ ThreadPool.schedule(this, 40000);
break;
}
case 11:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GLUDIN_DOCK[0], LEAVE_GLUDIN0);
- ThreadPoolManager.schedule(this, 20000);
+ ThreadPool.schedule(this, 20000);
break;
}
case 12:
@@ -240,19 +240,19 @@ public class BoatTalkingGludin implements Runnable
_boat.broadcastPacket(GLUDIN_SOUND);
_boat.payForRide(1075, 1, -90015, 150422, -3610);
_boat.executePath(GLUDIN_TO_TALKING);
- ThreadPoolManager.schedule(this, 150000);
+ ThreadPool.schedule(this, 150000);
break;
}
case 13:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_TALKING10);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
case 14:
{
BoatManager.getInstance().broadcastPacket(TALKING_DOCK[0], GLUDIN_DOCK[0], ARRIVAL_TALKING5);
- ThreadPoolManager.schedule(this, 240000);
+ ThreadPool.schedule(this, 240000);
break;
}
case 15:
@@ -273,7 +273,7 @@ public class BoatTalkingGludin implements Runnable
{
_shoutCount = 0;
}
- ThreadPoolManager.schedule(this, 5000);
+ ThreadPool.schedule(this, 5000);
return;
}
_boat.executePath(TALKING_DOCK);
@@ -284,7 +284,7 @@ public class BoatTalkingGludin implements Runnable
BoatManager.getInstance().dockShip(BoatManager.TALKING_ISLAND, true);
BoatManager.getInstance().broadcastPackets(TALKING_DOCK[0], GLUDIN_DOCK[0], ARRIVED_AT_TALKING, ARRIVED_AT_TALKING_2);
_boat.broadcastPacket(TALKING_SOUND);
- ThreadPoolManager.schedule(this, 300000);
+ ThreadPool.schedule(this, 300000);
break;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/commons/concurrent/ThreadPool.java
new file mode 100644
index 0000000000..f0c939222b
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/commons/concurrent/ThreadPool.java
@@ -0,0 +1,299 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.commons.concurrent;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Logger;
+
+import com.l2jmobius.Config;
+
+/**
+ * This class handles thread pooling system. It relies on two ThreadPoolExecutor arrays, which poolers number is generated using config.
+ *
+ * Those arrays hold following pools :
+ *
+ *
+ * - Scheduled pool keeps a track about incoming, future events.
+ * - Instant pool handles short-life events.
+ *
+ */
+public final class ThreadPool
+{
+ 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;
+
+ private static int _threadPoolRandomizer;
+
+ protected static ScheduledThreadPoolExecutor[] _scheduledPools;
+ protected static ThreadPoolExecutor[] _instantPools;
+
+ /**
+ * Init the different pools, based on Config. It is launched only once, on Gameserver instance.
+ */
+ public static void init()
+ {
+ // Feed scheduled pool.
+ int poolCount = Config.SCHEDULED_THREAD_POOL_COUNT;
+ if (poolCount == -1)
+ {
+ poolCount = Runtime.getRuntime().availableProcessors();
+ }
+
+ _scheduledPools = new ScheduledThreadPoolExecutor[poolCount];
+ for (int i = 0; i < poolCount; i++)
+ {
+ _scheduledPools[i] = new ScheduledThreadPoolExecutor(Config.THREADS_PER_SCHEDULED_THREAD_POOL);
+ }
+
+ // Feed instant pool.
+ poolCount = Config.INSTANT_THREAD_POOL_COUNT;
+ if (poolCount == -1)
+ {
+ poolCount = Runtime.getRuntime().availableProcessors();
+ }
+
+ _instantPools = new ThreadPoolExecutor[poolCount];
+ for (int i = 0; i < poolCount; i++)
+ {
+ _instantPools[i] = new ThreadPoolExecutor(Config.THREADS_PER_INSTANT_THREAD_POOL, Config.THREADS_PER_INSTANT_THREAD_POOL, 0, TimeUnit.SECONDS, new ArrayBlockingQueue(100000));
+ }
+
+ // Prestart core threads.
+ for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
+ {
+ threadPool.prestartAllCoreThreads();
+ }
+
+ for (ThreadPoolExecutor threadPool : _instantPools)
+ {
+ threadPool.prestartAllCoreThreads();
+ }
+
+ // Launch purge task.
+ scheduleAtFixedRate(() ->
+ {
+ purge();
+ }, 600000, 600000);
+
+ LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_instantPools) + "/" + getMaximumPoolSize(_instantPools) + " instant thread(s).");
+ LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_scheduledPools) + "/" + getMaximumPoolSize(_scheduledPools) + " scheduled thread(s).");
+ }
+
+ public static void purge()
+ {
+ for (ScheduledThreadPoolExecutor threadPool1 : _scheduledPools)
+ {
+ threadPool1.purge();
+ }
+ for (ThreadPoolExecutor threadPool2 : _instantPools)
+ {
+ threadPool2.purge();
+ }
+ }
+
+ /**
+ * Schedules a one-shot action that becomes enabled after a delay. The pool is chosen based on pools activity.
+ * @param r : the task to execute.
+ * @param delay : the time from now to delay execution.
+ * @return a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion.
+ */
+ public static ScheduledFuture> schedule(Runnable r, long delay)
+ {
+ try
+ {
+ return getPool(_scheduledPools).schedule(new TaskWrapper(r), validate(delay), TimeUnit.MILLISECONDS);
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Schedules a periodic action that becomes enabled after a delay. The pool is chosen based on pools activity.
+ * @param r : the task to execute.
+ * @param delay : the time from now to delay execution.
+ * @param period : the period between successive executions.
+ * @return a ScheduledFuture representing pending completion of the task and whose get() method will throw an exception upon cancellation.
+ */
+ public static ScheduledFuture> scheduleAtFixedRate(Runnable r, long delay, long period)
+ {
+ try
+ {
+ return getPool(_scheduledPools).scheduleAtFixedRate(new TaskWrapper(r), validate(delay), validate(period), TimeUnit.MILLISECONDS);
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Executes the given task sometime in the future.
+ * @param r : the task to execute.
+ */
+ public static void execute(Runnable r)
+ {
+ try
+ {
+ getPool(_instantPools).execute(new TaskWrapper(r));
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ public static String[] getStats()
+ {
+ List stats = new ArrayList<>();
+ for (int i = 0; i < _scheduledPools.length; i++)
+ {
+ final ScheduledThreadPoolExecutor threadPool = _scheduledPools[i];
+ stats.add("Scheduled pool #" + i + ":");
+ stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
+ stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
+ stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
+ stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
+ stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
+ stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
+ stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
+ stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
+ stats.add(" | -------");
+ }
+ for (int i = 0; i < _instantPools.length; i++)
+ {
+ final ThreadPoolExecutor threadPool = _instantPools[i];
+ stats.add("Scheduled pool #" + i + ":");
+ stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
+ stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
+ stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
+ stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
+ stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
+ stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
+ stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
+ stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
+ stats.add(" | -------");
+ }
+ return stats.toArray(new String[stats.size()]);
+ }
+
+ /**
+ * Shutdown thread pooling system correctly. Send different informations.
+ */
+ public static void shutdown()
+ {
+ try
+ {
+ LOG.info("ThreadPoolManager: Shutting down.");
+
+ for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
+ {
+ threadPool.shutdownNow();
+ }
+
+ for (ThreadPoolExecutor threadPool : _instantPools)
+ {
+ threadPool.shutdownNow();
+ }
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ }
+ }
+
+ /**
+ * @param : The pool type.
+ * @param threadPools : The pool array to check.
+ * @return the less fed pool.
+ */
+ private static T getPool(T[] threadPools)
+ {
+ return threadPools[_threadPoolRandomizer++ % threadPools.length];
+ }
+
+ /**
+ * @param delay : The delay to validate.
+ * @return a secured value, from 0 to MAX_DELAY.
+ */
+ private static long validate(long delay)
+ {
+ return Math.max(0, Math.min(MAX_DELAY, delay));
+ }
+
+ /**
+ * @param threadPools : The pool array to check.
+ * @return the overall actual pools size.
+ */
+ private static long getPoolSize(ThreadPoolExecutor[] threadPools)
+ {
+ long result = 0;
+
+ for (ThreadPoolExecutor threadPool : threadPools)
+ {
+ result += threadPool.getPoolSize();
+ }
+
+ return result;
+ }
+
+ /**
+ * @param threadPools : The pool array to check.
+ * @return the overall maximum pools size.
+ */
+ private static long getMaximumPoolSize(ThreadPoolExecutor[] threadPools)
+ {
+ long result = 0;
+
+ for (ThreadPoolExecutor threadPool : threadPools)
+ {
+ result += threadPool.getMaximumPoolSize();
+ }
+
+ return result;
+ }
+
+ public static final class TaskWrapper implements Runnable
+ {
+ private final Runnable _runnable;
+
+ public TaskWrapper(Runnable runnable)
+ {
+ _runnable = runnable;
+ }
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ _runnable.run();
+ }
+ catch (RuntimeException e)
+ {
+ LOG.warning("Exception in " + _runnable.getClass().getName() + " execution: " + e.getMessage());
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameServer.java
index 0ad4f9fccc..5545dd5efa 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameServer.java
@@ -30,6 +30,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.mmocore.SelectorConfig;
import com.l2jmobius.commons.mmocore.SelectorThread;
@@ -167,7 +168,7 @@ public final class GameServer
}
printSection("ThreadPool");
- ThreadPoolManager.init();
+ ThreadPool.init();
EventDispatcher.getInstance();
new File("log/game").mkdirs();
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameTimeController.java
index 2fad388241..75200941af 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameTimeController.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.DayNightSpawnManager;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -143,7 +144,7 @@ public final class GameTimeController extends Thread
if (isNight)
{
- ThreadPoolManager.execute(() -> DayNightSpawnManager.getInstance().notifyChangeMode());
+ ThreadPool.execute(() -> DayNightSpawnManager.getInstance().notifyChangeMode());
}
while (true)
@@ -175,7 +176,7 @@ public final class GameTimeController extends Thread
{
isNight = !isNight;
- ThreadPoolManager.execute(() -> DayNightSpawnManager.getInstance().notifyChangeMode());
+ ThreadPool.execute(() -> DayNightSpawnManager.getInstance().notifyChangeMode());
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
index 5f005acd01..bc20eab10a 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
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.L2World;
@@ -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()
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/RecipeController.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/RecipeController.java
index ac95cd36e9..b44ad2bf57 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/RecipeController.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/RecipeController.java
@@ -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.gameserver.data.xml.impl.RecipeData;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.enums.StatType;
@@ -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
{
@@ -353,7 +354,7 @@ public class RecipeController
_player.broadcastPacket(msk);
_player.sendPacket(new SetupGauge(0, _delay));
- ThreadPoolManager.schedule(this, 100 + _delay);
+ ThreadPool.schedule(this, 100 + _delay);
}
else
{
@@ -536,7 +537,7 @@ public class RecipeController
if (Config.ALT_GAME_CREATION && isWait)
{
_player.sendPacket(new SetupGauge(0, _delay));
- ThreadPoolManager.schedule(this, 100 + _delay);
+ ThreadPool.schedule(this, 100 + _delay);
}
else
{
@@ -558,7 +559,7 @@ public class RecipeController
if (Config.ALT_GAME_CREATION && isWait)
{
_player.sendPacket(new SetupGauge(0, _delay));
- ThreadPoolManager.schedule(this, 100 + _delay);
+ ThreadPool.schedule(this, 100 + _delay);
}
else
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSigns.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSigns.java
index 8e06dd2ffa..0ca6190ab3 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSigns.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSigns.java
@@ -30,6 +30,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.instancemanager.CastleManager;
import com.l2jmobius.gameserver.model.AutoSpawnHandler;
@@ -186,7 +187,7 @@ public class SevenSigns
// Schedule a time for the next period change.
final SevenSignsPeriodChange sspc = new SevenSignsPeriodChange();
- ThreadPoolManager.schedule(sspc, milliToChange);
+ ThreadPool.schedule(sspc, milliToChange);
// Thanks to http://rainbow.arch.scriptmania.com/scripts/timezone_countdown.html for help with this.
final double numSecs = (milliToChange / 1000) % 60;
@@ -1625,7 +1626,7 @@ public class SevenSigns
setCalendarForNextPeriodChange();
final SevenSignsPeriodChange sspc = new SevenSignsPeriodChange();
- ThreadPoolManager.schedule(sspc, getMilliToPeriodChange());
+ ThreadPool.schedule(sspc, getMilliToPeriodChange());
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSignsFestival.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSignsFestival.java
index 9ace9471fe..a2cd25451f 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSignsFestival.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/SevenSignsFestival.java
@@ -31,6 +31,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.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
@@ -930,7 +931,7 @@ public class SevenSignsFestival implements SpawnListener
// at the specified time, then invoke it automatically after every cycle.
_managerInstance = new FestivalManager();
setNextFestivalStart(Config.ALT_FESTIVAL_MANAGER_START + FESTIVAL_SIGNUP_TIME);
- _managerScheduledTask = ThreadPoolManager.scheduleAtFixedRate(_managerInstance, Config.ALT_FESTIVAL_MANAGER_START, Config.ALT_FESTIVAL_CYCLE_LENGTH);
+ _managerScheduledTask = ThreadPool.scheduleAtFixedRate(_managerInstance, Config.ALT_FESTIVAL_MANAGER_START, Config.ALT_FESTIVAL_CYCLE_LENGTH);
_log.info("SevenSignsFestival: The first Festival of Darkness cycle begins in " + (Config.ALT_FESTIVAL_MANAGER_START / 60000) + " minute(s).");
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/Shutdown.java
index 2d28cb7f39..c70efe99d2 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/Shutdown.java
@@ -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;
@@ -213,7 +214,7 @@ public class Shutdown extends Thread
// stop all thread pools
try
{
- ThreadPoolManager.shutdown();
+ ThreadPool.shutdown();
_log.info("Thread Pool Manager: Manager has been shut down(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
}
catch (Throwable t)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ThreadPoolManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ThreadPoolManager.java
deleted file mode 100644
index 69748c20d5..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ThreadPoolManager.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.gameserver;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.logging.Logger;
-
-import com.l2jmobius.Config;
-
-/**
- * This class handles thread pooling system. It relies on two ThreadPoolExecutor arrays, which poolers number is generated using config.
- *
- * Those arrays hold following pools :
- *
- *
- * - Scheduled pool keeps a track about incoming, future events.
- * - Instant pool handles short-life events.
- *
- */
-public final class ThreadPoolManager
-{
- protected static final Logger LOG = Logger.getLogger(ThreadPoolManager.class.getName());
-
- private static final long MAX_DELAY = TimeUnit.NANOSECONDS.toMillis(Long.MAX_VALUE - System.nanoTime()) / 2;
-
- private static int _threadPoolRandomizer;
-
- protected static ScheduledThreadPoolExecutor[] _scheduledPools;
- protected static ThreadPoolExecutor[] _instantPools;
-
- /**
- * Init the different pools, based on Config. It is launched only once, on Gameserver instance.
- */
- public static void init()
- {
- // Feed scheduled pool.
- int poolCount = Config.SCHEDULED_THREAD_POOL_COUNT;
- if (poolCount == -1)
- {
- poolCount = Runtime.getRuntime().availableProcessors();
- }
-
- _scheduledPools = new ScheduledThreadPoolExecutor[poolCount];
- for (int i = 0; i < poolCount; i++)
- {
- _scheduledPools[i] = new ScheduledThreadPoolExecutor(Config.THREADS_PER_SCHEDULED_THREAD_POOL);
- }
-
- // Feed instant pool.
- poolCount = Config.INSTANT_THREAD_POOL_COUNT;
- if (poolCount == -1)
- {
- poolCount = Runtime.getRuntime().availableProcessors();
- }
-
- _instantPools = new ThreadPoolExecutor[poolCount];
- for (int i = 0; i < poolCount; i++)
- {
- _instantPools[i] = new ThreadPoolExecutor(Config.THREADS_PER_INSTANT_THREAD_POOL, Config.THREADS_PER_INSTANT_THREAD_POOL, 0, TimeUnit.SECONDS, new ArrayBlockingQueue(100000));
- }
-
- // Prestart core threads.
- for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
- {
- threadPool.prestartAllCoreThreads();
- }
-
- for (ThreadPoolExecutor threadPool : _instantPools)
- {
- threadPool.prestartAllCoreThreads();
- }
-
- // Launch purge task.
- scheduleAtFixedRate(() ->
- {
- purge();
- }, 600000, 600000);
-
- LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_instantPools) + "/" + getMaximumPoolSize(_instantPools) + " instant thread(s).");
- LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_scheduledPools) + "/" + getMaximumPoolSize(_scheduledPools) + " scheduled thread(s).");
- }
-
- public static void purge()
- {
- for (ScheduledThreadPoolExecutor threadPool1 : _scheduledPools)
- {
- threadPool1.purge();
- }
- for (ThreadPoolExecutor threadPool2 : _instantPools)
- {
- threadPool2.purge();
- }
- }
-
- /**
- * Schedules a one-shot action that becomes enabled after a delay. The pool is chosen based on pools activity.
- * @param r : the task to execute.
- * @param delay : the time from now to delay execution.
- * @return a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion.
- */
- public static ScheduledFuture> schedule(Runnable r, long delay)
- {
- try
- {
- return getPool(_scheduledPools).schedule(new TaskWrapper(r), validate(delay), TimeUnit.MILLISECONDS);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * Schedules a periodic action that becomes enabled after a delay. The pool is chosen based on pools activity.
- * @param r : the task to execute.
- * @param delay : the time from now to delay execution.
- * @param period : the period between successive executions.
- * @return a ScheduledFuture representing pending completion of the task and whose get() method will throw an exception upon cancellation.
- */
- public static ScheduledFuture> scheduleAtFixedRate(Runnable r, long delay, long period)
- {
- try
- {
- return getPool(_scheduledPools).scheduleAtFixedRate(new TaskWrapper(r), validate(delay), validate(period), TimeUnit.MILLISECONDS);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * Executes the given task sometime in the future.
- * @param r : the task to execute.
- */
- public static void execute(Runnable r)
- {
- try
- {
- getPool(_instantPools).execute(new TaskWrapper(r));
- }
- catch (Exception e)
- {
- }
- }
-
- public static String[] getStats()
- {
- List stats = new ArrayList<>();
- for (int i = 0; i < _scheduledPools.length; i++)
- {
- final ScheduledThreadPoolExecutor threadPool = _scheduledPools[i];
- stats.add("Scheduled pool #" + i + ":");
- stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
- stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
- stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
- stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
- stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
- stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
- stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
- stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
- stats.add(" | -------");
- }
- for (int i = 0; i < _instantPools.length; i++)
- {
- final ThreadPoolExecutor threadPool = _instantPools[i];
- stats.add("Scheduled pool #" + i + ":");
- stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
- stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
- stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
- stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
- stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
- stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
- stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
- stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
- stats.add(" | -------");
- }
- return stats.toArray(new String[stats.size()]);
- }
-
- /**
- * Shutdown thread pooling system correctly. Send different informations.
- */
- public static void shutdown()
- {
- try
- {
- LOG.info("ThreadPoolManager: Shutting down.");
-
- for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
- {
- threadPool.shutdownNow();
- }
-
- for (ThreadPoolExecutor threadPool : _instantPools)
- {
- threadPool.shutdownNow();
- }
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- }
- }
-
- /**
- * @param : The pool type.
- * @param threadPools : The pool array to check.
- * @return the less fed pool.
- */
- private static T getPool(T[] threadPools)
- {
- return threadPools[_threadPoolRandomizer++ % threadPools.length];
- }
-
- /**
- * @param delay : The delay to validate.
- * @return a secured value, from 0 to MAX_DELAY.
- */
- private static long validate(long delay)
- {
- return Math.max(0, Math.min(MAX_DELAY, delay));
- }
-
- /**
- * @param threadPools : The pool array to check.
- * @return the overall actual pools size.
- */
- private static long getPoolSize(ThreadPoolExecutor[] threadPools)
- {
- long result = 0;
-
- for (ThreadPoolExecutor threadPool : threadPools)
- {
- result += threadPool.getPoolSize();
- }
-
- return result;
- }
-
- /**
- * @param threadPools : The pool array to check.
- * @return the overall maximum pools size.
- */
- private static long getMaximumPoolSize(ThreadPoolExecutor[] threadPools)
- {
- long result = 0;
-
- for (ThreadPoolExecutor threadPool : threadPools)
- {
- result += threadPool.getMaximumPoolSize();
- }
-
- return result;
- }
-
- public static final class TaskWrapper implements Runnable
- {
- private final Runnable _runnable;
-
- public TaskWrapper(Runnable runnable)
- {
- _runnable = runnable;
- }
-
- @Override
- public void run()
- {
- try
- {
- _runnable.run();
- }
- catch (RuntimeException e)
- {
- LOG.warning("Exception in " + _runnable.getClass().getName() + " execution: " + e.getMessage());
- }
- }
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/AbstractAI.java
index 4eb6aede24..8ad8c735b9 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/AbstractAI.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/AbstractAI.java
@@ -23,8 +23,8 @@ 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.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;
@@ -836,7 +836,7 @@ public abstract class AbstractAI implements Ctrl
// Create and Launch an AI Follow Task to execute every 1s
_followTarget = target;
- _followTask = ThreadPoolManager.scheduleAtFixedRate(new FollowTask(), 5, FOLLOW_INTERVAL);
+ _followTask = ThreadPool.scheduleAtFixedRate(new FollowTask(), 5, FOLLOW_INTERVAL);
}
/**
@@ -853,7 +853,7 @@ public abstract class AbstractAI implements Ctrl
}
_followTarget = target;
- _followTask = ThreadPoolManager.scheduleAtFixedRate(new FollowTask(range), 5, ATTACK_FOLLOW_INTERVAL);
+ _followTask = ThreadPool.scheduleAtFixedRate(new FollowTask(range), 5, ATTACK_FOLLOW_INTERVAL);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
index 775f6d2144..4dc1322b8f 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
@@ -26,8 +26,8 @@ import java.util.Set;
import java.util.concurrent.Future;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.TerritoryTable;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.AISkillScope;
@@ -303,7 +303,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);
}
}
@@ -402,7 +402,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
{
if ((_fearTime > 0) && (_fearTask == null))
{
- _fearTask = ThreadPoolManager.scheduleAtFixedRate(new FearTask(this, effector, start), 0, FEAR_TICKS * 1000); // seconds
+ _fearTask = ThreadPool.scheduleAtFixedRate(new FearTask(this, effector, start), 0, FEAR_TICKS * 1000); // seconds
_actor.startAbnormalVisualEffect(true, AbnormalVisualEffect.TURN_FLEE);
}
else
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
index e1dc800a20..ba2641f036 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
@@ -30,8 +30,8 @@ import java.util.ArrayList;
import java.util.List;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.ItemLocation;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -311,7 +311,7 @@ public class L2CharacterAI extends AbstractAI
if (_actor.getBowAttackEndTime() > GameTimeController.getInstance().getGameTicks())
{
- ThreadPoolManager.schedule(new CastTask(_actor, skill, target), (_actor.getBowAttackEndTime() - GameTimeController.getInstance().getGameTicks()) * GameTimeController.MILLIS_IN_TICK);
+ ThreadPool.schedule(new CastTask(_actor, skill, target), (_actor.getBowAttackEndTime() - GameTimeController.getInstance().getGameTicks()) * GameTimeController.MILLIS_IN_TICK);
}
else
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2DoorAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
index 211b44f906..989136790f 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
@@ -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.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -87,7 +87,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
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java
index 9c5b1d15e8..de7b4beef2 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2FortSiegeGuardAI.java
@@ -23,8 +23,8 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.Collection;
import java.util.concurrent.Future;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
@@ -199,7 +199,7 @@ public class L2FortSiegeGuardAI 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);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java
index d3b6bc88d3..11b02d6a26 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SiegeGuardAI.java
@@ -23,8 +23,8 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.Collection;
import java.util.concurrent.Future;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
@@ -197,7 +197,7 @@ public class L2SiegeGuardAI 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);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SummonAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
index f1d3449ab0..f62886d818 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
@@ -23,7 +23,7 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.concurrent.Future;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -294,7 +294,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
{
if (_avoidTask == null)
{
- _avoidTask = ThreadPoolManager.scheduleAtFixedRate(this, 100, 100);
+ _avoidTask = ThreadPool.scheduleAtFixedRate(this, 100, 100);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index 258e120fa2..9005a7c1ec 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -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)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
index 8f7cd9c8d0..150e58765d 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
@@ -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.idfactory.IdFactory;
import com.l2jmobius.gameserver.instancemanager.CHSiegeManager;
@@ -340,7 +340,7 @@ public class ClanTable
public void scheduleRemoveClan(int clanId)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (getClan(clanId) == null)
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/BotReportTable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
index 6e4346f30c..81ca7f1730 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
@@ -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.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -422,11 +422,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, "BotReportTable: Could not properly schedule bot report points reset task. Scheduled in 24 hours.", e);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/ItemTable.java
index 23bdb46155..d2cb78ab7f 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/ItemTable.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/ItemTable.java
@@ -29,8 +29,8 @@ import java.util.logging.LogRecord;
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;
@@ -220,14 +220,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);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
index c5ab0f5f5f..ce08284f39 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
@@ -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.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();
}
_log.info(getClass().getSimpleName() + ": " + _freeIds.size() + " id's available.");
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index e927aae2e2..8436f96c1a 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -35,8 +35,8 @@ 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.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.ManorMode;
import com.l2jmobius.gameserver.model.CropProcure;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -101,7 +101,7 @@ public final class CastleManorManager implements IXmlReader, 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
@@ -272,7 +272,7 @@ public final class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
- ThreadPoolManager.schedule(this::changeMode, _nextModeChange.getTimeInMillis() - System.currentTimeMillis());
+ ThreadPool.schedule(this::changeMode, _nextModeChange.getTimeInMillis() - System.currentTimeMillis());
}
public final void changeMode()
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/FishingChampionshipManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/FishingChampionshipManager.java
index b2d19729c6..cd287a27c9 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/FishingChampionshipManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/FishingChampionshipManager.java
@@ -27,8 +27,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.datatables.ItemTable;
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -79,7 +79,7 @@ public class FishingChampionshipManager
}
else
{
- ThreadPoolManager.schedule(new finishChamp(), _enddate - System.currentTimeMillis());
+ ThreadPool.schedule(new finishChamp(), _enddate - System.currentTimeMillis());
}
}
@@ -305,7 +305,7 @@ public class FishingChampionshipManager
pl.sendPacket(html);
refreshResult();
- ThreadPoolManager.schedule(new needRefresh(), 60000);
+ ThreadPool.schedule(new needRefresh(), 60000);
return;
}
@@ -471,7 +471,7 @@ public class FishingChampionshipManager
shutdown();
_log.info("FishingChampionshipManager : new event period start.");
- ThreadPoolManager.schedule(new finishChamp(), _enddate - System.currentTimeMillis());
+ ThreadPool.schedule(new finishChamp(), _enddate - System.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
index cdfbfc3fc7..7a25cc17e8 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
@@ -33,8 +33,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.DoorData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.instancemanager.tasks.FourSepulchersChangeAttackTimeTask;
@@ -204,25 +204,25 @@ public final class FourSepulchersManager
if ((currentTime >= _coolDownTimeEnd) && (currentTime < _entryTimeEnd)) // entry time check
{
clean();
- _changeEntryTimeTask = ThreadPoolManager.schedule(new FourSepulchersChangeEntryTimeTask(), 0);
+ _changeEntryTimeTask = ThreadPool.schedule(new FourSepulchersChangeEntryTimeTask(), 0);
_log.info(getClass().getSimpleName() + ": Beginning in Entry time");
}
else if ((currentTime >= _entryTimeEnd) && (currentTime < _warmUpTimeEnd)) // warmup time check
{
clean();
- _changeWarmUpTimeTask = ThreadPoolManager.schedule(new FourSepulchersChangeWarmUpTimeTask(), 0);
+ _changeWarmUpTimeTask = ThreadPool.schedule(new FourSepulchersChangeWarmUpTimeTask(), 0);
_log.info(getClass().getSimpleName() + ": Beginning in WarmUp time");
}
else if ((currentTime >= _warmUpTimeEnd) && (currentTime < _attackTimeEnd)) // attack time check
{
clean();
- _changeAttackTimeTask = ThreadPoolManager.schedule(new FourSepulchersChangeAttackTimeTask(), 0);
+ _changeAttackTimeTask = ThreadPool.schedule(new FourSepulchersChangeAttackTimeTask(), 0);
_log.info(getClass().getSimpleName() + ": Beginning in Attack time");
}
else
// else cooldown time and without cleanup because it's already implemented
{
- _changeCoolDownTimeTask = ThreadPoolManager.schedule(new FourSepulchersChangeCoolDownTimeTask(), 0);
+ _changeCoolDownTimeTask = ThreadPool.schedule(new FourSepulchersChangeCoolDownTimeTask(), 0);
_log.info(getClass().getSimpleName() + ": Beginning in Cooldown time");
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
index 970e001d80..b98088e91a 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
@@ -31,8 +31,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.L2Object;
@@ -109,7 +109,7 @@ public final class GrandBossManager implements IStorable
{
_log.log(Level.WARNING, "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);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
index c8112762a4..c181a0a483 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
@@ -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
{
@@ -345,7 +345,7 @@ public final class HandysBlockCheckerManager
private void schedulePenaltyRemoval(int objId)
{
- ThreadPoolManager.schedule(new PenaltyRemoveTask(objId), 10000);
+ ThreadPool.schedule(new PenaltyRemoveTask(objId), 10000);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 1900b9bd9e..ba42602c4f 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -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();
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/MailManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
index 7f307509ec..96a58c11ec 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
@@ -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.idfactory.IdFactory;
import com.l2jmobius.gameserver.instancemanager.tasks.MessageDeletionTask;
import com.l2jmobius.gameserver.model.L2World;
@@ -72,11 +72,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());
}
}
}
@@ -181,7 +181,7 @@ public final class MailManager
receiver.sendPacket(ExNoticePostArrived.valueOf(true));
}
- 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)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 1a6bdcfebb..a29ed155fc 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -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);
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java
index 18b960cf13..c7a8998430 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java
@@ -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.datatables.SpawnTable;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.StatsSet;
@@ -186,7 +186,7 @@ public class RaidBossSpawnManager
time.setTimeInMillis(respawnTime);
_log.info(getClass().getSimpleName() + ": Updated " + boss.getName() + " respawn time to " + time.getTime());
- _schedules.put(boss.getId(), ThreadPoolManager.schedule(new SpawnSchedule(boss.getId()), respawnDelay));
+ _schedules.put(boss.getId(), ThreadPool.schedule(new SpawnSchedule(boss.getId()), respawnDelay));
updateDb();
}
}
@@ -242,7 +242,7 @@ public class RaidBossSpawnManager
}
else
{
- _schedules.put(bossId, ThreadPoolManager.schedule(new SpawnSchedule(bossId), respawnTime - Calendar.getInstance().getTimeInMillis()));
+ _schedules.put(bossId, ThreadPool.schedule(new SpawnSchedule(bossId), respawnTime - Calendar.getInstance().getTimeInMillis()));
}
_spawns.put(bossId, spawnDat);
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
index 478e1f78f5..c1df0ca78b 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
@@ -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() + ".");
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/SoDManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/SoDManager.java
index b6ba5a5e26..57c77c7659 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/SoDManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/SoDManager.java
@@ -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;
@@ -113,7 +113,7 @@ public final class SoDManager
}
else
{
- ThreadPoolManager.schedule(new UpdateSoDStateTask(), Config.SOD_STAGE_2_LENGTH - timePast);
+ ThreadPool.schedule(new UpdateSoDStateTask(), Config.SOD_STAGE_2_LENGTH - timePast);
}
break;
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/SoIManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/SoIManager.java
index c18a377d33..c162d9d1db 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/SoIManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/SoIManager.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.instancemanager;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -116,7 +116,7 @@ public class SoIManager
spawnOpenedSeed();
DoorData.getInstance().getDoor(14240102).openMe();
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
closeSeed();
setCurrentStage(4);
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/TerritoryWarManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/TerritoryWarManager.java
index 024b019f22..86a7b5e2d5 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/TerritoryWarManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/TerritoryWarManager.java
@@ -32,8 +32,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.SkillTreesData;
import com.l2jmobius.gameserver.datatables.SkillData;
@@ -275,7 +275,7 @@ public final class TerritoryWarManager implements Siegable
{
_scheduledEndTWTask.cancel(false);
}
- _scheduledEndTWTask = ThreadPoolManager.schedule(new ScheduleEndTWTask(), 1000);
+ _scheduledEndTWTask = ThreadPool.schedule(new ScheduleEndTWTask(), 1000);
}
else
{
@@ -283,7 +283,7 @@ public final class TerritoryWarManager implements Siegable
{
_scheduledStartTWTask.cancel(false);
}
- _scheduledStartTWTask = ThreadPoolManager.schedule(new ScheduleStartTWTask(), 1000);
+ _scheduledStartTWTask = ThreadPool.schedule(new ScheduleStartTWTask(), 1000);
}
}
@@ -1267,14 +1267,14 @@ public final class TerritoryWarManager implements Siegable
if (timeRemaining > 7200000)
{
_isRegistrationOver = false;
- _scheduledStartTWTask = ThreadPoolManager.schedule(new ScheduleStartTWTask(), timeRemaining - 7200000); // Prepare task for 2h before TW start to end registration
+ _scheduledStartTWTask = ThreadPool.schedule(new ScheduleStartTWTask(), timeRemaining - 7200000); // Prepare task for 2h before TW start to end registration
}
else if ((timeRemaining <= 7200000) && (timeRemaining > 1200000))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_TERRITORY_WAR_REQUEST_PERIOD_HAS_ENDED);
Broadcast.toAllOnlinePlayers(sm);
_isRegistrationOver = true;
- _scheduledStartTWTask = ThreadPoolManager.schedule(new ScheduleStartTWTask(), timeRemaining - 1200000); // Prepare task for 20 mins left before TW start.
+ _scheduledStartTWTask = ThreadPool.schedule(new ScheduleStartTWTask(), timeRemaining - 1200000); // Prepare task for 20 mins left before TW start.
}
else if ((timeRemaining <= 1200000) && (timeRemaining > 600000))
{
@@ -1283,7 +1283,7 @@ public final class TerritoryWarManager implements Siegable
_isTWChannelOpen = true;
_isRegistrationOver = true;
updatePlayerTWStateFlags(false);
- _scheduledStartTWTask = ThreadPoolManager.schedule(new ScheduleStartTWTask(), timeRemaining - 600000); // Prepare task for 10 mins left before TW start.
+ _scheduledStartTWTask = ThreadPool.schedule(new ScheduleStartTWTask(), timeRemaining - 600000); // Prepare task for 10 mins left before TW start.
}
else if ((timeRemaining <= 600000) && (timeRemaining > 300000))
{
@@ -1292,7 +1292,7 @@ public final class TerritoryWarManager implements Siegable
_isTWChannelOpen = true;
_isRegistrationOver = true;
updatePlayerTWStateFlags(false);
- _scheduledStartTWTask = ThreadPoolManager.schedule(new ScheduleStartTWTask(), timeRemaining - 300000); // Prepare task for 5 mins left before TW start.
+ _scheduledStartTWTask = ThreadPool.schedule(new ScheduleStartTWTask(), timeRemaining - 300000); // Prepare task for 5 mins left before TW start.
}
else if ((timeRemaining <= 300000) && (timeRemaining > 60000))
{
@@ -1301,7 +1301,7 @@ public final class TerritoryWarManager implements Siegable
_isTWChannelOpen = true;
_isRegistrationOver = true;
updatePlayerTWStateFlags(false);
- _scheduledStartTWTask = ThreadPoolManager.schedule(new ScheduleStartTWTask(), timeRemaining - 60000); // Prepare task for 1 min left before TW start.
+ _scheduledStartTWTask = ThreadPool.schedule(new ScheduleStartTWTask(), timeRemaining - 60000); // Prepare task for 1 min left before TW start.
}
else if ((timeRemaining <= 60000) && (timeRemaining > 0))
{
@@ -1310,15 +1310,15 @@ public final class TerritoryWarManager implements Siegable
_isTWChannelOpen = true;
_isRegistrationOver = true;
updatePlayerTWStateFlags(false);
- _scheduledStartTWTask = ThreadPoolManager.schedule(new ScheduleStartTWTask(), timeRemaining); // Prepare task for TW start.
+ _scheduledStartTWTask = ThreadPool.schedule(new ScheduleStartTWTask(), timeRemaining); // Prepare task for TW start.
}
else if ((timeRemaining + WARLENGTH) > 0)
{
_isTWChannelOpen = true;
_isRegistrationOver = true;
startTerritoryWar();
- _scheduledEndTWTask = ThreadPoolManager.schedule(new ScheduleEndTWTask(), 1000); // Prepare task for TW end.
- _scheduledRewardOnlineTask = ThreadPoolManager.scheduleAtFixedRate(new RewardOnlineParticipants(), 60000, 60000);
+ _scheduledEndTWTask = ThreadPool.schedule(new ScheduleEndTWTask(), 1000); // Prepare task for TW end.
+ _scheduledRewardOnlineTask = ThreadPool.scheduleAtFixedRate(new RewardOnlineParticipants(), 60000, 60000);
}
}
catch (Exception e)
@@ -1348,41 +1348,41 @@ public final class TerritoryWarManager implements Siegable
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_TERRITORY_WAR_WILL_END_IN_S1_HOUR_S);
sm.addInt(2);
announceToParticipants(sm, 0, 0);
- _scheduledEndTWTask = ThreadPoolManager.schedule(new ScheduleEndTWTask(), timeRemaining - 3600000); // Prepare task for 1 hr left.
+ _scheduledEndTWTask = ThreadPool.schedule(new ScheduleEndTWTask(), timeRemaining - 3600000); // Prepare task for 1 hr left.
}
else if ((timeRemaining <= 3600000) && (timeRemaining > 600000))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_TERRITORY_WAR_WILL_END_IN_S1_MINUTE_S);
sm.addInt((int) (timeRemaining / 60000));
announceToParticipants(sm, 0, 0);
- _scheduledEndTWTask = ThreadPoolManager.schedule(new ScheduleEndTWTask(), timeRemaining - 600000); // Prepare task for 10 minute left.
+ _scheduledEndTWTask = ThreadPool.schedule(new ScheduleEndTWTask(), timeRemaining - 600000); // Prepare task for 10 minute left.
}
else if ((timeRemaining <= 600000) && (timeRemaining > 300000))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_TERRITORY_WAR_WILL_END_IN_S1_MINUTE_S);
sm.addInt((int) (timeRemaining / 60000));
announceToParticipants(sm, 0, 0);
- _scheduledEndTWTask = ThreadPoolManager.schedule(new ScheduleEndTWTask(), timeRemaining - 300000); // Prepare task for 5 minute left.
+ _scheduledEndTWTask = ThreadPool.schedule(new ScheduleEndTWTask(), timeRemaining - 300000); // Prepare task for 5 minute left.
}
else if ((timeRemaining <= 300000) && (timeRemaining > 10000))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_TERRITORY_WAR_WILL_END_IN_S1_MINUTE_S);
sm.addInt((int) (timeRemaining / 60000));
announceToParticipants(sm, 0, 0);
- _scheduledEndTWTask = ThreadPoolManager.schedule(new ScheduleEndTWTask(), timeRemaining - 10000); // Prepare task for 10 seconds count down
+ _scheduledEndTWTask = ThreadPool.schedule(new ScheduleEndTWTask(), timeRemaining - 10000); // Prepare task for 10 seconds count down
}
else if ((timeRemaining <= 10000) && (timeRemaining > 0))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SECOND_S_TO_THE_END_OF_TERRITORY_WAR);
sm.addInt((int) (timeRemaining / 1000));
announceToParticipants(sm, 0, 0);
- _scheduledEndTWTask = ThreadPoolManager.schedule(new ScheduleEndTWTask(), timeRemaining); // Prepare task for second count down
+ _scheduledEndTWTask = ThreadPool.schedule(new ScheduleEndTWTask(), timeRemaining); // Prepare task for second count down
}
else
{
endTerritoryWar();
// _scheduledStartTWTask = ThreadPoolManager.schedule(new ScheduleStartTWTask(), 1000);
- ThreadPoolManager.schedule(new closeTerritoryChannelTask(), 600000);
+ ThreadPool.schedule(new closeTerritoryChannelTask(), 600000);
}
}
catch (Exception e)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
index f86f66c771..4a0a2b8552 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
@@ -25,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-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.instancemanager.tasks.StartMovingTask;
@@ -269,7 +269,7 @@ public final class WalkingManager implements IXmlReader
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
npc.getKnownList().startTrackingTask();
@@ -277,7 +277,7 @@ public final class WalkingManager implements IXmlReader
}
else
{
- ThreadPoolManager.schedule(new StartMovingTask(npc, routeName), 60000);
+ ThreadPool.schedule(new StartMovingTask(npc, routeName), 60000);
}
}
// walk was stopped due to some reason (arrived to node, script action, fight or something else), resume it
@@ -414,7 +414,7 @@ public final class WalkingManager implements IXmlReader
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));
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/games/Lottery.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/games/Lottery.java
index f7837f4248..42bdda815b 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/games/Lottery.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/games/Lottery.java
@@ -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.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
@@ -152,12 +152,12 @@ public class Lottery
if (_enddate > System.currentTimeMillis())
{
_isStarted = true;
- ThreadPoolManager.schedule(new finishLottery(), _enddate - System.currentTimeMillis());
+ ThreadPool.schedule(new finishLottery(), _enddate - System.currentTimeMillis());
if (_enddate > (System.currentTimeMillis() + (12 * MINUTE)))
{
_isSellingTickets = true;
- ThreadPoolManager.schedule(new stopSellingTickets(), _enddate - System.currentTimeMillis() - (10 * MINUTE));
+ ThreadPool.schedule(new stopSellingTickets(), _enddate - System.currentTimeMillis() - (10 * MINUTE));
}
return;
}
@@ -191,8 +191,8 @@ public class Lottery
_enddate = finishtime.getTimeInMillis();
}
- ThreadPoolManager.schedule(new stopSellingTickets(), _enddate - System.currentTimeMillis() - (10 * MINUTE));
- ThreadPoolManager.schedule(new finishLottery(), _enddate - System.currentTimeMillis());
+ ThreadPool.schedule(new stopSellingTickets(), _enddate - System.currentTimeMillis() - (10 * MINUTE));
+ ThreadPool.schedule(new finishLottery(), _enddate - System.currentTimeMillis());
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement(INSERT_LOTTERY))
@@ -400,7 +400,7 @@ public class Lottery
_log.log(Level.WARNING, "Lottery: Could not store finished lottery data: " + e.getMessage(), e);
}
- ThreadPoolManager.schedule(new startLottery(), MINUTE);
+ ThreadPool.schedule(new startLottery(), MINUTE);
_number++;
_isStarted = false;
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeAttackTimeTask.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeAttackTimeTask.java
index 89e9b008dc..586b1927ea 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeAttackTimeTask.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeAttackTimeTask.java
@@ -20,7 +20,7 @@ import java.util.Calendar;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
/**
@@ -61,14 +61,14 @@ public final class FourSepulchersChangeAttackTimeTask implements Runnable
{
final Calendar inter = Calendar.getInstance();
inter.set(Calendar.MINUTE, (int) min);
- ThreadPoolManager.schedule(new FourSepulchersManagerSayTask(), inter.getTimeInMillis() - Calendar.getInstance().getTimeInMillis());
+ ThreadPool.schedule(new FourSepulchersManagerSayTask(), inter.getTimeInMillis() - Calendar.getInstance().getTimeInMillis());
break;
}
}
}
else
{
- ThreadPoolManager.schedule(new FourSepulchersManagerSayTask(), 5 * 60400);
+ ThreadPool.schedule(new FourSepulchersManagerSayTask(), 5 * 60400);
}
// searching time when attack time will be ended:
// counting difference between time when attack time ends and
@@ -83,7 +83,7 @@ public final class FourSepulchersChangeAttackTimeTask implements Runnable
interval = Config.FS_TIME_ATTACK * 60000L;
}
- manager.setChangeCoolDownTimeTask(ThreadPoolManager.schedule(new FourSepulchersChangeCoolDownTimeTask(), interval));
+ manager.setChangeCoolDownTimeTask(ThreadPool.schedule(new FourSepulchersChangeCoolDownTimeTask(), interval));
final ScheduledFuture> changeAttackTimeTask = manager.getChangeAttackTimeTask();
if (changeAttackTimeTask != null)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeCoolDownTimeTask.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeCoolDownTimeTask.java
index d2e454376a..b502286c2f 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeCoolDownTimeTask.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeCoolDownTimeTask.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.instancemanager.tasks;
import java.util.Calendar;
import java.util.concurrent.ScheduledFuture;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
/**
@@ -54,7 +54,7 @@ public final class FourSepulchersChangeCoolDownTimeTask implements Runnable
final long interval = time.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
- manager.setChangeEntryTimeTask(ThreadPoolManager.schedule(new FourSepulchersChangeEntryTimeTask(), interval));
+ manager.setChangeEntryTimeTask(ThreadPool.schedule(new FourSepulchersChangeEntryTimeTask(), interval));
final ScheduledFuture> changeCoolDownTimeTask = manager.getChangeCoolDownTimeTask();
if (changeCoolDownTimeTask != null)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeEntryTimeTask.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeEntryTimeTask.java
index 0abd0b96ff..222d57df0a 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeEntryTimeTask.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeEntryTimeTask.java
@@ -20,7 +20,7 @@ import java.util.Calendar;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
/**
@@ -40,8 +40,8 @@ public final class FourSepulchersChangeEntryTimeTask implements Runnable
final long interval = manager.isFirstTimeRun() ? manager.getEntrytTimeEnd() - Calendar.getInstance().getTimeInMillis() : Config.FS_TIME_ENTRY * 60000L;
// launching saying process...
- ThreadPoolManager.schedule(new FourSepulchersManagerSayTask(), 0);
- manager.setChangeWarmUpTimeTask(ThreadPoolManager.schedule(new FourSepulchersChangeWarmUpTimeTask(), interval));
+ ThreadPool.schedule(new FourSepulchersManagerSayTask(), 0);
+ manager.setChangeWarmUpTimeTask(ThreadPool.schedule(new FourSepulchersChangeWarmUpTimeTask(), interval));
final ScheduledFuture> changeEntryTimeTask = manager.getChangeEntryTimeTask();
if (changeEntryTimeTask != null)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeWarmUpTimeTask.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeWarmUpTimeTask.java
index 420c3878db..5b8e5b0ad3 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeWarmUpTimeTask.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersChangeWarmUpTimeTask.java
@@ -20,7 +20,7 @@ import java.util.Calendar;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
/**
@@ -39,7 +39,7 @@ public final class FourSepulchersChangeWarmUpTimeTask implements Runnable
manager.setIsCoolDownTime(false);
final long interval = manager.isFirstTimeRun() ? manager.getWarmUpTimeEnd() - Calendar.getInstance().getTimeInMillis() : Config.FS_TIME_WARMUP * 60000L;
- manager.setChangeAttackTimeTask(ThreadPoolManager.schedule(new FourSepulchersChangeAttackTimeTask(), interval));
+ manager.setChangeAttackTimeTask(ThreadPool.schedule(new FourSepulchersChangeAttackTimeTask(), interval));
final ScheduledFuture> changeWarmUpTimeTask = manager.getChangeWarmUpTimeTask();
if (changeWarmUpTimeTask != null)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersManagerSayTask.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersManagerSayTask.java
index 346f324151..ae20beb130 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersManagerSayTask.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/tasks/FourSepulchersManagerSayTask.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.instancemanager.tasks;
import java.util.Calendar;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
/**
@@ -43,7 +43,7 @@ public final class FourSepulchersManagerSayTask implements Runnable
// cannot be
// more than
// 59
- ThreadPoolManager.schedule(new FourSepulchersManagerSayTask(), 5 * 60000);
+ ThreadPool.schedule(new FourSepulchersManagerSayTask(), 5 * 60000);
}
// attack time ending chat
else if ((tmp.get(Calendar.MINUTE) + 5) >= Config.FS_TIME_ATTACK)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/AutoSpawnHandler.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/AutoSpawnHandler.java
index 2b3d20a3b8..cfceb791ff 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/AutoSpawnHandler.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/AutoSpawnHandler.java
@@ -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.datatables.SpawnTable;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -274,7 +274,7 @@ public class AutoSpawnHandler
if (isActive)
{
final AutoSpawner rs = new AutoSpawner(objectId);
- spawnTask = spawnInst._desDelay > 0 ? ThreadPoolManager.scheduleAtFixedRate(rs, spawnInst._initDelay, spawnInst._resDelay) : ThreadPoolManager.schedule(rs, spawnInst._initDelay);
+ spawnTask = spawnInst._desDelay > 0 ? ThreadPool.scheduleAtFixedRate(rs, spawnInst._initDelay, spawnInst._resDelay) : ThreadPool.schedule(rs, spawnInst._initDelay);
_runningSpawns.put(objectId, spawnTask);
}
else
@@ -285,7 +285,7 @@ public class AutoSpawnHandler
{
spawnTask.cancel(false);
}
- ThreadPoolManager.schedule(rd, 0);
+ ThreadPool.schedule(rd, 0);
}
spawnInst.setSpawnActive(isActive);
}
@@ -489,7 +489,7 @@ public class AutoSpawnHandler
// If there is no despawn time, do not create a despawn task.
if (spawnInst.getDespawnDelay() > 0)
{
- ThreadPoolManager.schedule(new AutoDespawner(_objectId), spawnInst.getDespawnDelay() - 1000);
+ ThreadPool.schedule(new AutoDespawner(_objectId), spawnInst.getDespawnDelay() - 1000);
}
}
catch (Exception e)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/CharEffectList.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/CharEffectList.java
index fb50f26aab..f33f07a9dc 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/CharEffectList.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/CharEffectList.java
@@ -33,7 +33,7 @@ import java.util.function.Function;
import java.util.logging.Logger;
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.L2Summon;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -1308,7 +1308,7 @@ public final class CharEffectList
return;
}
// Schedule the icon update packets 500miliseconds ahead, so it can gather-up most of the changes.
- _effectIconsUpdate = ThreadPoolManager.schedule(() ->
+ _effectIconsUpdate = ThreadPool.schedule(() ->
{
AbnormalStatusUpdate asu = null;
PartySpelled ps = null;
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/CursedWeapon.java
index 552506b543..cf26d20039 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/CursedWeapon.java
@@ -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.database.DatabaseFactory;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.TransformData;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
@@ -352,7 +352,7 @@ public class CursedWeapon implements INamable
{
_player.stopTransformation(true);
- ThreadPoolManager.schedule(() -> TransformData.getInstance().transformPlayer(transformationId, _player), 500);
+ ThreadPool.schedule(() -> TransformData.getInstance().transformPlayer(transformationId, _player), 500);
}
else
{
@@ -378,7 +378,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);
}
}
@@ -391,7 +391,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;
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/DropProtection.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/DropProtection.java
index d0648e4f20..e353a406d1 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/DropProtection.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/DropProtection.java
@@ -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.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
@@ -84,6 +84,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);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Party.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Party.java
index d2db22f3e8..76a0ca096a 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Party.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Party.java
@@ -28,9 +28,9 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.SevenSignsFestival;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.enums.PartyDistributionType;
import com.l2jmobius.gameserver.instancemanager.DuelManager;
@@ -359,7 +359,7 @@ public class L2Party extends AbstractPlayerGroup
if (_positionBroadcastTask == null)
{
- _positionBroadcastTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _positionBroadcastTask = ThreadPool.scheduleAtFixedRate(() ->
{
if (_positionPacket == null)
{
@@ -993,7 +993,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));
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Request.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Request.java
index 5ffe96fce3..807a04fe32 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Request.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Request.java
@@ -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.L2GameClientPacket;
@@ -123,7 +123,7 @@ public class L2Request
{
_isRequestor = isRequestor;
_isAnswerer = !isRequestor;
- ThreadPoolManager.schedule(() -> clear(), REQUEST_TIMEOUT * 1000);
+ ThreadPool.schedule(() -> clear(), REQUEST_TIMEOUT * 1000);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java
index b82c11b6dd..90001df672 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java
@@ -27,7 +27,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.data.sql.impl.TerritoryTable;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.datatables.NpcPersonalAIData;
@@ -441,7 +441,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);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 436c28ef3f..af560cbd38 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -24,7 +24,7 @@ import java.util.concurrent.ScheduledFuture;
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.L2Character;
@@ -330,7 +330,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);
}
}
@@ -350,7 +350,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);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
index 1f3ac04f3e..10eae85653 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
@@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Level;
import com.l2jmobius.Config;
-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.L2AttackableAI;
@@ -257,7 +257,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
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index 5d84b1d01f..79e382a587 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -35,8 +35,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
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;
@@ -802,7 +802,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 false;
@@ -820,7 +820,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
else
{
// Cancel the action because the bow can't be re-use at this moment
- 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 false;
}
@@ -1084,7 +1084,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
// Notify AI with EVT_READY_TO_ACT
- ThreadPoolManager.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), timeAtk + reuse);
+ ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), timeAtk + reuse);
}
finally
{
@@ -1150,7 +1150,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
// Create a new hit task with Medium priority
- ThreadPoolManager.schedule(new HitTask(this, target, damage1, crit1, miss1, attack.hasSoulshot(), shld1), sAtk);
+ ThreadPool.schedule(new HitTask(this, target, damage1, crit1, miss1, attack.hasSoulshot(), shld1), sAtk);
// Calculate and set the disable delay of the bow in function of the Attack Speed
_disableBowAttackEndTime = ((sAtk + reuse) / GameTimeController.MILLIS_IN_TICK) + GameTimeController.getInstance().getGameTicks();
@@ -1220,7 +1220,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
// Create a new hit task with Medium priority
- ThreadPoolManager.schedule(new HitTask(this, target, damage1, crit1, miss1, attack.hasSoulshot(), shld1), sAtk);
+ ThreadPool.schedule(new HitTask(this, target, damage1, crit1, miss1, attack.hasSoulshot(), shld1), sAtk);
// Calculate and set the disable delay of the bow in function of the Attack Speed
_disableBowAttackEndTime = ((sAtk + reuse) / GameTimeController.MILLIS_IN_TICK) + GameTimeController.getInstance().getGameTicks();
@@ -1290,10 +1290,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
// Create a new hit task with Medium priority for hit 1
- ThreadPoolManager.schedule(new HitTask(this, target, damage1, crit1, miss1, attack.hasSoulshot(), shld1), sAtk / 2);
+ ThreadPool.schedule(new HitTask(this, target, damage1, crit1, miss1, attack.hasSoulshot(), shld1), sAtk / 2);
// Create a new hit task with Medium priority for hit 2 with a higher delay
- ThreadPoolManager.schedule(new HitTask(this, target, damage2, crit2, miss2, attack.hasSoulshot(), shld2), sAtk);
+ ThreadPool.schedule(new HitTask(this, target, damage2, crit2, miss2, attack.hasSoulshot(), shld2), sAtk);
// Add those hits to the Server-Client packet Attack
attack.addHit(target, damage1, miss1, crit1, shld1);
@@ -1470,7 +1470,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
// Create a new hit task with Medium priority
- ThreadPoolManager.schedule(new HitTask(this, target, damage1, crit1, miss1, attack.hasSoulshot(), shld1), sAtk);
+ ThreadPool.schedule(new HitTask(this, target, damage1, crit1, miss1, attack.hasSoulshot(), shld1), sAtk);
// Add this hit to the Server-Client packet Attack
attack.addHit(target, damage1, miss1, crit1, shld1);
@@ -1741,7 +1741,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// queue herbs and potions
if (isCastingSimultaneouslyNow() && simultaneously)
{
- ThreadPoolManager.schedule(() -> beginCast(skill, simultaneously, target, targets), 100);
+ ThreadPool.schedule(() -> beginCast(skill, simultaneously, target, targets), 100);
return;
}
@@ -1895,7 +1895,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Before start AI Cast Broadcast Fly Effect is Need
if (skill.getFlyType() != null)
{
- ThreadPoolManager.schedule(new FlyToLocationTask(this, target, skill), 50);
+ ThreadPool.schedule(new FlyToLocationTask(this, target, skill), 50);
}
final MagicUseTask mut = new MagicUseTask(this, targets, skill, skillTime, simultaneously);
@@ -1925,7 +1925,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Create a task MagicUseTask to launch the MagicSkill at the end of the casting time (skillTime)
// For client animation reasons (party buffs especially) 400 ms before!
- _skillCast2 = ThreadPoolManager.schedule(mut, skillTime - 400);
+ _skillCast2 = ThreadPool.schedule(mut, skillTime - 400);
}
else
{
@@ -1938,7 +1938,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Create a task MagicUseTask to launch the MagicSkill at the end of the casting time (skillTime)
// For client animation reasons (party buffs especially) 400 ms before!
- _skillCast = ThreadPoolManager.schedule(mut, skillTime - 400);
+ _skillCast = ThreadPool.schedule(mut, skillTime - 400);
}
}
else
@@ -4051,7 +4051,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
if (distFraction > 1)
{
- ThreadPoolManager.execute(() ->
+ ThreadPool.execute(() ->
{
try
{
@@ -4502,7 +4502,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
}
@@ -4580,7 +4580,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
@@ -5432,7 +5432,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
else
{
- _skillCast = ThreadPoolManager.schedule(mut, 400);
+ _skillCast = ThreadPool.schedule(mut, 400);
}
}
@@ -5561,11 +5561,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
if (mut.isSimultaneous())
{
- _skillCast2 = ThreadPoolManager.schedule(mut, 0);
+ _skillCast2 = ThreadPool.schedule(mut, 0);
}
else
{
- _skillCast = ThreadPoolManager.schedule(mut, 0);
+ _skillCast = ThreadPool.schedule(mut, 0);
}
}
}
@@ -5632,7 +5632,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// DON'T USE : Recursive call to useMagic() method
// currPlayer.useMagic(queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed());
- ThreadPoolManager.execute(new QueuedMagicUseTask(currPlayer, queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed()));
+ ThreadPool.execute(new QueuedMagicUseTask(currPlayer, queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed()));
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
index 69b82d443d..d4daa420f3 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
@@ -26,10 +26,10 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ItemsAutoDestroy;
import com.l2jmobius.gameserver.SevenSigns;
import com.l2jmobius.gameserver.SevenSignsFestival;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.datatables.ItemTable;
@@ -314,7 +314,7 @@ public class L2Npc extends L2Character
// Create a RandomAnimation Task that will be launched after the calculated delay
_rAniTask = new RandomAnimationTask(this);
- ThreadPoolManager.schedule(_rAniTask, interval);
+ ThreadPool.schedule(_rAniTask, interval);
}
/**
@@ -1533,7 +1533,7 @@ public class L2Npc extends L2Character
public L2Npc scheduleDespawn(long delay)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (!isDecayed())
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
index 6df34f1cd7..27610f21f9 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
@@ -22,8 +22,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
import com.l2jmobius.Config;
+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;
@@ -92,7 +92,7 @@ public abstract class L2Vehicle extends L2Character
{
if (_engine != null)
{
- ThreadPoolManager.schedule(_engine, delay);
+ ThreadPool.schedule(_engine, delay);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2BabyPetInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2BabyPetInstance.java
index 1509f0a9d7..208e3a8792 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2BabyPetInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2BabyPetInstance.java
@@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Future;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.PetDataTable;
import com.l2jmobius.gameserver.datatables.SkillData;
@@ -187,7 +187,7 @@ public final class L2BabyPetInstance extends L2PetInstance
{
if ((_majorHeal != null) || (_buffs != null) || ((_recharge != null) && (_castTask == null) && !isDead()))
{
- _castTask = ThreadPoolManager.scheduleAtFixedRate(new CastTask(this), 3000, 2000);
+ _castTask = ThreadPool.scheduleAtFixedRate(new CastTask(this), 3000, 2000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
index f17adaffca..83d000a403 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
@@ -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;
@@ -257,8 +257,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
@@ -330,7 +330,7 @@ public class L2ControllableAirShipInstance extends L2AirShipInstance
if (isVisible() && isEmpty() && !isInDock())
{
// deleteMe() can't be called from CheckTask because task should not cancel itself
- ThreadPoolManager.execute(new DecayTask());
+ ThreadPool.execute(new DecayTask());
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2CubicInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2CubicInstance.java
index e36a8d5418..7caaa64148 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2CubicInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2CubicInstance.java
@@ -22,7 +22,7 @@ import java.util.concurrent.Future;
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.ai.CtrlEvent;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.instancemanager.DuelManager;
@@ -181,7 +181,7 @@ public final class L2CubicInstance implements IIdentifiable
break;
}
}
- _disappearTask = ThreadPoolManager.schedule(new CubicDisappear(this), cubicDuration * 1000); // disappear
+ _disappearTask = ThreadPool.schedule(new CubicDisappear(this), cubicDuration * 1000); // disappear
}
public synchronized void doAction()
@@ -208,12 +208,12 @@ public final class L2CubicInstance implements IIdentifiable
case SMART_CUBIC_EVATEMPLAR:
case SMART_CUBIC_SHILLIENTEMPLAR:
{
- _actionTask = ThreadPoolManager.scheduleAtFixedRate(new CubicAction(this, _cubicSkillChance), 0, _cubicDelay);
+ _actionTask = ThreadPool.scheduleAtFixedRate(new CubicAction(this, _cubicSkillChance), 0, _cubicDelay);
break;
}
case LIFE_CUBIC:
{
- _actionTask = ThreadPoolManager.scheduleAtFixedRate(new CubicHeal(this), 0, _cubicDelay);
+ _actionTask = ThreadPool.scheduleAtFixedRate(new CubicHeal(this), 0, _cubicDelay);
break;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
index 8fa29ae043..c4e859546b 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
@@ -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.datatables.SkillData;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -49,8 +49,8 @@ public class L2DecoyInstance extends L2Decoy
_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
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
index a5ccbb4a03..051e4c672e 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
@@ -23,7 +23,7 @@ import java.util.Set;
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.ai.L2CharacterAI;
import com.l2jmobius.gameserver.ai.L2DoorAI;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
@@ -127,7 +127,7 @@ public class L2DoorInstance extends L2Character
{
delay += Rnd.get(getTemplate().getRandomTime());
}
- ThreadPoolManager.schedule(new TimerOpen(), delay * 1000);
+ ThreadPool.schedule(new TimerOpen(), delay * 1000);
}
@Override
@@ -751,7 +751,7 @@ public 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
@@ -786,7 +786,7 @@ public class L2DoorInstance extends L2Character
{
delay += Rnd.get(getTemplate().getRandomTime());
}
- ThreadPoolManager.schedule(this, delay * 1000);
+ ThreadPool.schedule(this, delay * 1000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
index 725d834081..6fa27cf23d 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
@@ -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;
@@ -158,7 +158,7 @@ public class L2FortCommanderInstance extends L2DefenderInstance
broadcastPacket(ns);
setCanTalk(false);
- ThreadPoolManager.schedule(new ScheduleTalkTask(), 10000);
+ ThreadPool.schedule(new ScheduleTalkTask(), 10000);
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
index fc8aaa97f5..80114a3bed 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
@@ -45,6 +45,7 @@ import java.util.concurrent.locks.ReentrantLock;
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.GameTimeController;
import com.l2jmobius.gameserver.ItemsAutoDestroy;
@@ -52,7 +53,6 @@ import com.l2jmobius.gameserver.LoginServerThread;
import com.l2jmobius.gameserver.RecipeController;
import com.l2jmobius.gameserver.SevenSigns;
import com.l2jmobius.gameserver.SevenSignsFestival;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.L2CharacterAI;
import com.l2jmobius.gameserver.ai.L2PlayerAI;
@@ -886,7 +886,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);
}
}
@@ -2841,7 +2841,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);
setIsParalyzed(true);
}
@@ -2863,7 +2863,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);
}
}
@@ -4247,7 +4247,7 @@ public final class L2PcInstance extends L2Playable
}
if (Config.GAMEGUARD_ENFORCE)
{
- ThreadPoolManager.schedule(new GameGuardCheckTask(this), 30 * 1000);
+ ThreadPool.schedule(new GameGuardCheckTask(this), 30 * 1000);
}
}
@@ -9080,7 +9080,7 @@ public final class L2PcInstance extends L2Playable
_inventoryDisable = val;
if (val)
{
- ThreadPoolManager.schedule(new InventoryEnableTask(this), 1500);
+ ThreadPool.schedule(new InventoryEnableTask(this), 1500);
}
}
@@ -10300,7 +10300,7 @@ public final class L2PcInstance extends L2Playable
{
if (_taskWarnUserTakeBreak == null)
{
- _taskWarnUserTakeBreak = ThreadPoolManager.scheduleAtFixedRate(new WarnUserTakeBreakTask(this), 7200000, 7200000);
+ _taskWarnUserTakeBreak = ThreadPool.scheduleAtFixedRate(new WarnUserTakeBreakTask(this), 7200000, 7200000);
}
}
@@ -10326,7 +10326,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);
}
}
@@ -10354,7 +10354,7 @@ public final class L2PcInstance extends L2Playable
}
final int timeinwater = (int) calcStat(Stats.BREATH, 60000, this, null);
sendPacket(new SetupGauge(2, timeinwater));
- _taskWater = ThreadPoolManager.scheduleAtFixedRate(new WaterTask(this), timeinwater, 1000);
+ _taskWater = ThreadPool.scheduleAtFixedRate(new WaterTask(this), timeinwater, 1000);
}
public boolean isInWater()
@@ -10717,7 +10717,7 @@ public final class L2PcInstance extends L2Playable
{
synchronized (this)
{
- _teleportWatchdog = ThreadPoolManager.schedule(new TeleportWatchdogTask(this), Config.TELEPORT_WATCHDOG_TIMEOUT * 1000);
+ _teleportWatchdog = ThreadPool.schedule(new TeleportWatchdogTask(this), Config.TELEPORT_WATCHDOG_TIMEOUT * 1000);
}
}
}
@@ -11516,7 +11516,7 @@ public final class L2PcInstance extends L2Playable
checkDelay = _fish.getGutsCheckTime() * 66;
}
}
- _taskforfish = ThreadPoolManager.scheduleAtFixedRate(new LookingForFishTask(this, _fish.getStartCombatTime(), _fish.getFishGuts(), _fish.getFishGroup(), isNoob, isUpperGrade), 10000, checkDelay);
+ _taskforfish = ThreadPool.scheduleAtFixedRate(new LookingForFishTask(this, _fish.getStartCombatTime(), _fish.getFishGuts(), _fish.getFishGroup(), isNoob, isUpperGrade), 10000, checkDelay);
}
}
@@ -12051,7 +12051,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);
}
}
@@ -12069,7 +12069,7 @@ public final class L2PcInstance extends L2Playable
{
if (Config.ENABLE_VITALITY && (_vitalityTask == null))
{
- _vitalityTask = ThreadPoolManager.scheduleAtFixedRate(new VitalityTask(this), 1000, 60000);
+ _vitalityTask = ThreadPool.scheduleAtFixedRate(new VitalityTask(this), 1000, 60000);
}
}
@@ -12189,7 +12189,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);
}
/**
@@ -12489,7 +12489,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)
@@ -12499,7 +12499,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);
}
}
}
@@ -12563,7 +12563,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()
@@ -12707,7 +12707,7 @@ public final class L2PcInstance extends L2Playable
_chargeTask.cancel(false);
}
}
- _chargeTask = ThreadPoolManager.schedule(new ResetChargesTask(this), 600000);
+ _chargeTask = ThreadPool.schedule(new ResetChargesTask(this), 600000);
}
/**
@@ -13820,7 +13820,7 @@ public final class L2PcInstance extends L2Playable
startNevitHourglassTask();
// 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(false);
@@ -13836,7 +13836,7 @@ public final class L2PcInstance extends L2Playable
if (taskTime > 0)
{
// If player have some timeleft, start bonus task
- _nevitHourglassTask = ThreadPoolManager.schedule(new RecoBonusTaskEnd(this), taskTime);
+ _nevitHourglassTask = ThreadPool.schedule(new RecoBonusTaskEnd(this), taskTime);
}
sendPacket(new ExVoteSystemInfo(this));
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
index 84626ddffc..99f4e14b90 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
@@ -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.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.sql.impl.CharSummonTable;
import com.l2jmobius.gameserver.data.sql.impl.SummonEffectsTable;
@@ -1100,7 +1100,7 @@ public class L2PetInstance extends L2Summon
stopFeed();
if (!isDead() && (getOwner().getSummon() == this))
{
- _feedTask = ThreadPoolManager.scheduleAtFixedRate(new FeedTask(), 10000, 10000);
+ _feedTask = ThreadPool.scheduleAtFixedRate(new FeedTask(), 10000, 10000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
index bda6320579..9db7b16e37 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2RaceManagerInstance.java
@@ -19,8 +19,8 @@ package com.l2jmobius.gameserver.model.actor.instance;
import java.util.ArrayList;
import java.util.List;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.MonsterRace;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -103,26 +103,26 @@ public class L2RaceManagerInstance extends L2Npc
_managers = new ArrayList<>();
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
- ThreadPoolManager.scheduleAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
+ ThreadPool.scheduleAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
}
_managers.add(this);
}
@@ -251,7 +251,7 @@ public class L2RaceManagerInstance extends L2Npc
_packet = new MonRaceInfo(_codes[1][0], _codes[1][1], race.getMonsters(), race.getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunRace(), 5000);
+ ThreadPool.schedule(new RunRace(), 5000);
}
else
{
@@ -528,7 +528,7 @@ public class L2RaceManagerInstance extends L2Npc
{
_packet = new MonRaceInfo(_codes[2][0], _codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
sendMonsterInfo();
- ThreadPoolManager.schedule(new RunEnd(), 30000);
+ ThreadPool.schedule(new RunEnd(), 30000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
index f8ae4d77ac..347974f5bf 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.actor.instance;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.RaidBossPointsManager;
import com.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
@@ -108,7 +108,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()
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherMonsterInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherMonsterInstance.java
index ab7209d1b0..03881f35c3 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherMonsterInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherMonsterInstance.java
@@ -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.ChatType;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
@@ -81,12 +81,12 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_victimSpawnKeyBoxTask.cancel(true);
}
- _victimSpawnKeyBoxTask = ThreadPoolManager.schedule(new VictimSpawnKeyBox(this), 300000);
+ _victimSpawnKeyBoxTask = ThreadPool.schedule(new VictimSpawnKeyBox(this), 300000);
if (_victimShout != null)
{
_victimShout.cancel(true);
}
- _victimShout = ThreadPoolManager.schedule(new VictimShout(this), 5000);
+ _victimShout = ThreadPool.schedule(new VictimShout(this), 5000);
break;
}
case 18196:
@@ -126,7 +126,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_changeImmortalTask.cancel(true);
}
- _changeImmortalTask = ThreadPoolManager.schedule(new ChangeImmortal(this), 1600);
+ _changeImmortalTask = ThreadPool.schedule(new ChangeImmortal(this), 1600);
break;
}
case 18256:
@@ -191,7 +191,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_onDeadEventTask.cancel(true);
}
- _onDeadEventTask = ThreadPoolManager.schedule(new OnDeadEvent(this), 3500);
+ _onDeadEventTask = ThreadPool.schedule(new OnDeadEvent(this), 3500);
break;
}
case 18150:
@@ -217,7 +217,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_onDeadEventTask.cancel(true);
}
- _onDeadEventTask = ThreadPoolManager.schedule(new OnDeadEvent(this), 3500);
+ _onDeadEventTask = ThreadPool.schedule(new OnDeadEvent(this), 3500);
break;
}
case 18141:
@@ -235,7 +235,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_onDeadEventTask.cancel(true);
}
- _onDeadEventTask = ThreadPoolManager.schedule(new OnDeadEvent(this), 3500);
+ _onDeadEventTask = ThreadPool.schedule(new OnDeadEvent(this), 3500);
}
break;
}
@@ -267,7 +267,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_onDeadEventTask.cancel(true);
}
- _onDeadEventTask = ThreadPoolManager.schedule(new OnDeadEvent(this), 3500);
+ _onDeadEventTask = ThreadPool.schedule(new OnDeadEvent(this), 3500);
}
break;
}
@@ -281,7 +281,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
{
_onDeadEventTask.cancel(true);
}
- _onDeadEventTask = ThreadPoolManager.schedule(new OnDeadEvent(this), 8500);
+ _onDeadEventTask = ThreadPool.schedule(new OnDeadEvent(this), 8500);
break;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherNpcInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
index bfeaef2aa8..9a60e98883 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SepulcherNpcInstance.java
@@ -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.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.enums.ChatType;
@@ -206,7 +206,7 @@ public class L2SepulcherNpcInstance extends L2Npc
{
_spawnMonsterTask.cancel(true);
}
- _spawnMonsterTask = ThreadPoolManager.schedule(new SpawnMonster(getId()), 3500);
+ _spawnMonsterTask = ThreadPool.schedule(new SpawnMonster(getId()), 3500);
break;
}
case 31455:
@@ -361,12 +361,12 @@ public class L2SepulcherNpcInstance extends L2Npc
{
_closeTask.cancel(true);
}
- _closeTask = ThreadPoolManager.schedule(new CloseNextDoor(doorId), 10000);
+ _closeTask = ThreadPool.schedule(new CloseNextDoor(doorId), 10000);
if (_spawnNextMysteriousBoxTask != null)
{
_spawnNextMysteriousBoxTask.cancel(true);
}
- _spawnNextMysteriousBoxTask = ThreadPoolManager.schedule(new SpawnNextMysteriousBox(npcId), 0);
+ _spawnNextMysteriousBoxTask = ThreadPool.schedule(new SpawnNextMysteriousBox(npcId), 0);
}
private static class CloseNextDoor implements Runnable
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
index 5b0c30bb94..fb418967a0 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
@@ -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.data.sql.impl.CharSummonTable;
import com.l2jmobius.gameserver.data.sql.impl.SummonEffectsTable;
import com.l2jmobius.gameserver.datatables.SkillData;
@@ -79,7 +79,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
super.onSpawn();
if (_summonLifeTask == null)
{
- _summonLifeTask = ThreadPoolManager.scheduleAtFixedRate(this, 0, 5000);
+ _summonLifeTask = ThreadPool.scheduleAtFixedRate(this, 0, 5000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
index 9b94c5d479..dd9efc4e7c 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
@@ -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.CHSiegeManager;
@@ -201,7 +201,7 @@ public class L2SiegeFlagInstance extends L2Npc
// send warning to owners of headquarters that theirs base is under attack
_clan.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.YOUR_BASE_IS_BEING_ATTACKED));
setCanTalk(false);
- ThreadPoolManager.schedule(new ScheduleTalkTask(), 20000);
+ ThreadPool.schedule(new ScheduleTalkTask(), 20000);
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
index aea7027cc8..d073a0b69a 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
@@ -22,7 +22,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Future;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.datatables.SkillData;
@@ -152,7 +152,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);
}
}
@@ -216,10 +216,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
@@ -283,7 +283,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
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
index 2f9d7c83f2..cc680f51ae 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
@@ -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.model.actor.L2Attackable;
@@ -84,7 +84,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);
}
}
@@ -409,7 +409,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()
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/knownlist/NpcKnownList.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/knownlist/NpcKnownList.java
index 5b03b0439f..5cd4d0dab3 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/knownlist/NpcKnownList.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/knownlist/NpcKnownList.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.actor.knownlist;
import java.util.concurrent.ScheduledFuture;
-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.WalkingManager;
@@ -101,7 +101,7 @@ public class NpcKnownList extends CharKnownList
{
if ((_trackingTask == null) && (getActiveChar().getAggroRange() > 0))
{
- _trackingTask = ThreadPoolManager.scheduleAtFixedRate(new TrackingTask(), 2000, 2000);
+ _trackingTask = ThreadPool.scheduleAtFixedRate(new TrackingTask(), 2000, 2000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
index 5a821be2af..0cb675bb9e 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
@@ -22,7 +22,7 @@ import java.util.concurrent.Future;
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.stats.Formulas;
@@ -195,7 +195,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);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index d5afd42fd6..e5420c4eed 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -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
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
index 53aa3266d0..23586a561e 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
@@ -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)
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
index 6555a5f8dc..9fd11cdb88 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
@@ -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,6 +178,6 @@ public final class AutoAnnouncement extends Announcement implements Runnable
{
_currentState--;
}
- _task = ThreadPoolManager.schedule(this, _delay);
+ _task = ThreadPool.schedule(this, _delay);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/buylist/Product.java
index 4026634f99..bd61933376 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/buylist/Product.java
@@ -24,8 +24,8 @@ import java.util.concurrent.atomic.AtomicLong;
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.items.L2Item;
/**
@@ -113,7 +113,7 @@ public final class Product
}
if ((_restockTask == null) || _restockTask.isDone())
{
- _restockTask = ThreadPoolManager.schedule(new RestockTask(), getRestockDelay());
+ _restockTask = ThreadPool.schedule(new RestockTask(), getRestockDelay());
}
final boolean result = _count.addAndGet(-val) >= 0;
save();
@@ -130,7 +130,7 @@ public final class Product
final long remainTime = nextRestockTime - System.currentTimeMillis();
if (remainTime > 0)
{
- _restockTask = ThreadPoolManager.schedule(new RestockTask(), remainTime);
+ _restockTask = ThreadPool.schedule(new RestockTask(), remainTime);
}
else
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Auction.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Auction.java
index b6f2017849..429e350b8d 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Auction.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Auction.java
@@ -28,8 +28,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.sql.impl.ClanTable;
import com.l2jmobius.gameserver.enums.AuctionItemType;
import com.l2jmobius.gameserver.idfactory.IdFactory;
@@ -235,7 +235,7 @@ public class Auction
{
taskDelay = _endDate - currentTime;
}
- ThreadPoolManager.schedule(new AutoEndTask(), taskDelay);
+ ThreadPool.schedule(new AutoEndTask(), taskDelay);
}
public static String getItemTypeName(AuctionItemType value)
@@ -470,7 +470,7 @@ public class Auction
else
{
/** Task waiting ClanHallManager is loaded every 3s */
- ThreadPoolManager.schedule(new AutoEndTask(), 3000);
+ ThreadPool.schedule(new AutoEndTask(), 3000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
index f255b89a5d..34fe489bf1 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
@@ -25,7 +25,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.datatables.SkillData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.Team;
@@ -303,7 +303,7 @@ public final class BlockCheckerEngine
_abnormalEnd = true;
- ThreadPoolManager.execute(new EndEvent());
+ ThreadPool.execute(new EndEvent());
}
}
catch (Exception e)
@@ -420,7 +420,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
@@ -454,17 +454,17 @@ 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;
}
}
@@ -515,7 +515,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)
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Castle.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Castle.java
index 28b3db4c8d..5810503e9b 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Castle.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Castle.java
@@ -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.database.DatabaseFactory;
-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.SkillTreesData;
@@ -158,11 +158,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);
}
}
@@ -196,7 +196,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
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/ClanHall.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
index ce40169c6b..7b84b090ac 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
@@ -25,8 +25,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.sql.impl.ClanTable;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.StatsSet;
@@ -131,11 +131,11 @@ public abstract class ClanHall
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);
}
}
@@ -164,7 +164,7 @@ public abstract class ClanHall
{
ClanTable.getInstance().getClan(getOwnerId()).getWarehouse().destroyItemByItemId("CH_function_fee", Inventory.ADENA_ID, fee, null, null);
}
- ThreadPoolManager.schedule(new FunctionTask(true), getRate());
+ ThreadPool.schedule(new FunctionTask(true), getRate());
}
else
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/DimensionalRift.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/DimensionalRift.java
index f7eb05a223..0f38899bc8 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/DimensionalRift.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/DimensionalRift.java
@@ -24,7 +24,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Future;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.DimensionalRiftManager;
import com.l2jmobius.gameserver.instancemanager.QuestManager;
import com.l2jmobius.gameserver.model.L2Party;
@@ -173,7 +173,7 @@ public class DimensionalRift
final long jumpTime = calcTimeToNextJump();
teleporterTimer.schedule(teleporterTimerTask, jumpTime); // Teleporter task, 8-10 minutes
- earthQuakeTask = ThreadPoolManager.schedule(() ->
+ earthQuakeTask = ThreadPool.schedule(() ->
{
for (L2PcInstance p : _party.getMembers())
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Duel.java
index fb73121d69..751069ee2b 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Duel.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Duel.java
@@ -24,7 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
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.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.DuelResult;
import com.l2jmobius.gameserver.enums.Team;
@@ -98,7 +98,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
@@ -206,14 +206,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);
InstanceManager.getInstance().destroyInstance(_duel.getDueldInstanceId());
break;
}
@@ -251,11 +251,11 @@ public class Duel
_duel.teleportPlayers();
// give players 20 seconds to complete teleport and get ready (its ought to be 30 on official..)
- ThreadPoolManager.schedule(this, _duel.isPartyDuel() ? 20000 : 1);
+ ThreadPool.schedule(this, _duel.isPartyDuel() ? 20000 : 1);
}
else if (count > 0) // duel not started yet - continue countdown
{
- ThreadPoolManager.schedule(this, 1000);
+ ThreadPool.schedule(this, 1000);
}
else
{
@@ -461,7 +461,7 @@ public class Duel
broadcastToTeam2(B04_S01);
// start duelling task
- ThreadPoolManager.schedule(new ScheduleDuelTask(this), 1000);
+ ThreadPool.schedule(new ScheduleDuelTask(this), 1000);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Fort.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Fort.java
index 45c9c89add..5bc0ae3465 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Fort.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Fort.java
@@ -34,10 +34,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);
}
}
@@ -199,7 +199,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
{
@@ -268,7 +268,7 @@ public final class Fort extends AbstractResidence
public void endOfSiege(L2Clan clan)
{
- ThreadPoolManager.execute(new endFortressSiege(this, clan));
+ ThreadPool.execute(new endFortressSiege(this, clan));
}
/**
@@ -587,15 +587,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
@@ -820,10 +820,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
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/FortSiege.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
index a618b08f25..188a32c8c5 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
@@ -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.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;
@@ -112,7 +112,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
{
@@ -120,49 +120,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
getSiegeGuardManager().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)
@@ -338,7 +338,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());
@@ -664,7 +664,7 @@ public class FortSiege implements Siegable
getFort().getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.THE_BARRACKS_HAVE_BEEN_SEIZED));
if (_siegeRestore == null)
{
- _siegeRestore = ThreadPoolManager.schedule(new ScheduleSiegeRestore(), FortSiegeManager.getInstance().getCountDownLength() * 60 * 1000L);
+ _siegeRestore = ThreadPool.schedule(new ScheduleSiegeRestore(), FortSiegeManager.getInstance().getCountDownLength() * 60 * 1000L);
}
}
}
@@ -828,7 +828,7 @@ public class FortSiege implements Siegable
saveFortSiege();
clearSiegeClan(); // remove all clans
// spawn suspicious merchant immediately
- ThreadPoolManager.execute(new ScheduleSuspiciousMerchantSpawn());
+ ThreadPool.execute(new ScheduleSuspiciousMerchantSpawn());
}
else
{
@@ -836,33 +836,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("Siege of " + getFort().getName() + " fort: " + getFort().getSiegeDate().getTime());
@@ -892,7 +892,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);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Instance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Instance.java
index ee36c76dfc..ae9606adc4 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Instance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Instance.java
@@ -37,7 +37,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -197,7 +197,7 @@ public final class Instance
_checkTimeUpTask.cancel(true);
}
- _checkTimeUpTask = ThreadPoolManager.schedule(new CheckTimeUp(duration), 500);
+ _checkTimeUpTask = ThreadPool.schedule(new CheckTimeUp(duration), 500);
_instanceEndTime = System.currentTimeMillis() + duration + 500;
}
@@ -494,7 +494,7 @@ public final class Instance
a = n.getAttributes().getNamedItem("val");
if (a != null)
{
- _checkTimeUpTask = ThreadPoolManager.schedule(new CheckTimeUp(Integer.parseInt(a.getNodeValue()) * 60000), 15000);
+ _checkTimeUpTask = ThreadPool.schedule(new CheckTimeUp(Integer.parseInt(a.getNodeValue()) * 60000), 15000);
_instanceEndTime = System.currentTimeMillis() + (Long.parseLong(a.getNodeValue()) * 60000) + 15000;
}
break;
@@ -845,11 +845,11 @@ public final class Instance
cancelTimer();
if (remaining >= 10000)
{
- _checkTimeUpTask = ThreadPoolManager.schedule(new CheckTimeUp(remaining), interval);
+ _checkTimeUpTask = ThreadPool.schedule(new CheckTimeUp(remaining), interval);
}
else
{
- _checkTimeUpTask = ThreadPoolManager.schedule(new TimeUp(), interval);
+ _checkTimeUpTask = ThreadPool.schedule(new TimeUp(), interval);
}
}
@@ -874,7 +874,7 @@ public final class Instance
{
if (player != null)
{
- _ejectDeadTasks.put(player.getObjectId(), ThreadPoolManager.schedule(() ->
+ _ejectDeadTasks.put(player.getObjectId(), ThreadPool.schedule(() ->
{
if (player.isDead() && (player.getInstanceId() == getId()))
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Message.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Message.java
index 9aa371e2e1..ad0e88cfff 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Message.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Message.java
@@ -22,7 +22,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.concurrent.ScheduledFuture;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.instancemanager.MailManager;
@@ -145,7 +145,7 @@ public class Message
_attachments = msg.getAttachments();
msg.removeAttachments();
_attachments.setNewMessageId(_messageId);
- _unloadTask = ThreadPoolManager.schedule(new AttachmentsUnloadTask(this), UNLOAD_ATTACHMENTS_INTERVAL + Rnd.get(UNLOAD_ATTACHMENTS_INTERVAL));
+ _unloadTask = ThreadPool.schedule(new AttachmentsUnloadTask(this), UNLOAD_ATTACHMENTS_INTERVAL + Rnd.get(UNLOAD_ATTACHMENTS_INTERVAL));
}
public static PreparedStatement getStatement(Message msg, Connection con) throws SQLException
@@ -330,7 +330,7 @@ public class Message
{
_attachments = new Mail(_senderId, _messageId);
_attachments.restore();
- _unloadTask = ThreadPoolManager.schedule(new AttachmentsUnloadTask(this), UNLOAD_ATTACHMENTS_INTERVAL + Rnd.get(UNLOAD_ATTACHMENTS_INTERVAL));
+ _unloadTask = ThreadPool.schedule(new AttachmentsUnloadTask(this), UNLOAD_ATTACHMENTS_INTERVAL + Rnd.get(UNLOAD_ATTACHMENTS_INTERVAL));
}
return _attachments;
}
@@ -364,7 +364,7 @@ public class Message
_attachments = new Mail(_senderId, _messageId);
_hasAttachments = true;
- _unloadTask = ThreadPoolManager.schedule(new AttachmentsUnloadTask(this), UNLOAD_ATTACHMENTS_INTERVAL + Rnd.get(UNLOAD_ATTACHMENTS_INTERVAL));
+ _unloadTask = ThreadPool.schedule(new AttachmentsUnloadTask(this), UNLOAD_ATTACHMENTS_INTERVAL + Rnd.get(UNLOAD_ATTACHMENTS_INTERVAL));
return _attachments;
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/NevitSystem.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/NevitSystem.java
index 8900184549..e19bd399ba 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/NevitSystem.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/NevitSystem.java
@@ -21,7 +21,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventType;
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
@@ -147,7 +147,7 @@ public class NevitSystem implements IUniqueId
{
if ((_adventTask == null) && (getAdventTime() < Config.NEVIT_ADVENT_TIME))
{
- _adventTask = ThreadPoolManager.schedule(new AdventTask(), 30000);
+ _adventTask = ThreadPool.schedule(new AdventTask(), 30000);
getPlayer().sendPacket(new ExNevitAdventTimeChange(getAdventTime(), false));
}
}
@@ -203,7 +203,7 @@ public class NevitSystem implements IUniqueId
getPlayer().sendPacket(new ExNevitAdventEffect(time));
getPlayer().sendPacket(SystemMessageId.THE_ANGEL_NEVIT_HAS_BLESSED_YOU_FROM_ABOVE_YOU_ARE_IMBUED_WITH_FULL_VITALITY_AS_WELL_AS_A_VITALITY_REPLENISHING_EFFECT_AND_SHOULD_YOU_DIE_YOU_WILL_NOT_LOSE_EXP);
getPlayer().startAbnormalVisualEffect(true, AbnormalVisualEffect.NAVIT_ADVENT);
- _nevitEffectTask = ThreadPoolManager.schedule(new NevitEffectEnd(), time * 1000L);
+ _nevitEffectTask = ThreadPool.schedule(new NevitEffectEnd(), time * 1000L);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Siege.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Siege.java
index 73e4564bc4..893026d2a7 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Siege.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Siege.java
@@ -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.data.xml.impl.SiegeScheduleData;
import com.l2jmobius.gameserver.enums.SiegeTeleportWhoType;
@@ -102,35 +102,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
{
@@ -169,7 +169,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);
@@ -178,7 +178,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))
{
@@ -187,23 +187,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
{
@@ -514,7 +514,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());
@@ -1027,7 +1027,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);
}
/**
@@ -1344,7 +1344,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();
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTEventTeleporter.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTEventTeleporter.java
index 59bfe47899..0a44cf4ec1 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTEventTeleporter.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTEventTeleporter.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.entity;
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.model.actor.L2Summon;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -45,7 +45,7 @@ public class TvTEventTeleporter implements Runnable
_coordinates = coordinates;
_adminRemove = adminRemove;
- ThreadPoolManager.schedule(this, fastSchedule ? 0 : (TvTEvent.isStarted() ? Config.TVT_EVENT_RESPAWN_TELEPORT_DELAY : Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY) * 1000);
+ ThreadPool.schedule(this, fastSchedule ? 0 : (TvTEvent.isStarted() ? Config.TVT_EVENT_RESPAWN_TELEPORT_DELAY : Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY) * 1000);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTManager.java
index cc3795d736..6675acf114 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTManager.java
@@ -21,7 +21,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.util.Broadcast;
/**
@@ -96,7 +96,7 @@ public class TvTManager
if (nextStartTime != null)
{
_task = new TvTStartTask(nextStartTime.getTimeInMillis());
- ThreadPoolManager.execute(_task);
+ ThreadPool.execute(_task);
}
}
catch (Exception e)
@@ -123,7 +123,7 @@ public class TvTManager
// schedule registration end
_task.setStartTime(System.currentTimeMillis() + (60000L * Config.TVT_EVENT_PARTICIPATION_TIME));
- ThreadPoolManager.execute(_task);
+ ThreadPool.execute(_task);
}
}
@@ -143,7 +143,7 @@ public class TvTManager
{
TvTEvent.sysMsgToAllParticipants("TvT Event: Teleporting participants to an arena in " + Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY + " second(s).");
_task.setStartTime(System.currentTimeMillis() + (60000L * Config.TVT_EVENT_RUNNING_TIME));
- ThreadPoolManager.execute(_task);
+ ThreadPool.execute(_task);
}
}
@@ -164,7 +164,7 @@ public class TvTManager
if (_task.nextRun.cancel(false))
{
_task.setStartTime(System.currentTimeMillis());
- ThreadPoolManager.execute(_task);
+ ThreadPool.execute(_task);
}
}
@@ -245,7 +245,7 @@ public class TvTManager
if (delay > 0)
{
- nextRun = ThreadPoolManager.schedule(this, nextMsg * 1000);
+ nextRun = ThreadPool.schedule(this, nextMsg * 1000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/clanhall/AuctionableHall.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/clanhall/AuctionableHall.java
index f883e51b97..37eacd5ad7 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/clanhall/AuctionableHall.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/clanhall/AuctionableHall.java
@@ -21,8 +21,8 @@ import java.sql.PreparedStatement;
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.sql.impl.ClanTable;
import com.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import com.l2jmobius.gameserver.instancemanager.ClanHallManager;
@@ -111,22 +111,22 @@ public final class AuctionableHall extends ClanHall
final long currentTime = System.currentTimeMillis();
if (_paidUntil > currentTime)
{
- ThreadPoolManager.schedule(new FeeTask(), _paidUntil - currentTime);
+ ThreadPool.schedule(new FeeTask(), _paidUntil - currentTime);
}
else if (!_paid && !forced)
{
if ((System.currentTimeMillis() + (3600000 * 24)) <= (_paidUntil + _chRate))
{
- ThreadPoolManager.schedule(new FeeTask(), System.currentTimeMillis() + (3600000 * 24));
+ ThreadPool.schedule(new FeeTask(), System.currentTimeMillis() + (3600000 * 24));
}
else
{
- ThreadPoolManager.schedule(new FeeTask(), (_paidUntil + _chRate) - System.currentTimeMillis());
+ ThreadPool.schedule(new FeeTask(), (_paidUntil + _chRate) - System.currentTimeMillis());
}
}
else
{
- ThreadPoolManager.schedule(new FeeTask(), 0);
+ ThreadPool.schedule(new FeeTask(), 0);
}
}
@@ -149,7 +149,7 @@ public final class AuctionableHall extends ClanHall
if (_paidUntil > _time)
{
- ThreadPoolManager.schedule(new FeeTask(), _paidUntil - _time);
+ ThreadPool.schedule(new FeeTask(), _paidUntil - _time);
return;
}
@@ -168,7 +168,7 @@ public final class AuctionableHall extends ClanHall
_paidUntil = _time + _chRate;
}
ClanTable.getInstance().getClan(getOwnerId()).getWarehouse().destroyItemByItemId("CH_rental_fee", Inventory.ADENA_ID, getLease(), null, null);
- ThreadPoolManager.schedule(new FeeTask(), _paidUntil - _time);
+ ThreadPool.schedule(new FeeTask(), _paidUntil - _time);
_paid = true;
updateDb();
}
@@ -185,7 +185,7 @@ public final class AuctionableHall extends ClanHall
}
else
{
- ThreadPoolManager.schedule(new FeeTask(), 3000);
+ ThreadPool.schedule(new FeeTask(), 3000);
}
}
else
@@ -196,11 +196,11 @@ public final class AuctionableHall extends ClanHall
Clan.broadcastToOnlineMembers(sm);
if ((_time + (3600000 * 24)) <= (_paidUntil + _chRate))
{
- ThreadPoolManager.schedule(new FeeTask(), _time + (3600000 * 24));
+ ThreadPool.schedule(new FeeTask(), _time + (3600000 * 24));
}
else
{
- ThreadPoolManager.schedule(new FeeTask(), (_paidUntil + _chRate) - _time);
+ ThreadPool.schedule(new FeeTask(), (_paidUntil + _chRate) - _time);
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/clanhall/ClanHallSiegeEngine.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/clanhall/ClanHallSiegeEngine.java
index 5294226cf8..88283237e0 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/clanhall/ClanHallSiegeEngine.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/clanhall/ClanHallSiegeEngine.java
@@ -30,8 +30,8 @@ import java.util.concurrent.ScheduledFuture;
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.instancemanager.CHSiegeManager;
@@ -86,7 +86,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
_hall = CHSiegeManager.getInstance().getSiegableHall(hallId);
_hall.setSiege(this);
- _siegeTask = ThreadPoolManager.schedule(new PrepareOwner(), _hall.getNextSiegeTime() - System.currentTimeMillis() - 3600000);
+ _siegeTask = ThreadPool.schedule(new PrepareOwner(), _hall.getNextSiegeTime() - System.currentTimeMillis() - 3600000);
_log.config(_hall.getName() + " siege scheduled for " + getSiegeDate().getTime() + ".");
loadAttackers();
}
@@ -294,7 +294,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
Broadcast.toAllOnlinePlayers(msg);
_hall.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
- _siegeTask = ThreadPoolManager.schedule(new SiegeStarts(), 3600000);
+ _siegeTask = ThreadPool.schedule(new SiegeStarts(), 3600000);
}
@Override
@@ -305,7 +305,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
onSiegeEnds();
_attackers.clear();
_hall.updateNextSiege();
- _siegeTask = ThreadPoolManager.schedule(new PrepareOwner(), _hall.getSiegeDate().getTimeInMillis());
+ _siegeTask = ThreadPool.schedule(new PrepareOwner(), _hall.getSiegeDate().getTimeInMillis());
_hall.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_SIEGE_OF_S1_HAS_BEEN_CANCELED_DUE_TO_LACK_OF_INTEREST);
sm.addString(_hall.getName());
@@ -337,7 +337,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
_hall.updateSiegeStatus(SiegeStatus.RUNNING);
onSiegeStarts();
- _siegeTask = ThreadPoolManager.schedule(new SiegeEnds(), _hall.getSiegeLenght());
+ _siegeTask = ThreadPool.schedule(new SiegeEnds(), _hall.getSiegeLenght());
}
@Override
@@ -399,7 +399,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
onSiegeEnds();
- _siegeTask = ThreadPoolManager.schedule(new PrepareOwner(), _hall.getNextSiegeTime() - System.currentTimeMillis() - 3600000);
+ _siegeTask = ThreadPool.schedule(new PrepareOwner(), _hall.getNextSiegeTime() - System.currentTimeMillis() - 3600000);
_log.config("Siege of " + _hall.getName() + " scheduled for " + _hall.getSiegeDate().getTime() + ".");
_hall.updateSiegeStatus(SiegeStatus.REGISTERING);
@@ -410,7 +410,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
public void updateSiege()
{
cancelSiegeTask();
- _siegeTask = ThreadPoolManager.schedule(new PrepareOwner(), _hall.getNextSiegeTime() - 3600000);
+ _siegeTask = ThreadPool.schedule(new PrepareOwner(), _hall.getNextSiegeTime() - 3600000);
_log.config(_hall.getName() + " siege scheduled for " + _hall.getSiegeDate().getTime() + ".");
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/event/LongTimeEvent.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/event/LongTimeEvent.java
index a3da052091..4e49a61eee 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/event/LongTimeEvent.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/event/LongTimeEvent.java
@@ -30,7 +30,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.sql.impl.AnnouncementsTable;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.datatables.EventDroplist;
@@ -92,7 +92,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.getStartDate());
}
else
@@ -283,7 +283,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);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
index 839cd18af5..f07cb0557b 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
@@ -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);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/fishing/L2Fishing.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/fishing/L2Fishing.java
index 823293d7b7..c9fdcb1944 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/fishing/L2Fishing.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/fishing/L2Fishing.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.fishing;
import java.util.concurrent.Future;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.FishingMonstersData;
import com.l2jmobius.gameserver.instancemanager.FishingChampionshipManager;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -106,7 +106,7 @@ public class L2Fishing implements Runnable
if (_fishAiTask == null)
{
- _fishAiTask = ThreadPoolManager.scheduleAtFixedRate(this, 1000, 1000);
+ _fishAiTask = ThreadPool.scheduleAtFixedRate(this, 1000, 1000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index b0eb96aedc..eb4d01c424 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -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.instancemanager.ItemAuctionManager;
import com.l2jmobius.gameserver.model.ItemInfo;
import com.l2jmobius.gameserver.model.L2World;
@@ -395,7 +395,7 @@ public final class ItemAuction
public final void broadcastToAllBidders(L2GameServerPacket packet)
{
- ThreadPoolManager.execute(() -> broadcastToAllBiddersInternal(packet));
+ ThreadPool.execute(() -> broadcastToAllBiddersInternal(packet));
}
public final void broadcastToAllBiddersInternal(L2GameServerPacket packet)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index aaf5aa5479..1fe09fd1c2 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -39,8 +39,8 @@ 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.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
import com.l2jmobius.gameserver.enums.ItemLocation;
import com.l2jmobius.gameserver.instancemanager.ItemAuctionManager;
@@ -323,17 +323,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)));
}
_log.log(Level.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)));
_log.log(Level.INFO, getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
}
}
@@ -416,7 +416,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;
@@ -426,7 +426,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;
@@ -436,7 +436,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;
@@ -446,7 +446,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;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 0c496184e0..4f7670a186 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -32,8 +32,8 @@ import java.util.logging.LogRecord;
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.EnchantItemOptionsData;
import com.l2jmobius.gameserver.data.xml.impl.OptionData;
import com.l2jmobius.gameserver.datatables.ItemTable;
@@ -1371,7 +1371,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);
}
/**
@@ -1583,7 +1583,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
@@ -1864,7 +1864,7 @@ public final class L2ItemInstance extends L2Object
{
_lifeTimeTask.cancel(false);
}
- _lifeTimeTask = ThreadPoolManager.schedule(new ScheduleLifeTimeTask(this), getRemainingTime());
+ _lifeTimeTask = ThreadPool.schedule(new ScheduleLifeTimeTask(this), getRemainingTime());
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
index c80fc596ef..9a14558dc3 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -37,8 +37,8 @@ import java.util.logging.LogRecord;
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.AntiFeedManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.StatsSet;
@@ -236,7 +236,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
{
@@ -420,7 +420,7 @@ public class Olympiad extends ListenersContainer
_scheduledOlympiadEnd.cancel(true);
}
- _scheduledOlympiadEnd = ThreadPoolManager.schedule(new OlympiadEndTask(HEROS_TO_BE), getMillisToOlympiadEnd());
+ _scheduledOlympiadEnd = ThreadPool.schedule(new OlympiadEndTask(HEROS_TO_BE), getMillisToOlympiadEnd());
updateCompStatus();
}
@@ -462,7 +462,7 @@ public class Olympiad extends ListenersContainer
_validationEnd = validationEnd.getTimeInMillis() + VALIDATION_PERIOD;
loadNoblesRank();
- _scheduledValdationTask = ThreadPoolManager.schedule(new ValidationEndTask(), getMillisToValidationEnd());
+ _scheduledValdationTask = ThreadPool.schedule(new ValidationEndTask(), getMillisToValidationEnd());
}
}
@@ -510,7 +510,7 @@ public class Olympiad extends ListenersContainer
_log.info("Olympiad System: Event starts/started : " + _compStart.getTime());
}
- _scheduledCompStart = ThreadPoolManager.schedule(() ->
+ _scheduledCompStart = ThreadPool.schedule(() ->
{
if (isOlympiadEnd())
{
@@ -523,19 +523,19 @@ public class Olympiad extends ListenersContainer
_log.info("Olympiad System: Olympiad Game 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_GRAND_OLYMPIAD_REGISTRATION_PERIOD_HAS_ENDED)), regEnd);
+ ThreadPool.schedule(() -> Broadcast.toAllOnlinePlayers(SystemMessage.getSystemMessage(SystemMessageId.THE_GRAND_OLYMPIAD_REGISTRATION_PERIOD_HAS_ENDED)), regEnd);
}
- _scheduledCompEnd = ThreadPoolManager.schedule(() ->
+ _scheduledCompEnd = ThreadPool.schedule(() ->
{
if (isOlympiadEnd())
{
@@ -590,7 +590,7 @@ public class Olympiad extends ListenersContainer
_scheduledOlympiadEnd.cancel(true);
}
- _scheduledOlympiadEnd = ThreadPoolManager.schedule(new OlympiadEndTask(HEROS_TO_BE), 0);
+ _scheduledOlympiadEnd = ThreadPool.schedule(new OlympiadEndTask(HEROS_TO_BE), 0);
}
protected long getMillisToValidationEnd()
@@ -769,7 +769,7 @@ public class Olympiad extends ListenersContainer
private void scheduleWeeklyChange()
{
- _scheduledWeeklyTask = ThreadPoolManager.scheduleAtFixedRate(() ->
+ _scheduledWeeklyTask = ThreadPool.scheduleAtFixedRate(() ->
{
addWeeklyPoints();
_log.info("Olympiad System: Added weekly points to nobles");
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index a7ba9dbe2b..c00d4fef95 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -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.model.zone.type.L2OlympiadStadiumZone;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
@@ -160,7 +160,7 @@ public final class OlympiadGameTask implements Runnable
_game = game;
_state = GameState.BEGIN;
_needAnnounce = false;
- ThreadPoolManager.execute(this);
+ ThreadPool.execute(this);
}
@Override
@@ -315,7 +315,7 @@ public final class OlympiadGameTask implements Runnable
return;
}
}
- ThreadPoolManager.schedule(this, delay * 1000);
+ ThreadPool.schedule(this, delay * 1000);
}
catch (Exception e)
{
@@ -335,7 +335,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);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
index 00aebfb739..c22c4694be 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
@@ -405,7 +405,7 @@ public class OlympiadManager
if ((team != null) && team.contains(objId))
{
_teamsBasedRegisters.remove(team);
- ThreadPoolManager.execute(new AnnounceUnregToTeam(team));
+ ThreadPool.execute(new AnnounceUnregToTeam(team));
return true;
}
}
@@ -437,7 +437,7 @@ public class OlympiadManager
if ((team != null) && team.contains(objId))
{
_teamsBasedRegisters.remove(team);
- ThreadPoolManager.execute(new AnnounceUnregToTeam(team));
+ ThreadPool.execute(new AnnounceUnregToTeam(team));
return;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index e05e552be6..0e154808dc 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -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());
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
index 907874a312..ada031aaa8 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
@@ -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)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index fbadb34ed1..c6149abf7c 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -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;
@@ -253,7 +253,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);
}
boolean update = false;
@@ -272,7 +272,7 @@ public final class BuffInfo
{
// The task for the effect ticks.
final EffectTickTask effectTask = new EffectTickTask(this, effect);
- addTask(effect, new EffectTaskInfo(effectTask, ThreadPoolManager.scheduleAtFixedRate(effectTask, effect.getTicks() * Config.EFFECT_TICK_RATIO, effect.getTicks() * Config.EFFECT_TICK_RATIO)));
+ addTask(effect, new EffectTaskInfo(effectTask, ThreadPool.scheduleAtFixedRate(effectTask, effect.getTicks() * Config.EFFECT_TICK_RATIO, effect.getTicks() * Config.EFFECT_TICK_RATIO)));
}
// Add stats.
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
index fbf7c85e3c..dc51ec92f1 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
@@ -21,7 +21,7 @@ import java.util.List;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.ShotType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -77,7 +77,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()
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
index d6fe0ba3b4..5ad79552e0 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
@@ -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;
@@ -115,7 +115,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));
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2DynamicZone.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2DynamicZone.java
index 867569f6c3..7346a70f73 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2DynamicZone.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2DynamicZone.java
@@ -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.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2WorldRegion;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -44,7 +44,7 @@ public class L2DynamicZone extends L2ZoneType
final AbstractZoneSettings settings = ZoneManager.getSettings(getName()) == null ? new TaskZoneSettings() : ZoneManager.getSettings(getName());
setSettings(settings);
- getSettings().setTask(ThreadPoolManager.schedule(() -> remove(), skill.getAbnormalTime() * 1000));
+ getSettings().setTask(ThreadPool.schedule(() -> remove(), skill.getAbnormalTime() * 1000));
}
@Override
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
index 2f335e7536..9f59b0dc4b 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
@@ -20,7 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -130,7 +130,7 @@ public class L2EffectZone extends L2ZoneType
{
synchronized (this)
{
- getSettings().setTask(ThreadPoolManager.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
+ getSettings().setTask(ThreadPool.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
}
}
if (!character.isPlayer())
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
index d3f5e67199..f68a48f158 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -78,7 +78,7 @@ public class L2JailZone extends L2ZoneType
if (player.isJailed())
{
// when a player wants to exit jail even if he is still jailed, teleport him back to jail
- ThreadPoolManager.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
+ ThreadPool.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
character.sendMessage("You cannot cheat your way out of here. You must wait until your jail time is over.");
}
if (Config.JAIL_DISABLE_TRANSACTION)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
index e97a7a1cb3..2d49af1600 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.ArrayList;
import java.util.List;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
@@ -180,7 +180,7 @@ public class L2OlympiadStadiumZone extends L2ZoneRespawn
// only participants, observers and GMs allowed
if (!player.canOverrideCond(PcCondOverride.ZONE_CONDITIONS) && !player.isInOlympiadMode() && !player.inObserverMode())
{
- ThreadPoolManager.execute(new KickPlayer(player));
+ ThreadPool.execute(new KickPlayer(player));
}
else
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
index 3ef40f4f63..8fc52c30bf 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.concurrent.ScheduledFuture;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.util.Rnd;
@@ -62,7 +62,7 @@ public class L2ResidenceHallTeleportZone extends L2ResidenceTeleportZone
{
if ((_teleTask == null) || _teleTask.isDone())
{
- _teleTask = ThreadPoolManager.schedule(new TeleportTask(), 30000);
+ _teleTask = ThreadPool.schedule(new TeleportTask(), 30000);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/L2GameClient.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/L2GameClient.java
index 404d03cb44..149500799d 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/L2GameClient.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/L2GameClient.java
@@ -33,13 +33,13 @@ import java.util.logging.LogRecord;
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.mmocore.MMOClient;
import com.l2jmobius.commons.mmocore.MMOConnection;
import com.l2jmobius.commons.mmocore.ReceivablePacket;
import com.l2jmobius.gameserver.LoginServerThread;
import com.l2jmobius.gameserver.LoginServerThread.SessionKey;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
@@ -131,7 +131,7 @@ public final class L2GameClient extends MMOClient> i
if (Config.CHAR_STORE_INTERVAL > 0)
{
- _autoSaveInDB = ThreadPoolManager.scheduleAtFixedRate(new AutoSaveTask(), 300000L, Config.CHAR_STORE_INTERVAL * 60000L);
+ _autoSaveInDB = ThreadPool.scheduleAtFixedRate(new AutoSaveTask(), 300000L, Config.CHAR_STORE_INTERVAL * 60000L);
}
else
{
@@ -702,7 +702,7 @@ public final class L2GameClient extends MMOClient> i
// no long running tasks here, do it async
try
{
- ThreadPoolManager.execute(new DisconnectTask());
+ ThreadPool.execute(new DisconnectTask());
}
catch (RejectedExecutionException e)
{
@@ -723,7 +723,7 @@ public final class L2GameClient extends MMOClient> i
{
cancelCleanup();
}
- _cleanupTask = ThreadPoolManager.schedule(new CleanupTask(), 0); // instant
+ _cleanupTask = ThreadPool.schedule(new CleanupTask(), 0); // instant
}
}
@@ -875,7 +875,7 @@ public final class L2GameClient extends MMOClient> i
{
if (_cleanupTask == null)
{
- _cleanupTask = ThreadPoolManager.schedule(new CleanupTask(), fast ? 5 : 15000L);
+ _cleanupTask = ThreadPool.schedule(new CleanupTask(), fast ? 5 : 15000L);
}
}
}
@@ -1092,11 +1092,11 @@ public final class L2GameClient extends MMOClient> i
closeNow();
return;
}
- ThreadPoolManager.execute(this);
+ ThreadPool.execute(this);
}
else
{
- ThreadPoolManager.execute(this);
+ ThreadPool.execute(this);
}
}
catch (RejectedExecutionException e)
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
index 88c0ed0af6..9781efdea5 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
@@ -21,7 +21,7 @@ import java.util.Map;
import java.util.logging.Level;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -237,7 +237,7 @@ public final class RequestPreviewItem extends L2GameClientPacket
{
activeChar.sendPacket(new ShopPreviewInfo(itemList));
// Schedule task
- ThreadPoolManager.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
+ ThreadPool.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
}
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 99be81f859..c8d838a9e8 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -16,7 +16,7 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.CHSiegeManager;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.ClanHallManager;
@@ -96,7 +96,7 @@ public final class RequestRestartPoint extends L2GameClientPacket
if ((activeChar.getClan() != null) && castle.getSiege().checkIsAttacker(activeChar.getClan()))
{
// Schedule respawn delay for attacker
- ThreadPoolManager.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
+ ThreadPool.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
if (castle.getSiege().getAttackerRespawnDelay() > 0)
{
activeChar.sendMessage("You will be re-spawned in " + (castle.getSiege().getAttackerRespawnDelay() / 1000) + " seconds");
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
index b84a184a17..3caf1b8f4c 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -20,7 +20,7 @@ import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import com.l2jmobius.Config;
-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;
@@ -312,7 +312,7 @@ public final class UseItem extends L2GameClientPacket
}
else if (activeChar.isAttackingNow())
{
- ThreadPoolManager.schedule(new WeaponEquipTask(item, activeChar), TimeUnit.MILLISECONDS.convert(activeChar.getAttackEndTime() - System.nanoTime(), TimeUnit.NANOSECONDS));
+ ThreadPool.schedule(new WeaponEquipTask(item, activeChar), TimeUnit.MILLISECONDS.convert(activeChar.getAttackEndTime() - System.nanoTime(), TimeUnit.NANOSECONDS));
}
else
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 92d2871dac..873133bd06 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -22,7 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
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.L2CubicInstance;
import com.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -42,7 +42,7 @@ public class AttackStanceTaskManager
*/
protected AttackStanceTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
+ ThreadPool.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index c72861e7c3..1fe236157c 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
@@ -65,7 +65,7 @@ public final class DecayTaskManager
if (!_decayTasks.containsKey(character))
{
- _decayTasks.put(character, ThreadPoolManager.schedule(new DecayTask(character), delay * 1000));
+ _decayTasks.put(character, ThreadPool.schedule(new DecayTask(character), delay * 1000));
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/KnownListUpdateTaskManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/KnownListUpdateTaskManager.java
index 7dfbecdcfe..5fafeed338 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/KnownListUpdateTaskManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/KnownListUpdateTaskManager.java
@@ -22,7 +22,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.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.L2WorldRegion;
@@ -44,7 +44,7 @@ public class KnownListUpdateTaskManager
protected KnownListUpdateTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new KnownListUpdate(), 1000, Config.KNOWNLIST_UPDATE_INTERVAL);
+ ThreadPool.scheduleAtFixedRate(new KnownListUpdate(), 1000, Config.KNOWNLIST_UPDATE_INTERVAL);
}
private class KnownListUpdate implements Runnable
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
index 21cb40e0e6..3da48d0819 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -35,8 +35,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.taskmanager.tasks.TaskBirthday;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskClanLeaderApply;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
@@ -243,14 +243,14 @@ public final class TaskManager
case TYPE_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
- task.scheduled = ThreadPoolManager.schedule(task, delay);
+ task.scheduled = ThreadPool.schedule(task, delay);
return true;
}
case TYPE_FIXED_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
interval = Long.valueOf(task.getParams()[1]);
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
case TYPE_TIME:
@@ -261,7 +261,7 @@ public final class TaskManager
final long diff = desired.getTime() - System.currentTimeMillis();
if (diff >= 0)
{
- task.scheduled = ThreadPoolManager.schedule(task, diff);
+ task.scheduled = ThreadPool.schedule(task, diff);
return true;
}
_log.info(getClass().getSimpleName() + ": Task " + task.getId() + " is obsoleted.");
@@ -314,7 +314,7 @@ public final class TaskManager
{
delay += interval;
}
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
default:
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/Evolve.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/Evolve.java
index 2b9ea5bdbb..ac9754a79d 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/Evolve.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/Evolve.java
@@ -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.database.DatabaseFactory;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.PetDataTable;
import com.l2jmobius.gameserver.model.L2PetData;
@@ -143,11 +143,11 @@ public final class Evolve
petSummon.startFeed();
item.setEnchantLevel(petSummon.getLevel());
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
@@ -240,11 +240,11 @@ public final class Evolve
final L2World world = L2World.getInstance();
world.removeObject(removedItem);
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/MinionList.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/MinionList.java
index 597a468faa..643cb3f930 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/MinionList.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/MinionList.java
@@ -20,7 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -141,7 +141,7 @@ public class MinionList
final int time = respawnTime < 0 ? _master.isRaid() ? (int) Config.RAID_MINION_RESPAWN_TIMER : 0 : respawnTime;
if ((time > 0) && !_master.isAlikeDead())
{
- ThreadPoolManager.schedule(new MinionRespawnTask(minion), time);
+ ThreadPool.schedule(new MinionRespawnTask(minion), time);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/Util.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/Util.java
index 0c6a3d6e25..d17fca322c 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/Util.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/util/Util.java
@@ -30,7 +30,7 @@ import java.util.StringTokenizer;
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.HtmlActionScope;
import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -54,7 +54,7 @@ public final class Util
public static void handleIllegalPlayerAction(L2PcInstance actor, String message, IllegalActionPunishmentType punishment)
{
- ThreadPoolManager.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
+ ThreadPool.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
}
public static String getRelativePath(File base, File file)
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index 6c0a28cefe..d66ecbb53e 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -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;
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/events/Elpies/Elpies.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/events/Elpies/Elpies.java
index 604b5bcff8..4ca3d1df97 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/events/Elpies/Elpies.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/events/Elpies/Elpies.java
@@ -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();
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/events/Race/Race.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/events/Race/Race.java
index 8af01c7b29..19f2f42bae 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/events/Race/Race.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/events/Race/Race.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
index b64a8a1504..0bcd0b583d 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
@@ -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);
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
index aafd3af59a..3921811d6c 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
@@ -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();
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/playeractions/SocialAction.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/playeractions/SocialAction.java
index 63f58d424d..f7db8c36f7 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/playeractions/SocialAction.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/playeractions/SocialAction.java
@@ -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;
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 6618f26888..db9e7a1a83 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -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();
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
index 612ca5cdc7..50a74f01fa 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
@@ -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");
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
index 4ca843967c..c165b2658d 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
@@ -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);
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
index 0ae4d70bdf..f0e18f6b8d 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
@@ -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);
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
index 7f2ed62f90..856942597c 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
@@ -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;
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/concurrent/ThreadPool.java
new file mode 100644
index 0000000000..63b620ce4e
--- /dev/null
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/concurrent/ThreadPool.java
@@ -0,0 +1,299 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.commons.concurrent;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Logger;
+
+import com.l2jmobius.Config;
+
+/**
+ * This class handles thread pooling system. It relies on two ThreadPoolExecutor arrays, which poolers number is generated using config.
+ *
+ * Those arrays hold following pools :
+ *
+ *
+ * - Scheduled pool keeps a track about incoming, future events.
+ * - Instant pool handles short-life events.
+ *
+ */
+public final class ThreadPool
+{
+ 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;
+
+ private static int _threadPoolRandomizer;
+
+ protected static ScheduledThreadPoolExecutor[] _scheduledPools;
+ protected static ThreadPoolExecutor[] _instantPools;
+
+ /**
+ * Init the different pools, based on Config. It is launched only once, on Gameserver instance.
+ */
+ public static void init()
+ {
+ // Feed scheduled pool.
+ int poolCount = Config.SCHEDULED_THREAD_POOL_COUNT;
+ if (poolCount == -1)
+ {
+ poolCount = Runtime.getRuntime().availableProcessors();
+ }
+
+ _scheduledPools = new ScheduledThreadPoolExecutor[poolCount];
+ for (int i = 0; i < poolCount; i++)
+ {
+ _scheduledPools[i] = new ScheduledThreadPoolExecutor(Config.THREADS_PER_SCHEDULED_THREAD_POOL);
+ }
+
+ // Feed instant pool.
+ poolCount = Config.INSTANT_THREAD_POOL_COUNT;
+ if (poolCount == -1)
+ {
+ poolCount = Runtime.getRuntime().availableProcessors();
+ }
+
+ _instantPools = new ThreadPoolExecutor[poolCount];
+ for (int i = 0; i < poolCount; i++)
+ {
+ _instantPools[i] = new ThreadPoolExecutor(Config.THREADS_PER_INSTANT_THREAD_POOL, Config.THREADS_PER_INSTANT_THREAD_POOL, 0, TimeUnit.SECONDS, new ArrayBlockingQueue(100000));
+ }
+
+ // Prestart core threads.
+ for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
+ {
+ threadPool.prestartAllCoreThreads();
+ }
+
+ for (ThreadPoolExecutor threadPool : _instantPools)
+ {
+ threadPool.prestartAllCoreThreads();
+ }
+
+ // Launch purge task.
+ scheduleAtFixedRate(() ->
+ {
+ purge();
+ }, 600000, 600000);
+
+ LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_instantPools) + "/" + getMaximumPoolSize(_instantPools) + " instant thread(s).");
+ LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_scheduledPools) + "/" + getMaximumPoolSize(_scheduledPools) + " scheduled thread(s).");
+ }
+
+ public static void purge()
+ {
+ for (ScheduledThreadPoolExecutor threadPool1 : _scheduledPools)
+ {
+ threadPool1.purge();
+ }
+ for (ThreadPoolExecutor threadPool2 : _instantPools)
+ {
+ threadPool2.purge();
+ }
+ }
+
+ /**
+ * Schedules a one-shot action that becomes enabled after a delay. The pool is chosen based on pools activity.
+ * @param r : the task to execute.
+ * @param delay : the time from now to delay execution.
+ * @return a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion.
+ */
+ public static ScheduledFuture> schedule(Runnable r, long delay)
+ {
+ try
+ {
+ return getPool(_scheduledPools).schedule(new TaskWrapper(r), validate(delay), TimeUnit.MILLISECONDS);
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Schedules a periodic action that becomes enabled after a delay. The pool is chosen based on pools activity.
+ * @param r : the task to execute.
+ * @param delay : the time from now to delay execution.
+ * @param period : the period between successive executions.
+ * @return a ScheduledFuture representing pending completion of the task and whose get() method will throw an exception upon cancellation.
+ */
+ public static ScheduledFuture> scheduleAtFixedRate(Runnable r, long delay, long period)
+ {
+ try
+ {
+ return getPool(_scheduledPools).scheduleAtFixedRate(new TaskWrapper(r), validate(delay), validate(period), TimeUnit.MILLISECONDS);
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Executes the given task sometime in the future.
+ * @param r : the task to execute.
+ */
+ public static void execute(Runnable r)
+ {
+ try
+ {
+ getPool(_instantPools).execute(new TaskWrapper(r));
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ public static String[] getStats()
+ {
+ List stats = new ArrayList<>();
+ for (int i = 0; i < _scheduledPools.length; i++)
+ {
+ final ScheduledThreadPoolExecutor threadPool = _scheduledPools[i];
+ stats.add("Scheduled pool #" + i + ":");
+ stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
+ stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
+ stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
+ stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
+ stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
+ stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
+ stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
+ stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
+ stats.add(" | -------");
+ }
+ for (int i = 0; i < _instantPools.length; i++)
+ {
+ final ThreadPoolExecutor threadPool = _instantPools[i];
+ stats.add("Scheduled pool #" + i + ":");
+ stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
+ stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
+ stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
+ stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
+ stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
+ stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
+ stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
+ stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
+ stats.add(" | -------");
+ }
+ return stats.toArray(new String[stats.size()]);
+ }
+
+ /**
+ * Shutdown thread pooling system correctly. Send different informations.
+ */
+ public static void shutdown()
+ {
+ try
+ {
+ LOG.info("ThreadPoolManager: Shutting down.");
+
+ for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
+ {
+ threadPool.shutdownNow();
+ }
+
+ for (ThreadPoolExecutor threadPool : _instantPools)
+ {
+ threadPool.shutdownNow();
+ }
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ }
+ }
+
+ /**
+ * @param : The pool type.
+ * @param threadPools : The pool array to check.
+ * @return the less fed pool.
+ */
+ private static T getPool(T[] threadPools)
+ {
+ return threadPools[_threadPoolRandomizer++ % threadPools.length];
+ }
+
+ /**
+ * @param delay : The delay to validate.
+ * @return a secured value, from 0 to MAX_DELAY.
+ */
+ private static long validate(long delay)
+ {
+ return Math.max(0, Math.min(MAX_DELAY, delay));
+ }
+
+ /**
+ * @param threadPools : The pool array to check.
+ * @return the overall actual pools size.
+ */
+ private static long getPoolSize(ThreadPoolExecutor[] threadPools)
+ {
+ long result = 0;
+
+ for (ThreadPoolExecutor threadPool : threadPools)
+ {
+ result += threadPool.getPoolSize();
+ }
+
+ return result;
+ }
+
+ /**
+ * @param threadPools : The pool array to check.
+ * @return the overall maximum pools size.
+ */
+ private static long getMaximumPoolSize(ThreadPoolExecutor[] threadPools)
+ {
+ long result = 0;
+
+ for (ThreadPoolExecutor threadPool : threadPools)
+ {
+ result += threadPool.getMaximumPoolSize();
+ }
+
+ return result;
+ }
+
+ public static final class TaskWrapper implements Runnable
+ {
+ private final Runnable _runnable;
+
+ public TaskWrapper(Runnable runnable)
+ {
+ _runnable = runnable;
+ }
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ _runnable.run();
+ }
+ catch (RuntimeException e)
+ {
+ LOG.warning("Exception in " + _runnable.getClass().getName() + " execution: " + e.getMessage());
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java
index 84fc7810a1..af9fc6ece9 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
index 777bcbbd43..a4fc1b00a2 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/RecipeController.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/RecipeController.java
index a84a29cd81..8b8cbe3470 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/RecipeController.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/RecipeController.java
@@ -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
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/Shutdown.java
index 2878a9df1b..2e99f8f99f 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/Shutdown.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ThreadPoolManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ThreadPoolManager.java
deleted file mode 100644
index c9777e9c56..0000000000
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ThreadPoolManager.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.gameserver;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.logging.Logger;
-
-import com.l2jmobius.Config;
-
-/**
- * This class handles thread pooling system. It relies on two ThreadPoolExecutor arrays, which poolers number is generated using config.
- *
- * Those arrays hold following pools :
- *
- *
- * - Scheduled pool keeps a track about incoming, future events.
- * - Instant pool handles short-life events.
- *
- */
-public final class ThreadPoolManager
-{
- protected static final Logger LOG = Logger.getLogger(ThreadPoolManager.class.getName());
-
- private static final long MAX_DELAY = TimeUnit.NANOSECONDS.toMillis(Long.MAX_VALUE - System.nanoTime()) / 2;
-
- private static int _threadPoolRandomizer;
-
- protected static ScheduledThreadPoolExecutor[] _scheduledPools;
- protected static ThreadPoolExecutor[] _instantPools;
-
- /**
- * Init the different pools, based on Config. It is launched only once, on Gameserver instance.
- */
- public static void init()
- {
- // Feed scheduled pool.
- int poolCount = Config.SCHEDULED_THREAD_POOL_COUNT;
- if (poolCount == -1)
- {
- poolCount = Runtime.getRuntime().availableProcessors();
- }
-
- _scheduledPools = new ScheduledThreadPoolExecutor[poolCount];
- for (int i = 0; i < poolCount; i++)
- {
- _scheduledPools[i] = new ScheduledThreadPoolExecutor(Config.THREADS_PER_SCHEDULED_THREAD_POOL);
- }
-
- // Feed instant pool.
- poolCount = Config.INSTANT_THREAD_POOL_COUNT;
- if (poolCount == -1)
- {
- poolCount = Runtime.getRuntime().availableProcessors();
- }
-
- _instantPools = new ThreadPoolExecutor[poolCount];
- for (int i = 0; i < poolCount; i++)
- {
- _instantPools[i] = new ThreadPoolExecutor(Config.THREADS_PER_INSTANT_THREAD_POOL, Config.THREADS_PER_INSTANT_THREAD_POOL, 0, TimeUnit.SECONDS, new ArrayBlockingQueue(100000));
- }
-
- // Prestart core threads.
- for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
- {
- threadPool.prestartAllCoreThreads();
- }
-
- for (ThreadPoolExecutor threadPool : _instantPools)
- {
- threadPool.prestartAllCoreThreads();
- }
-
- // Launch purge task.
- scheduleAtFixedRate(() ->
- {
- purge();
- }, 600000, 600000);
-
- LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_instantPools) + "/" + getMaximumPoolSize(_instantPools) + " instant thread(s).");
- LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_scheduledPools) + "/" + getMaximumPoolSize(_scheduledPools) + " scheduled thread(s).");
- }
-
- public static void purge()
- {
- for (ScheduledThreadPoolExecutor threadPool1 : _scheduledPools)
- {
- threadPool1.purge();
- }
- for (ThreadPoolExecutor threadPool2 : _instantPools)
- {
- threadPool2.purge();
- }
- }
-
- /**
- * Schedules a one-shot action that becomes enabled after a delay. The pool is chosen based on pools activity.
- * @param r : the task to execute.
- * @param delay : the time from now to delay execution.
- * @return a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion.
- */
- public static ScheduledFuture> schedule(Runnable r, long delay)
- {
- try
- {
- return getPool(_scheduledPools).schedule(new TaskWrapper(r), validate(delay), TimeUnit.MILLISECONDS);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * Schedules a periodic action that becomes enabled after a delay. The pool is chosen based on pools activity.
- * @param r : the task to execute.
- * @param delay : the time from now to delay execution.
- * @param period : the period between successive executions.
- * @return a ScheduledFuture representing pending completion of the task and whose get() method will throw an exception upon cancellation.
- */
- public static ScheduledFuture> scheduleAtFixedRate(Runnable r, long delay, long period)
- {
- try
- {
- return getPool(_scheduledPools).scheduleAtFixedRate(new TaskWrapper(r), validate(delay), validate(period), TimeUnit.MILLISECONDS);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * Executes the given task sometime in the future.
- * @param r : the task to execute.
- */
- public static void execute(Runnable r)
- {
- try
- {
- getPool(_instantPools).execute(new TaskWrapper(r));
- }
- catch (Exception e)
- {
- }
- }
-
- public static String[] getStats()
- {
- List stats = new ArrayList<>();
- for (int i = 0; i < _scheduledPools.length; i++)
- {
- final ScheduledThreadPoolExecutor threadPool = _scheduledPools[i];
- stats.add("Scheduled pool #" + i + ":");
- stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
- stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
- stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
- stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
- stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
- stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
- stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
- stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
- stats.add(" | -------");
- }
- for (int i = 0; i < _instantPools.length; i++)
- {
- final ThreadPoolExecutor threadPool = _instantPools[i];
- stats.add("Scheduled pool #" + i + ":");
- stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
- stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
- stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
- stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
- stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
- stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
- stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
- stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
- stats.add(" | -------");
- }
- return stats.toArray(new String[stats.size()]);
- }
-
- /**
- * Shutdown thread pooling system correctly. Send different informations.
- */
- public static void shutdown()
- {
- try
- {
- LOG.info("ThreadPoolManager: Shutting down.");
-
- for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
- {
- threadPool.shutdownNow();
- }
-
- for (ThreadPoolExecutor threadPool : _instantPools)
- {
- threadPool.shutdownNow();
- }
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- }
- }
-
- /**
- * @param : The pool type.
- * @param threadPools : The pool array to check.
- * @return the less fed pool.
- */
- private static T getPool(T[] threadPools)
- {
- return threadPools[_threadPoolRandomizer++ % threadPools.length];
- }
-
- /**
- * @param delay : The delay to validate.
- * @return a secured value, from 0 to MAX_DELAY.
- */
- private static long validate(long delay)
- {
- return Math.max(0, Math.min(MAX_DELAY, delay));
- }
-
- /**
- * @param threadPools : The pool array to check.
- * @return the overall actual pools size.
- */
- private static long getPoolSize(ThreadPoolExecutor[] threadPools)
- {
- long result = 0;
-
- for (ThreadPoolExecutor threadPool : threadPools)
- {
- result += threadPool.getPoolSize();
- }
-
- return result;
- }
-
- /**
- * @param threadPools : The pool array to check.
- * @return the overall maximum pools size.
- */
- private static long getMaximumPoolSize(ThreadPoolExecutor[] threadPools)
- {
- long result = 0;
-
- for (ThreadPoolExecutor threadPool : threadPools)
- {
- result += threadPool.getMaximumPoolSize();
- }
-
- return result;
- }
-
- public static final class TaskWrapper implements Runnable
- {
- private final Runnable _runnable;
-
- public TaskWrapper(Runnable runnable)
- {
- _runnable = runnable;
- }
-
- @Override
- public void run()
- {
- try
- {
- _runnable.run();
- }
- catch (RuntimeException e)
- {
- LOG.warning("Exception in " + _runnable.getClass().getName() + " execution: " + e.getMessage());
- }
- }
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/AbstractAI.java
index b0de12e3a7..1955d24a1b 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/AbstractAI.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/AbstractAI.java
@@ -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
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
index 6fc8e2db7b..e39af75c7a 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
index 962662a4a1..c6fbb41b1c 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
@@ -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
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2DoorAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
index 1c536565b1..863a88a54e 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2SummonAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
index d0d6ef1cc4..fa06b60c27 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index 258e120fa2..9005a7c1ec 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
index 699808b0fe..3f2fe830c7 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
@@ -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)
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/BotReportTable.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
index 2cce93d58a..1bc9f89949 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/ItemTable.java
index 1723520fa2..c8f34ed812 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/ItemTable.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/datatables/ItemTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
index b81189c6db..3965ca6cbf 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
@@ -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.");
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index d2b606a72a..6a9dff749b 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
index 62d750ea6e..4f8594ee49 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
@@ -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));
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
index d15bee76d5..e16e1eb679 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
@@ -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)));
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index f4d39d153f..af7835fe63 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -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);
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
index 16a0da92bc..65b7775e2f 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index c6537d2d80..14f412ec48 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -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;
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
index c06464b525..9c43355936 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
index dbcfdb4423..2f33b08a7b 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 926b637642..e8b430a5df 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -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();
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/MailManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
index 9a562ecf61..58b75f592d 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 1a6bdcfebb..a29ed155fc 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -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);
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
index 478e1f78f5..c1df0ca78b 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
@@ -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() + ".");
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
index e9c54b975a..a7a85e7181 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/ClanWar.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/ClanWar.java
index 31d7982a13..cb821eee0f 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/ClanWar.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/ClanWar.java
@@ -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());
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CreatureContainer.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CreatureContainer.java
index da2d7bcc94..91d8c1f632 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CreatureContainer.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CreatureContainer.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CursedWeapon.java
index d6c5f1374b..d579628d09 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CursedWeapon.java
@@ -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;
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/DropProtection.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/DropProtection.java
index 50a3cc2145..a6aef4bdc4 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/DropProtection.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/DropProtection.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/Fishing.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/Fishing.java
index 92a1e19ca5..2e13b5d8d6 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/Fishing.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/Fishing.java
@@ -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));
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Clan.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Clan.java
index 76f4eb46f7..b303750a48 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Clan.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Clan.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Party.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Party.java
index 5b6e9281fe..5f14864046 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Party.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Party.java
@@ -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));
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Request.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Request.java
index a65b9b6a50..dafa0f378e 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Request.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Request.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java
index 06b8d89b88..723bae6bfd 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 693ba7ad57..6bfaf3a33d 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/MpRewardTask.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/MpRewardTask.java
index cf4458c3a4..827e7e936f 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/MpRewardTask.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/MpRewardTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
index 009890553d..95645a858c 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
@@ -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
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index e39c93014d..af22b8d62e 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
index b655362a05..1caa0adf75 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
@@ -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())
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
index 3f2fcfb5dc..94fe6bb6b5 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
index 3d61e79b4e..8bdacda8a8 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
@@ -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());
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
index 8f14bf5519..6c554e10e0 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
index f47eab9638..4fb7bbb976 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
index b982a00c9f..a1606ac209 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
index 279cac72dd..311d1aa7ce 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
index 652a1ca0fa..5718895451 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
index 7b95a8d218..4b4f6d1f00 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
index bbe7fd3e89..2c113f3992 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
index a389c3c0e5..2e3194d21d 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
index 0a04416d20..3d3a67f2b9 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
index 60e018bb0f..32b74ba8eb 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
index 7950d61315..5e68cb589e 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
index 9af40f494e..352a7719ae 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 6f37725f33..dc787cbc19 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -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
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
index a6ffb508f1..3fa6773fd2 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
index b15e938ffe..192da08f4e 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
@@ -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)
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
index 4dff07f0c4..5c5e479600 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
@@ -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);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
index 7d2ed5035b..a47ba1a0a5 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/buylist/Product.java
index 0da19f8ec7..97571235ed 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/buylist/Product.java
@@ -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
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
index a5c90d0c95..f2fb12dc19 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
index 58eab32cb0..d77bf6af86 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
@@ -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)
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Castle.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Castle.java
index f1aa77737c..a6faf0b0df 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Castle.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Castle.java
@@ -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
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/ClanHall.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
index 2cfbef3323..d41afdb68a 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
@@ -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();
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Duel.java
index 09536b2aef..d601203f8d 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Duel.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Duel.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Fort.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Fort.java
index d892c13f8c..e9b3160a50 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Fort.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Fort.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/FortSiege.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
index 43e89644c5..053af69e9d 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Siege.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Siege.java
index 70f5dfde8d..8987391e4f 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Siege.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Siege.java
@@ -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();
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index 8f25107013..f09be6765f 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -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);
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
index 2e551991b6..c25f5189f6 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
index 2fdc072c9f..2e334ae7ed 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
@@ -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 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);
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
index 70464afd7c..65d29d5c01 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -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
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index 34c893a2b6..c538e405ae 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 17a9b42f56..5c81ea0b72 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -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;
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 407130b911..2e12063fd7 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
index 724b7229fc..38d0fa7c13 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -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");
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index 06c89cb134..d18e278286 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index bc8f5d0bc3..d4720828f5 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -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()));
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 5e7ed370d3..cae533ba54 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
index 0eb81e0589..64f6afb219 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index 9b93abc89c..497bcd5aec 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -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());
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
index 6fb07987fe..64f04389a2 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
@@ -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:
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index 9696330565..9ac2dd32b5 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
index d6c7029961..cd4d28782c 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
@@ -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());
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
index 0f57c18729..66b9f7e4b2 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
index dd4d99799e..bccb1a9fdb 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
index 9801290712..38c9a63329 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
index f9ff489d33..043a66b6f4 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
@@ -20,8 +20,8 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +150,7 @@ public final class L2EffectZone extends L2ZoneType
{
if (getSettings().getTask() == null)
{
- getSettings().setTask(ThreadPoolManager.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
+ getSettings().setTask(ThreadPool.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
index 6814af7a3a..71d8f10b3e 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.lang.ref.WeakReference;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.PcCondOverride;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -47,7 +47,7 @@ public class L2FishingZone extends L2ZoneType
if ((Config.ALLOW_FISHING || character.canOverrideCond(PcCondOverride.ZONE_CONDITIONS)) && !character.isInsideZone(ZoneId.FISHING))
{
final WeakReference weakPlayer = new WeakReference<>(character.getActingPlayer());
- ThreadPoolManager.execute(new Runnable()
+ ThreadPool.execute(new Runnable()
{
@Override
public void run()
@@ -69,7 +69,7 @@ public class L2FishingZone extends L2ZoneType
player.sendPacket(ExAutoFishAvailable.NO);
}
}
- ThreadPoolManager.schedule(this, 1500);
+ ThreadPool.schedule(this, 1500);
}
else
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
index 13e3744d6c..6511752492 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -77,7 +77,7 @@ public class L2JailZone extends L2ZoneType
if (player.isJailed())
{
// when a player wants to exit jail even if he is still jailed, teleport him back to jail
- ThreadPoolManager.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
+ ThreadPool.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
character.sendMessage("You cannot cheat your way out of here. You must wait until your jail time is over.");
}
if (Config.JAIL_DISABLE_TRANSACTION)
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
index 94b5594d11..c0ffa52989 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.ArrayList;
import java.util.List;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.Location;
@@ -130,7 +130,7 @@ public class L2OlympiadStadiumZone extends L2ZoneRespawn
// only participants, observers and GMs allowed
if (!player.canOverrideCond(PcCondOverride.ZONE_CONDITIONS) && !player.isInOlympiadMode() && !player.inObserverMode())
{
- ThreadPoolManager.execute(new KickPlayer(player));
+ ThreadPool.execute(new KickPlayer(player));
}
else
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
index 063cd551e6..cb7760aee0 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
@@ -18,8 +18,8 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -62,7 +62,7 @@ public class L2ResidenceHallTeleportZone extends L2ResidenceTeleportZone
{
if ((_teleTask == null) || _teleTask.isDone())
{
- _teleTask = ThreadPoolManager.schedule(new TeleportTask(), 30000);
+ _teleTask = ThreadPool.schedule(new TeleportTask(), 30000);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
index ca1ec6ed1a..3d7911ed2a 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.CategoryType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.tasks.player.FlyMoveStartTask;
@@ -59,7 +59,7 @@ public class L2SayuneZone extends L2ZoneType
if (character.isPlayer() && (character.isInCategory(CategoryType.SIXTH_CLASS_GROUP) || Config.FREE_JUMPS_FOR_ALL) && !character.getActingPlayer().isMounted() && !character.isTransformed())
{
character.setInsideZone(ZoneId.SAYUNE, true);
- ThreadPoolManager.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
+ ThreadPool.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/Disconnection.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/Disconnection.java
index 8c839bb573..dd0aefae85 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/Disconnection.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/Disconnection.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.network;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventDispatcher;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogout;
@@ -183,7 +183,7 @@ public final class Disconnection
{
if (_activeChar != null)
{
- ThreadPoolManager.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
+ ThreadPool.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index b539956ee8..6dfb426f8b 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -17,9 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.LoginServerThread;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.sql.impl.AnnouncementsTable;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
@@ -656,7 +656,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.ENABLE_ATTENDANCE_REWARDS)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Check if player can receive reward today.
final AttendanceInfoHolder attendanceInfo = activeChar.getAttendanceInfo();
@@ -676,7 +676,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.HARDWARE_INFO_ENABLED)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (client.getHardwareInfo() == null)
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
index c1d19b5e5b..274d425f02 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
@@ -101,7 +101,7 @@ public final class RequestDuelStart implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_BEEN_CHALLENGED_TO_A_DUEL);
sm.addString(name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, name), 10000);
activeChar.blockRequest();
return;
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
index aa110b024b..817c5d9296 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.enums.PartyDistributionType;
import com.l2jmobius.gameserver.model.BlockList;
@@ -82,7 +82,7 @@ public final class RequestJoinParty implements IClientIncomingPacket
requestor.sendPacket(sm);
if (!requestor.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(requestor), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(requestor), 10000);
requestor.blockRequest();
}
else
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
index 37c539556f..9e6d7ce7be 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2World;
@@ -80,7 +80,7 @@ public final class RequestJoinPledge implements IClientIncomingPacket
{
if (!activeChar.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
index d9cc2097df..7e97a40c3f 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
@@ -21,8 +21,8 @@ import java.util.Map;
import java.util.logging.Level;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.L2Object;
@@ -241,7 +241,7 @@ public final class RequestPreviewItem implements IClientIncomingPacket
{
activeChar.sendPacket(new ShopPreviewInfo(itemList));
// Schedule task
- ThreadPoolManager.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
+ ThreadPool.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 31e80f64fb..7ba8a189b4 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.FortManager;
@@ -114,7 +114,7 @@ public final class RequestRestartPoint implements IClientIncomingPacket
if ((activeChar.getClan() != null) && castle.getSiege().checkIsAttacker(activeChar.getClan()))
{
// Schedule respawn delay for attacker
- ThreadPoolManager.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
+ ThreadPool.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
if (castle.getSiege().getAttackerRespawnDelay() > 0)
{
activeChar.sendMessage("You will be re-spawned in " + (castle.getSiege().getAttackerRespawnDelay() / 1000) + " seconds");
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
index 7675b1221d..27dadd4973 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.datatables.BotReportTable;
import com.l2jmobius.gameserver.enums.PrivateStoreType;
@@ -129,7 +129,7 @@ public final class TradeRequest implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_REQUESTED_A_TRADE_WITH_C1);
sm.addString(name);
player.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(player, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(player, name), 10000);
player.blockRequest();
}
else
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
index de78415a4b..5999d7d02c 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.NextAction;
@@ -247,7 +247,7 @@ public final class UseItem implements IClientIncomingPacket
}
else if (activeChar.isAttackingNow())
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Removed for preventing retail behavior.
// if (activeChar.isAttackingNow()) // If character is still engaged in strike we should not change weapon
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
index f14c3fa651..5c0b6915bc 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets.friend;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.L2World;
@@ -65,7 +65,7 @@ public final class RequestFriendInvite implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_VE_REQUESTED_C1_TO_BE_ON_YOUR_FRIENDS_LIST);
sm.addString(_name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9cd2ebed02..9f26c91ac6 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
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.L2Summon;
import com.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -45,7 +45,7 @@ public class AttackStanceTaskManager
*/
protected AttackStanceTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
+ ThreadPool.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 9e9dde878c..942d4215db 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
@@ -65,7 +65,7 @@ public final class DecayTaskManager
if (!_decayTasks.containsKey(character))
{
- _decayTasks.put(character, ThreadPoolManager.schedule(new DecayTask(character), delay * 1000));
+ _decayTasks.put(character, ThreadPool.schedule(new DecayTask(character), delay * 1000));
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
index 5d9816577a..7f86a2bfb3 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -35,8 +35,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.taskmanager.tasks.TaskBirthday;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskRestart;
@@ -235,14 +235,14 @@ public final class TaskManager
case TYPE_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
- task.scheduled = ThreadPoolManager.schedule(task, delay);
+ task.scheduled = ThreadPool.schedule(task, delay);
return true;
}
case TYPE_FIXED_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
interval = Long.valueOf(task.getParams()[1]);
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
case TYPE_TIME:
@@ -253,7 +253,7 @@ public final class TaskManager
final long diff = desired.getTime() - System.currentTimeMillis();
if (diff >= 0)
{
- task.scheduled = ThreadPoolManager.schedule(task, diff);
+ task.scheduled = ThreadPool.schedule(task, diff);
return true;
}
LOGGER.info("Task " + task.getId() + " is obsoleted.");
@@ -306,7 +306,7 @@ public final class TaskManager
{
delay += interval;
}
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
default:
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/Evolve.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/Evolve.java
index 80a1c892c6..7fae394d24 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/Evolve.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/Evolve.java
@@ -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.database.DatabaseFactory;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.PetDataTable;
import com.l2jmobius.gameserver.model.L2PetData;
@@ -142,11 +142,11 @@ public final class Evolve
petSummon.startFeed();
item.setEnchantLevel(petSummon.getLevel());
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
@@ -236,11 +236,11 @@ public final class Evolve
player.broadcastUserInfo();
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/MinionList.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/MinionList.java
index fda128217e..271b3ea3d9 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/MinionList.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/MinionList.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -141,7 +141,7 @@ public class MinionList
final int time = respawnTime < 0 ? _master.isRaid() ? (int) Config.RAID_MINION_RESPAWN_TIMER : 0 : respawnTime;
if ((time > 0) && !_master.isAlikeDead())
{
- ThreadPoolManager.schedule(new MinionRespawnTask(minion), time);
+ ThreadPool.schedule(new MinionRespawnTask(minion), time);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/Util.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/Util.java
index 0508148f16..b075bfc1d2 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/Util.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/util/Util.java
@@ -38,9 +38,9 @@ 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.Rnd;
import com.l2jmobius.commons.util.file.filter.ExtFilter;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.HtmlActionScope;
import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import com.l2jmobius.gameserver.model.L2Object;
@@ -64,7 +64,7 @@ public final class Util
public static void handleIllegalPlayerAction(L2PcInstance actor, String message, IllegalActionPunishmentType punishment)
{
- ThreadPoolManager.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
+ ThreadPool.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index 6c0a28cefe..d66ecbb53e 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -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;
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/custom/events/Elpies/Elpies.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/custom/events/Elpies/Elpies.java
index 604b5bcff8..4ca3d1df97 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/custom/events/Elpies/Elpies.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/custom/events/Elpies/Elpies.java
@@ -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();
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/custom/events/Race/Race.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/custom/events/Race/Race.java
index 8af01c7b29..19f2f42bae 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/custom/events/Race/Race.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/custom/events/Race/Race.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
index b64a8a1504..0bcd0b583d 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminTest.java
@@ -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);
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
index aafd3af59a..3921811d6c 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java
@@ -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();
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/playeractions/SocialAction.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/playeractions/SocialAction.java
index 63f58d424d..f7db8c36f7 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/playeractions/SocialAction.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/playeractions/SocialAction.java
@@ -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;
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 6618f26888..db9e7a1a83 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -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();
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
index 612ca5cdc7..50a74f01fa 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java
@@ -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");
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
index 4ca843967c..c165b2658d 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Performance.java
@@ -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);
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
index 0ae4d70bdf..f0e18f6b8d 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/telnethandlers/server/Purge.java
@@ -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);
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
index 7f2ed62f90..856942597c 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/voicedcommandhandlers/AutoPotion.java
@@ -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;
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/commons/concurrent/ThreadPool.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/commons/concurrent/ThreadPool.java
new file mode 100644
index 0000000000..63b620ce4e
--- /dev/null
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/commons/concurrent/ThreadPool.java
@@ -0,0 +1,299 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.commons.concurrent;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Logger;
+
+import com.l2jmobius.Config;
+
+/**
+ * This class handles thread pooling system. It relies on two ThreadPoolExecutor arrays, which poolers number is generated using config.
+ *
+ * Those arrays hold following pools :
+ *
+ *
+ * - Scheduled pool keeps a track about incoming, future events.
+ * - Instant pool handles short-life events.
+ *
+ */
+public final class ThreadPool
+{
+ 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;
+
+ private static int _threadPoolRandomizer;
+
+ protected static ScheduledThreadPoolExecutor[] _scheduledPools;
+ protected static ThreadPoolExecutor[] _instantPools;
+
+ /**
+ * Init the different pools, based on Config. It is launched only once, on Gameserver instance.
+ */
+ public static void init()
+ {
+ // Feed scheduled pool.
+ int poolCount = Config.SCHEDULED_THREAD_POOL_COUNT;
+ if (poolCount == -1)
+ {
+ poolCount = Runtime.getRuntime().availableProcessors();
+ }
+
+ _scheduledPools = new ScheduledThreadPoolExecutor[poolCount];
+ for (int i = 0; i < poolCount; i++)
+ {
+ _scheduledPools[i] = new ScheduledThreadPoolExecutor(Config.THREADS_PER_SCHEDULED_THREAD_POOL);
+ }
+
+ // Feed instant pool.
+ poolCount = Config.INSTANT_THREAD_POOL_COUNT;
+ if (poolCount == -1)
+ {
+ poolCount = Runtime.getRuntime().availableProcessors();
+ }
+
+ _instantPools = new ThreadPoolExecutor[poolCount];
+ for (int i = 0; i < poolCount; i++)
+ {
+ _instantPools[i] = new ThreadPoolExecutor(Config.THREADS_PER_INSTANT_THREAD_POOL, Config.THREADS_PER_INSTANT_THREAD_POOL, 0, TimeUnit.SECONDS, new ArrayBlockingQueue(100000));
+ }
+
+ // Prestart core threads.
+ for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
+ {
+ threadPool.prestartAllCoreThreads();
+ }
+
+ for (ThreadPoolExecutor threadPool : _instantPools)
+ {
+ threadPool.prestartAllCoreThreads();
+ }
+
+ // Launch purge task.
+ scheduleAtFixedRate(() ->
+ {
+ purge();
+ }, 600000, 600000);
+
+ LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_instantPools) + "/" + getMaximumPoolSize(_instantPools) + " instant thread(s).");
+ LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_scheduledPools) + "/" + getMaximumPoolSize(_scheduledPools) + " scheduled thread(s).");
+ }
+
+ public static void purge()
+ {
+ for (ScheduledThreadPoolExecutor threadPool1 : _scheduledPools)
+ {
+ threadPool1.purge();
+ }
+ for (ThreadPoolExecutor threadPool2 : _instantPools)
+ {
+ threadPool2.purge();
+ }
+ }
+
+ /**
+ * Schedules a one-shot action that becomes enabled after a delay. The pool is chosen based on pools activity.
+ * @param r : the task to execute.
+ * @param delay : the time from now to delay execution.
+ * @return a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion.
+ */
+ public static ScheduledFuture> schedule(Runnable r, long delay)
+ {
+ try
+ {
+ return getPool(_scheduledPools).schedule(new TaskWrapper(r), validate(delay), TimeUnit.MILLISECONDS);
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Schedules a periodic action that becomes enabled after a delay. The pool is chosen based on pools activity.
+ * @param r : the task to execute.
+ * @param delay : the time from now to delay execution.
+ * @param period : the period between successive executions.
+ * @return a ScheduledFuture representing pending completion of the task and whose get() method will throw an exception upon cancellation.
+ */
+ public static ScheduledFuture> scheduleAtFixedRate(Runnable r, long delay, long period)
+ {
+ try
+ {
+ return getPool(_scheduledPools).scheduleAtFixedRate(new TaskWrapper(r), validate(delay), validate(period), TimeUnit.MILLISECONDS);
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Executes the given task sometime in the future.
+ * @param r : the task to execute.
+ */
+ public static void execute(Runnable r)
+ {
+ try
+ {
+ getPool(_instantPools).execute(new TaskWrapper(r));
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ public static String[] getStats()
+ {
+ List stats = new ArrayList<>();
+ for (int i = 0; i < _scheduledPools.length; i++)
+ {
+ final ScheduledThreadPoolExecutor threadPool = _scheduledPools[i];
+ stats.add("Scheduled pool #" + i + ":");
+ stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
+ stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
+ stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
+ stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
+ stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
+ stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
+ stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
+ stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
+ stats.add(" | -------");
+ }
+ for (int i = 0; i < _instantPools.length; i++)
+ {
+ final ThreadPoolExecutor threadPool = _instantPools[i];
+ stats.add("Scheduled pool #" + i + ":");
+ stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
+ stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
+ stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
+ stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
+ stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
+ stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
+ stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
+ stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
+ stats.add(" | -------");
+ }
+ return stats.toArray(new String[stats.size()]);
+ }
+
+ /**
+ * Shutdown thread pooling system correctly. Send different informations.
+ */
+ public static void shutdown()
+ {
+ try
+ {
+ LOG.info("ThreadPoolManager: Shutting down.");
+
+ for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
+ {
+ threadPool.shutdownNow();
+ }
+
+ for (ThreadPoolExecutor threadPool : _instantPools)
+ {
+ threadPool.shutdownNow();
+ }
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ }
+ }
+
+ /**
+ * @param : The pool type.
+ * @param threadPools : The pool array to check.
+ * @return the less fed pool.
+ */
+ private static T getPool(T[] threadPools)
+ {
+ return threadPools[_threadPoolRandomizer++ % threadPools.length];
+ }
+
+ /**
+ * @param delay : The delay to validate.
+ * @return a secured value, from 0 to MAX_DELAY.
+ */
+ private static long validate(long delay)
+ {
+ return Math.max(0, Math.min(MAX_DELAY, delay));
+ }
+
+ /**
+ * @param threadPools : The pool array to check.
+ * @return the overall actual pools size.
+ */
+ private static long getPoolSize(ThreadPoolExecutor[] threadPools)
+ {
+ long result = 0;
+
+ for (ThreadPoolExecutor threadPool : threadPools)
+ {
+ result += threadPool.getPoolSize();
+ }
+
+ return result;
+ }
+
+ /**
+ * @param threadPools : The pool array to check.
+ * @return the overall maximum pools size.
+ */
+ private static long getMaximumPoolSize(ThreadPoolExecutor[] threadPools)
+ {
+ long result = 0;
+
+ for (ThreadPoolExecutor threadPool : threadPools)
+ {
+ result += threadPool.getMaximumPoolSize();
+ }
+
+ return result;
+ }
+
+ public static final class TaskWrapper implements Runnable
+ {
+ private final Runnable _runnable;
+
+ public TaskWrapper(Runnable runnable)
+ {
+ _runnable = runnable;
+ }
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ _runnable.run();
+ }
+ catch (RuntimeException e)
+ {
+ LOG.warning("Exception in " + _runnable.getClass().getName() + " execution: " + e.getMessage());
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/GameServer.java
index 84fc7810a1..af9fc6ece9 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/GameServer.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
index 777bcbbd43..a4fc1b00a2 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/RecipeController.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/RecipeController.java
index a84a29cd81..8b8cbe3470 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/RecipeController.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/RecipeController.java
@@ -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
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/Shutdown.java
index 2878a9df1b..2e99f8f99f 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/Shutdown.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ThreadPoolManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ThreadPoolManager.java
deleted file mode 100644
index c9777e9c56..0000000000
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ThreadPoolManager.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.gameserver;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.logging.Logger;
-
-import com.l2jmobius.Config;
-
-/**
- * This class handles thread pooling system. It relies on two ThreadPoolExecutor arrays, which poolers number is generated using config.
- *
- * Those arrays hold following pools :
- *
- *
- * - Scheduled pool keeps a track about incoming, future events.
- * - Instant pool handles short-life events.
- *
- */
-public final class ThreadPoolManager
-{
- protected static final Logger LOG = Logger.getLogger(ThreadPoolManager.class.getName());
-
- private static final long MAX_DELAY = TimeUnit.NANOSECONDS.toMillis(Long.MAX_VALUE - System.nanoTime()) / 2;
-
- private static int _threadPoolRandomizer;
-
- protected static ScheduledThreadPoolExecutor[] _scheduledPools;
- protected static ThreadPoolExecutor[] _instantPools;
-
- /**
- * Init the different pools, based on Config. It is launched only once, on Gameserver instance.
- */
- public static void init()
- {
- // Feed scheduled pool.
- int poolCount = Config.SCHEDULED_THREAD_POOL_COUNT;
- if (poolCount == -1)
- {
- poolCount = Runtime.getRuntime().availableProcessors();
- }
-
- _scheduledPools = new ScheduledThreadPoolExecutor[poolCount];
- for (int i = 0; i < poolCount; i++)
- {
- _scheduledPools[i] = new ScheduledThreadPoolExecutor(Config.THREADS_PER_SCHEDULED_THREAD_POOL);
- }
-
- // Feed instant pool.
- poolCount = Config.INSTANT_THREAD_POOL_COUNT;
- if (poolCount == -1)
- {
- poolCount = Runtime.getRuntime().availableProcessors();
- }
-
- _instantPools = new ThreadPoolExecutor[poolCount];
- for (int i = 0; i < poolCount; i++)
- {
- _instantPools[i] = new ThreadPoolExecutor(Config.THREADS_PER_INSTANT_THREAD_POOL, Config.THREADS_PER_INSTANT_THREAD_POOL, 0, TimeUnit.SECONDS, new ArrayBlockingQueue(100000));
- }
-
- // Prestart core threads.
- for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
- {
- threadPool.prestartAllCoreThreads();
- }
-
- for (ThreadPoolExecutor threadPool : _instantPools)
- {
- threadPool.prestartAllCoreThreads();
- }
-
- // Launch purge task.
- scheduleAtFixedRate(() ->
- {
- purge();
- }, 600000, 600000);
-
- LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_instantPools) + "/" + getMaximumPoolSize(_instantPools) + " instant thread(s).");
- LOG.info("ThreadPoolManager: Initialized " + getPoolSize(_scheduledPools) + "/" + getMaximumPoolSize(_scheduledPools) + " scheduled thread(s).");
- }
-
- public static void purge()
- {
- for (ScheduledThreadPoolExecutor threadPool1 : _scheduledPools)
- {
- threadPool1.purge();
- }
- for (ThreadPoolExecutor threadPool2 : _instantPools)
- {
- threadPool2.purge();
- }
- }
-
- /**
- * Schedules a one-shot action that becomes enabled after a delay. The pool is chosen based on pools activity.
- * @param r : the task to execute.
- * @param delay : the time from now to delay execution.
- * @return a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion.
- */
- public static ScheduledFuture> schedule(Runnable r, long delay)
- {
- try
- {
- return getPool(_scheduledPools).schedule(new TaskWrapper(r), validate(delay), TimeUnit.MILLISECONDS);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * Schedules a periodic action that becomes enabled after a delay. The pool is chosen based on pools activity.
- * @param r : the task to execute.
- * @param delay : the time from now to delay execution.
- * @param period : the period between successive executions.
- * @return a ScheduledFuture representing pending completion of the task and whose get() method will throw an exception upon cancellation.
- */
- public static ScheduledFuture> scheduleAtFixedRate(Runnable r, long delay, long period)
- {
- try
- {
- return getPool(_scheduledPools).scheduleAtFixedRate(new TaskWrapper(r), validate(delay), validate(period), TimeUnit.MILLISECONDS);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- /**
- * Executes the given task sometime in the future.
- * @param r : the task to execute.
- */
- public static void execute(Runnable r)
- {
- try
- {
- getPool(_instantPools).execute(new TaskWrapper(r));
- }
- catch (Exception e)
- {
- }
- }
-
- public static String[] getStats()
- {
- List stats = new ArrayList<>();
- for (int i = 0; i < _scheduledPools.length; i++)
- {
- final ScheduledThreadPoolExecutor threadPool = _scheduledPools[i];
- stats.add("Scheduled pool #" + i + ":");
- stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
- stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
- stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
- stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
- stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
- stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
- stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
- stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
- stats.add(" | -------");
- }
- for (int i = 0; i < _instantPools.length; i++)
- {
- final ThreadPoolExecutor threadPool = _instantPools[i];
- stats.add("Scheduled pool #" + i + ":");
- stats.add(" |- ActiveCount: ...... " + threadPool.getActiveCount());
- stats.add(" |- CorePoolSize: ..... " + threadPool.getCorePoolSize());
- stats.add(" |- PoolSize: ......... " + threadPool.getPoolSize());
- stats.add(" |- LargestPoolSize: .. " + threadPool.getLargestPoolSize());
- stats.add(" |- MaximumPoolSize: .. " + threadPool.getMaximumPoolSize());
- stats.add(" |- CompletedTaskCount: " + threadPool.getCompletedTaskCount());
- stats.add(" |- QueuedTaskCount: .. " + threadPool.getQueue().size());
- stats.add(" |- TaskCount: ........ " + threadPool.getTaskCount());
- stats.add(" | -------");
- }
- return stats.toArray(new String[stats.size()]);
- }
-
- /**
- * Shutdown thread pooling system correctly. Send different informations.
- */
- public static void shutdown()
- {
- try
- {
- LOG.info("ThreadPoolManager: Shutting down.");
-
- for (ScheduledThreadPoolExecutor threadPool : _scheduledPools)
- {
- threadPool.shutdownNow();
- }
-
- for (ThreadPoolExecutor threadPool : _instantPools)
- {
- threadPool.shutdownNow();
- }
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- }
- }
-
- /**
- * @param : The pool type.
- * @param threadPools : The pool array to check.
- * @return the less fed pool.
- */
- private static T getPool(T[] threadPools)
- {
- return threadPools[_threadPoolRandomizer++ % threadPools.length];
- }
-
- /**
- * @param delay : The delay to validate.
- * @return a secured value, from 0 to MAX_DELAY.
- */
- private static long validate(long delay)
- {
- return Math.max(0, Math.min(MAX_DELAY, delay));
- }
-
- /**
- * @param threadPools : The pool array to check.
- * @return the overall actual pools size.
- */
- private static long getPoolSize(ThreadPoolExecutor[] threadPools)
- {
- long result = 0;
-
- for (ThreadPoolExecutor threadPool : threadPools)
- {
- result += threadPool.getPoolSize();
- }
-
- return result;
- }
-
- /**
- * @param threadPools : The pool array to check.
- * @return the overall maximum pools size.
- */
- private static long getMaximumPoolSize(ThreadPoolExecutor[] threadPools)
- {
- long result = 0;
-
- for (ThreadPoolExecutor threadPool : threadPools)
- {
- result += threadPool.getMaximumPoolSize();
- }
-
- return result;
- }
-
- public static final class TaskWrapper implements Runnable
- {
- private final Runnable _runnable;
-
- public TaskWrapper(Runnable runnable)
- {
- _runnable = runnable;
- }
-
- @Override
- public void run()
- {
- try
- {
- _runnable.run();
- }
- catch (RuntimeException e)
- {
- LOG.warning("Exception in " + _runnable.getClass().getName() + " execution: " + e.getMessage());
- }
- }
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/AbstractAI.java
index b0de12e3a7..1955d24a1b 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/AbstractAI.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/AbstractAI.java
@@ -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
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
index 6fc8e2db7b..e39af75c7a 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
index 962662a4a1..c6fbb41b1c 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java
@@ -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
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2DoorAI.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
index 1c536565b1..863a88a54e 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2DoorAI.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2SummonAI.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
index d0d6ef1cc4..fa06b60c27 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/ai/L2SummonAI.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index 258e120fa2..9005a7c1ec 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
index 699808b0fe..3f2fe830c7 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/data/sql/impl/ClanTable.java
@@ -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)
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/datatables/BotReportTable.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
index 2cce93d58a..1bc9f89949 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/datatables/BotReportTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/datatables/ItemTable.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/datatables/ItemTable.java
index 1723520fa2..c8f34ed812 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/datatables/ItemTable.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/datatables/ItemTable.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
index b81189c6db..3965ca6cbf 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/idfactory/BitSetIDFactory.java
@@ -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.");
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index d2b606a72a..6a9dff749b 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
index 62d750ea6e..4f8594ee49 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ClanEntryManager.java
@@ -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));
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
index d15bee76d5..e16e1eb679 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/CommissionManager.java
@@ -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)));
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index f4d39d153f..af7835fe63 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -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);
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
index 16a0da92bc..65b7775e2f 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/FakePlayerChatManager.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index c6537d2d80..14f412ec48 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -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;
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
index 4704d55126..99c7fa7996 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
index dbcfdb4423..2f33b08a7b 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/HandysBlockCheckerManager.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 926b637642..e8b430a5df 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -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();
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/MailManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
index 9a562ecf61..58b75f592d 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/MailManager.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 1a6bdcfebb..a29ed155fc 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -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);
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
index 478e1f78f5..c1df0ca78b 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ServerRestartManager.java
@@ -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() + ".");
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
index e9c54b975a..a7a85e7181 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/ClanWar.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/ClanWar.java
index 31d7982a13..cb821eee0f 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/ClanWar.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/ClanWar.java
@@ -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());
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/CreatureContainer.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/CreatureContainer.java
index da2d7bcc94..91d8c1f632 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/CreatureContainer.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/CreatureContainer.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/CursedWeapon.java
index d6c5f1374b..d579628d09 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/CursedWeapon.java
@@ -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;
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/DropProtection.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/DropProtection.java
index 50a3cc2145..a6aef4bdc4 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/DropProtection.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/DropProtection.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/Fishing.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/Fishing.java
index 92a1e19ca5..2e13b5d8d6 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/Fishing.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/Fishing.java
@@ -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));
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Clan.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Clan.java
index 76f4eb46f7..b303750a48 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Clan.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Clan.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Party.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Party.java
index 5b6e9281fe..5f14864046 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Party.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Party.java
@@ -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));
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Request.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Request.java
index a65b9b6a50..dafa0f378e 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Request.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Request.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java
index 06b8d89b88..723bae6bfd 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 693ba7ad57..6bfaf3a33d 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/MpRewardTask.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/MpRewardTask.java
index cf4458c3a4..827e7e936f 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/MpRewardTask.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/MpRewardTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
index 009890553d..95645a858c 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Attackable.java
@@ -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
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index e39c93014d..af22b8d62e 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
index b655362a05..1caa0adf75 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Npc.java
@@ -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())
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
index 3f2fcfb5dc..94fe6bb6b5 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
index 3d61e79b4e..8bdacda8a8 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ControllableAirShipInstance.java
@@ -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());
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
index 8f14bf5519..6c554e10e0 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2DecoyInstance.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
index f47eab9638..4fb7bbb976 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2DoorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
index b982a00c9f..a1606ac209 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2FortCommanderInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
index 8480eb6074..3e579d1879 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
index 652a1ca0fa..5718895451 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
index 7b95a8d218..4b4f6d1f00 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2RaidBossInstance.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
index bbe7fd3e89..2c113f3992 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2ServitorInstance.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
index a389c3c0e5..2e3194d21d 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2SiegeFlagInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
index 0a04416d20..3d3a67f2b9 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2TamedBeastInstance.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
index 60e018bb0f..32b74ba8eb 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2TrapInstance.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
index 7950d61315..5e68cb589e 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/request/AbstractRequest.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
index 9af40f494e..352a7719ae 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/status/CharStatus.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 6f37725f33..dc787cbc19 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -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
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
index a6ffb508f1..3fa6773fd2 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/npc/RandomAnimationTask.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
index b15e938ffe..192da08f4e 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/npc/trap/TrapTriggerTask.java
@@ -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)
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
index 4dff07f0c4..5c5e479600 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/tasks/player/FlyMoveStartTask.java
@@ -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);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
index 7d2ed5035b..a47ba1a0a5 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/announce/AutoAnnouncement.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/buylist/Product.java
index 0da19f8ec7..97571235ed 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/buylist/Product.java
@@ -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
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
index a5c90d0c95..f2fb12dc19 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
index 58eab32cb0..d77bf6af86 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/BlockCheckerEngine.java
@@ -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)
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Castle.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Castle.java
index f1aa77737c..a6faf0b0df 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Castle.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Castle.java
@@ -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
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/ClanHall.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
index 2cfbef3323..d41afdb68a 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/ClanHall.java
@@ -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();
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Duel.java
index 09536b2aef..d601203f8d 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Duel.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Duel.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Fort.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Fort.java
index d892c13f8c..e9b3160a50 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Fort.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Fort.java
@@ -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
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/FortSiege.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
index 43e89644c5..053af69e9d 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/FortSiege.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Siege.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Siege.java
index 70f5dfde8d..8987391e4f 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Siege.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/entity/Siege.java
@@ -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();
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index 8f25107013..f09be6765f 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -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);
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
index 2e551991b6..c25f5189f6 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/events/EventDispatcher.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
index 2fdc072c9f..2e334ae7ed 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/events/timers/TimerHolder.java
@@ -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 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);
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
index 70464afd7c..65d29d5c01 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -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
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index 632c4f38f6..743b4a12ee 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 17a9b42f56..5c81ea0b72 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -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;
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 407130b911..2e12063fd7 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -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);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
index 724b7229fc..38d0fa7c13 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -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");
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index 06c89cb134..d18e278286 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index bc8f5d0bc3..d4720828f5 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -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()));
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 5e7ed370d3..cae533ba54 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -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);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
index 0eb81e0589..64f6afb219 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/quest/QuestTimer.java
@@ -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)
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index 9b93abc89c..497bcd5aec 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -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());
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
index 6fb07987fe..64f04389a2 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/shuttle/L2ShuttleEngine.java
@@ -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:
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index 9696330565..9ac2dd32b5 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -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);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
index d6c7029961..cd4d28782c 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java
@@ -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());
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
index 0f57c18729..66b9f7e4b2 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/skills/SkillChannelizer.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
index dd4d99799e..bccb1a9fdb 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/votereward/VoteSystem.java
@@ -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()
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
index 9801290712..38c9a63329 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2DamageZone.java
@@ -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));
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
index f9ff489d33..043a66b6f4 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
@@ -20,8 +20,8 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +150,7 @@ public final class L2EffectZone extends L2ZoneType
{
if (getSettings().getTask() == null)
{
- getSettings().setTask(ThreadPoolManager.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
+ getSettings().setTask(ThreadPool.scheduleAtFixedRate(new ApplySkill(), _initialDelay, _reuse));
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
index 6814af7a3a..71d8f10b3e 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2FishingZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.lang.ref.WeakReference;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.PcCondOverride;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -47,7 +47,7 @@ public class L2FishingZone extends L2ZoneType
if ((Config.ALLOW_FISHING || character.canOverrideCond(PcCondOverride.ZONE_CONDITIONS)) && !character.isInsideZone(ZoneId.FISHING))
{
final WeakReference weakPlayer = new WeakReference<>(character.getActingPlayer());
- ThreadPoolManager.execute(new Runnable()
+ ThreadPool.execute(new Runnable()
{
@Override
public void run()
@@ -69,7 +69,7 @@ public class L2FishingZone extends L2ZoneType
player.sendPacket(ExAutoFishAvailable.NO);
}
}
- ThreadPoolManager.schedule(this, 1500);
+ ThreadPool.schedule(this, 1500);
}
else
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
index 13e3744d6c..6511752492 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2JailZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -77,7 +77,7 @@ public class L2JailZone extends L2ZoneType
if (player.isJailed())
{
// when a player wants to exit jail even if he is still jailed, teleport him back to jail
- ThreadPoolManager.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
+ ThreadPool.schedule(new TeleportTask(player, JAIL_IN_LOC), 2000);
character.sendMessage("You cannot cheat your way out of here. You must wait until your jail time is over.");
}
if (Config.JAIL_DISABLE_TRANSACTION)
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
index 94b5594d11..c0ffa52989 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2OlympiadStadiumZone.java
@@ -19,7 +19,7 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.ArrayList;
import java.util.List;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.Location;
@@ -130,7 +130,7 @@ public class L2OlympiadStadiumZone extends L2ZoneRespawn
// only participants, observers and GMs allowed
if (!player.canOverrideCond(PcCondOverride.ZONE_CONDITIONS) && !player.isInOlympiadMode() && !player.inObserverMode())
{
- ThreadPoolManager.execute(new KickPlayer(player));
+ ThreadPool.execute(new KickPlayer(player));
}
else
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
index 063cd551e6..cb7760aee0 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2ResidenceHallTeleportZone.java
@@ -18,8 +18,8 @@ package com.l2jmobius.gameserver.model.zone.type;
import java.util.concurrent.ScheduledFuture;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -62,7 +62,7 @@ public class L2ResidenceHallTeleportZone extends L2ResidenceTeleportZone
{
if ((_teleTask == null) || _teleTask.isDone())
{
- _teleTask = ThreadPoolManager.schedule(new TeleportTask(), 30000);
+ _teleTask = ThreadPool.schedule(new TeleportTask(), 30000);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
index ca1ec6ed1a..3d7911ed2a 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/type/L2SayuneZone.java
@@ -17,7 +17,7 @@
package com.l2jmobius.gameserver.model.zone.type;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.CategoryType;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.tasks.player.FlyMoveStartTask;
@@ -59,7 +59,7 @@ public class L2SayuneZone extends L2ZoneType
if (character.isPlayer() && (character.isInCategory(CategoryType.SIXTH_CLASS_GROUP) || Config.FREE_JUMPS_FOR_ALL) && !character.getActingPlayer().isMounted() && !character.isTransformed())
{
character.setInsideZone(ZoneId.SAYUNE, true);
- ThreadPoolManager.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
+ ThreadPool.execute(new FlyMoveStartTask(this, character.getActingPlayer()));
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/Disconnection.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/Disconnection.java
index 8c839bb573..dd0aefae85 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/Disconnection.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/Disconnection.java
@@ -18,7 +18,7 @@ package com.l2jmobius.gameserver.network;
import java.util.logging.Logger;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventDispatcher;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogout;
@@ -183,7 +183,7 @@ public final class Disconnection
{
if (_activeChar != null)
{
- ThreadPoolManager.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
+ ThreadPool.schedule(() -> defaultSequence(), _activeChar.canLogout() ? 0 : AttackStanceTaskManager.COMBAT_TIME);
}
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 7d34624d7a..263536ab73 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -17,9 +17,9 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
import com.l2jmobius.gameserver.LoginServerThread;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.sql.impl.AnnouncementsTable;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
@@ -656,7 +656,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.ENABLE_ATTENDANCE_REWARDS)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Check if player can receive reward today.
final AttendanceInfoHolder attendanceInfo = activeChar.getAttendanceInfo();
@@ -676,7 +676,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.HARDWARE_INFO_ENABLED)
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
if (client.getHardwareInfo() == null)
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
index 60a2336347..66116fb464 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestDuelStart.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
@@ -101,7 +101,7 @@ public final class RequestDuelStart implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_BEEN_CHALLENGED_TO_A_DUEL);
sm.addString(name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, name), 10000);
activeChar.blockRequest();
return;
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
index aa110b024b..817c5d9296 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.enums.PartyDistributionType;
import com.l2jmobius.gameserver.model.BlockList;
@@ -82,7 +82,7 @@ public final class RequestJoinParty implements IClientIncomingPacket
requestor.sendPacket(sm);
if (!requestor.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(requestor), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(requestor), 10000);
requestor.blockRequest();
}
else
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
index 37c539556f..9e6d7ce7be 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestJoinPledge.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2World;
@@ -80,7 +80,7 @@ public final class RequestJoinPledge implements IClientIncomingPacket
{
if (!activeChar.isProcessingRequest())
{
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar, activeChar.getTarget().getName()), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
index d9cc2097df..7e97a40c3f 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestPreviewItem.java
@@ -21,8 +21,8 @@ import java.util.Map;
import java.util.logging.Level;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.L2Object;
@@ -241,7 +241,7 @@ public final class RequestPreviewItem implements IClientIncomingPacket
{
activeChar.sendPacket(new ShopPreviewInfo(itemList));
// Schedule task
- ThreadPoolManager.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
+ ThreadPool.schedule(new RemoveWearItemsTask(activeChar), Config.WEAR_DELAY * 1000);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 31e80f64fb..7ba8a189b4 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.FortManager;
@@ -114,7 +114,7 @@ public final class RequestRestartPoint implements IClientIncomingPacket
if ((activeChar.getClan() != null) && castle.getSiege().checkIsAttacker(activeChar.getClan()))
{
// Schedule respawn delay for attacker
- ThreadPoolManager.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
+ ThreadPool.schedule(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
if (castle.getSiege().getAttackerRespawnDelay() > 0)
{
activeChar.sendMessage("You will be re-spawned in " + (castle.getSiege().getAttackerRespawnDelay() / 1000) + " seconds");
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
index 7675b1221d..27dadd4973 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/TradeRequest.java
@@ -17,8 +17,8 @@
package com.l2jmobius.gameserver.network.clientpackets;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.datatables.BotReportTable;
import com.l2jmobius.gameserver.enums.PrivateStoreType;
@@ -129,7 +129,7 @@ public final class TradeRequest implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_REQUESTED_A_TRADE_WITH_C1);
sm.addString(name);
player.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(player, name), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(player, name), 10000);
player.blockRequest();
}
else
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
index de78415a4b..5999d7d02c 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.ai.NextAction;
@@ -247,7 +247,7 @@ public final class UseItem implements IClientIncomingPacket
}
else if (activeChar.isAttackingNow())
{
- ThreadPoolManager.schedule(() ->
+ ThreadPool.schedule(() ->
{
// Removed for preventing retail behavior.
// if (activeChar.isAttackingNow()) // If character is still engaged in strike we should not change weapon
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
index f14c3fa651..5c0b6915bc 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/friend/RequestFriendInvite.java
@@ -16,8 +16,8 @@
*/
package com.l2jmobius.gameserver.network.clientpackets.friend;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.network.PacketReader;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.L2World;
@@ -65,7 +65,7 @@ public final class RequestFriendInvite implements IClientIncomingPacket
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_VE_REQUESTED_C1_TO_BE_ON_YOUR_FRIENDS_LIST);
sm.addString(_name);
activeChar.sendPacket(sm);
- ThreadPoolManager.schedule(() -> scheduleDeny(activeChar), 10000);
+ ThreadPool.schedule(() -> scheduleDeny(activeChar), 10000);
activeChar.blockRequest();
}
else
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9cd2ebed02..9f26c91ac6 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
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.L2Summon;
import com.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -45,7 +45,7 @@ public class AttackStanceTaskManager
*/
protected AttackStanceTaskManager()
{
- ThreadPoolManager.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
+ ThreadPool.scheduleAtFixedRate(new FightModeScheduler(), 0, 1000);
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 9e9dde878c..942d4215db 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
@@ -65,7 +65,7 @@ public final class DecayTaskManager
if (!_decayTasks.containsKey(character))
{
- _decayTasks.put(character, ThreadPoolManager.schedule(new DecayTask(character), delay * 1000));
+ _decayTasks.put(character, ThreadPool.schedule(new DecayTask(character), delay * 1000));
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
index 5d9816577a..7f86a2bfb3 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -35,8 +35,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.taskmanager.tasks.TaskBirthday;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import com.l2jmobius.gameserver.taskmanager.tasks.TaskRestart;
@@ -235,14 +235,14 @@ public final class TaskManager
case TYPE_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
- task.scheduled = ThreadPoolManager.schedule(task, delay);
+ task.scheduled = ThreadPool.schedule(task, delay);
return true;
}
case TYPE_FIXED_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
interval = Long.valueOf(task.getParams()[1]);
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
case TYPE_TIME:
@@ -253,7 +253,7 @@ public final class TaskManager
final long diff = desired.getTime() - System.currentTimeMillis();
if (diff >= 0)
{
- task.scheduled = ThreadPoolManager.schedule(task, diff);
+ task.scheduled = ThreadPool.schedule(task, diff);
return true;
}
LOGGER.info("Task " + task.getId() + " is obsoleted.");
@@ -306,7 +306,7 @@ public final class TaskManager
{
delay += interval;
}
- task.scheduled = ThreadPoolManager.scheduleAtFixedRate(task, delay, interval);
+ task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
default:
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/Evolve.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/Evolve.java
index 80a1c892c6..7fae394d24 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/Evolve.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/Evolve.java
@@ -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.database.DatabaseFactory;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.PetDataTable;
import com.l2jmobius.gameserver.model.L2PetData;
@@ -142,11 +142,11 @@ public final class Evolve
petSummon.startFeed();
item.setEnchantLevel(petSummon.getLevel());
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
@@ -236,11 +236,11 @@ public final class Evolve
player.broadcastUserInfo();
- ThreadPoolManager.schedule(new EvolveFinalizer(player, petSummon), 900);
+ ThreadPool.schedule(new EvolveFinalizer(player, petSummon), 900);
if (petSummon.getCurrentFed() <= 0)
{
- ThreadPoolManager.schedule(new EvolveFeedWait(player, petSummon), 60000);
+ ThreadPool.schedule(new EvolveFeedWait(player, petSummon), 60000);
}
else
{
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/MinionList.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/MinionList.java
index fda128217e..271b3ea3d9 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/MinionList.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/MinionList.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
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.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -141,7 +141,7 @@ public class MinionList
final int time = respawnTime < 0 ? _master.isRaid() ? (int) Config.RAID_MINION_RESPAWN_TIMER : 0 : respawnTime;
if ((time > 0) && !_master.isAlikeDead())
{
- ThreadPoolManager.schedule(new MinionRespawnTask(minion), time);
+ ThreadPool.schedule(new MinionRespawnTask(minion), time);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/Util.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/Util.java
index 0508148f16..b075bfc1d2 100644
--- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/Util.java
+++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/util/Util.java
@@ -38,9 +38,9 @@ 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.Rnd;
import com.l2jmobius.commons.util.file.filter.ExtFilter;
-import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.HtmlActionScope;
import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import com.l2jmobius.gameserver.model.L2Object;
@@ -64,7 +64,7 @@ public final class Util
public static void handleIllegalPlayerAction(L2PcInstance actor, String message, IllegalActionPunishmentType punishment)
{
- ThreadPoolManager.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
+ ThreadPool.schedule(new IllegalPlayerActionTask(actor, message, punishment), 5000);
}
/**