From c16a199407b555acb6e397aaafae19f7e94f0fb6 Mon Sep 17 00:00:00 2001
From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Sat, 20 Feb 2021 11:17:45 +0000
Subject: [PATCH] Addition of the Chronos class.
---
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../FourSepulchers/FourSepulchers.java | 5 +-
.../KeucereusAllianceBase/LindviorScene.java | 5 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../SeedOfAnnihilation.java | 9 ++-
.../data/scripts/ai/bosses/Anakim/Anakim.java | 13 +--
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../IceQueensCastleBattle.java | 5 +-
.../bosses/Frintezza/ScarletVanHalisha.java | 7 +-
.../data/scripts/ai/bosses/Lilith/Lilith.java | 13 +--
.../scripts/ai/bosses/Lindvior/Lindvior.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Trasken/Trasken.java | 5 +-
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../ai/others/TrainingCamp/TrainingCamp.java | 5 +-
.../FreyaCelebration/FreyaCelebration.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../CastleDungeon/CastleDungeon.java | 5 +-
.../FortressDungeon/FortressDungeon.java | 5 +-
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../PailakaRuneCastle/PailakaRuneCastle.java | 7 +-
.../Q00307_ControlDeviceOfTheGiants.java | 5 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 55 ++++++-------
.../actor/instance/VillageMasterInstance.java | 7 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/HennaInfo.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../network/serverpackets/ServerList.java | 3 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../GainakUnderground/Lailly/Lailly.java | 3 +-
.../FourSepulchers/FourSepulchers.java | 5 +-
.../KeucereusAllianceBase/LindviorScene.java | 5 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../SeedOfAnnihilation.java | 9 ++-
.../data/scripts/ai/bosses/Anakim/Anakim.java | 13 +--
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../IceQueensCastleBattle.java | 5 +-
.../bosses/Frintezza/ScarletVanHalisha.java | 7 +-
.../data/scripts/ai/bosses/Kelbim/Kelbim.java | 11 +--
.../data/scripts/ai/bosses/Lilith/Lilith.java | 13 +--
.../scripts/ai/bosses/Lindvior/Lindvior.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Trasken/Trasken.java | 5 +-
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../ai/others/TrainingCamp/TrainingCamp.java | 5 +-
.../FreyaCelebration/FreyaCelebration.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../CastleDungeon/CastleDungeon.java | 5 +-
.../FortressDungeon/FortressDungeon.java | 5 +-
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../PailakaRuneCastle/PailakaRuneCastle.java | 7 +-
.../Q00307_ControlDeviceOfTheGiants.java | 5 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 57 ++++++-------
.../actor/instance/VillageMasterInstance.java | 7 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/HennaInfo.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../GainakUnderground/Lailly/Lailly.java | 3 +-
.../FourSepulchers/FourSepulchers.java | 5 +-
.../KeucereusAllianceBase/LindviorScene.java | 5 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../SeedOfAnnihilation.java | 9 ++-
.../data/scripts/ai/bosses/Anakim/Anakim.java | 13 +--
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../IceQueensCastleBattle.java | 5 +-
.../bosses/Frintezza/ScarletVanHalisha.java | 7 +-
.../data/scripts/ai/bosses/Helios/Helios.java | 5 +-
.../data/scripts/ai/bosses/Kelbim/Kelbim.java | 11 +--
.../data/scripts/ai/bosses/Lilith/Lilith.java | 13 +--
.../scripts/ai/bosses/Lindvior/Lindvior.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../data/scripts/ai/bosses/Ramona/Ramona.java | 21 ++---
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Trasken/Trasken.java | 5 +-
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../ai/others/TrainingCamp/TrainingCamp.java | 5 +-
.../FreyaCelebration/FreyaCelebration.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../CastleDungeon/CastleDungeon.java | 5 +-
.../FortressDungeon/FortressDungeon.java | 5 +-
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../PailakaRuneCastle/PailakaRuneCastle.java | 7 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 57 ++++++-------
.../actor/instance/VillageMasterInstance.java | 7 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/HennaInfo.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../GainakUnderground/Lailly/Lailly.java | 3 +-
.../FourSepulchers/FourSepulchers.java | 5 +-
.../KeucereusAllianceBase/LindviorScene.java | 5 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../SeedOfAnnihilation.java | 9 ++-
.../data/scripts/ai/bosses/Anakim/Anakim.java | 13 +--
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../IceQueensCastleBattle.java | 5 +-
.../bosses/Frintezza/ScarletVanHalisha.java | 7 +-
.../data/scripts/ai/bosses/Helios/Helios.java | 5 +-
.../data/scripts/ai/bosses/Kelbim/Kelbim.java | 11 +--
.../data/scripts/ai/bosses/Lilith/Lilith.java | 13 +--
.../scripts/ai/bosses/Lindvior/Lindvior.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../data/scripts/ai/bosses/Ramona/Ramona.java | 21 ++---
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Trasken/Trasken.java | 5 +-
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../ai/others/TrainingCamp/TrainingCamp.java | 5 +-
.../FreyaCelebration/FreyaCelebration.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../CastleDungeon/CastleDungeon.java | 5 +-
.../FortressDungeon/FortressDungeon.java | 5 +-
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../PailakaRuneCastle/PailakaRuneCastle.java | 7 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 57 ++++++-------
.../actor/instance/VillageMasterInstance.java | 7 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/HennaInfo.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../ExOneDayReceiveRewardList.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../GainakUnderground/Lailly/Lailly.java | 3 +-
.../FourSepulchers/FourSepulchers.java | 5 +-
.../KeucereusAllianceBase/LindviorScene.java | 5 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../SeedOfAnnihilation.java | 9 ++-
.../data/scripts/ai/bosses/Anakim/Anakim.java | 13 +--
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../IceQueensCastleBattle.java | 5 +-
.../bosses/Frintezza/ScarletVanHalisha.java | 7 +-
.../data/scripts/ai/bosses/Helios/Helios.java | 5 +-
.../data/scripts/ai/bosses/Kelbim/Kelbim.java | 11 +--
.../data/scripts/ai/bosses/Lilith/Lilith.java | 13 +--
.../scripts/ai/bosses/Lindvior/Lindvior.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../data/scripts/ai/bosses/Ramona/Ramona.java | 21 ++---
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Trasken/Trasken.java | 5 +-
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../ai/others/TrainingCamp/TrainingCamp.java | 5 +-
.../FreyaCelebration/FreyaCelebration.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../CastleDungeon/CastleDungeon.java | 5 +-
.../FortressDungeon/FortressDungeon.java | 5 +-
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../PailakaRuneCastle/PailakaRuneCastle.java | 7 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 57 ++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 29 +++----
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/HennaInfo.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../GainakUnderground/Lailly/Lailly.java | 3 +-
.../FourSepulchers/FourSepulchers.java | 5 +-
.../KeucereusAllianceBase/LindviorScene.java | 5 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../SeedOfAnnihilation.java | 9 ++-
.../data/scripts/ai/bosses/Anakim/Anakim.java | 13 +--
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../ai/bosses/EtisVanEtina/EtisVanEtina.java | 11 +--
.../IceQueensCastleBattle.java | 5 +-
.../bosses/Frintezza/ScarletVanHalisha.java | 7 +-
.../data/scripts/ai/bosses/Helios/Helios.java | 5 +-
.../data/scripts/ai/bosses/Kelbim/Kelbim.java | 11 +--
.../data/scripts/ai/bosses/Lilith/Lilith.java | 13 +--
.../scripts/ai/bosses/Lindvior/Lindvior.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../data/scripts/ai/bosses/Ramona/Ramona.java | 21 ++---
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Trasken/Trasken.java | 5 +-
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../ai/others/TrainingCamp/TrainingCamp.java | 5 +-
.../FreyaCelebration/FreyaCelebration.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../CastleDungeon/CastleDungeon.java | 5 +-
.../FortressDungeon/FortressDungeon.java | 5 +-
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../PailakaRuneCastle/PailakaRuneCastle.java | 7 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 57 ++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 29 +++----
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/HennaInfo.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../GainakUnderground/Lailly/Lailly.java | 3 +-
.../FourSepulchers/FourSepulchers.java | 5 +-
.../KeucereusAllianceBase/LindviorScene.java | 5 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../SeedOfAnnihilation.java | 9 ++-
.../data/scripts/ai/bosses/Anakim/Anakim.java | 11 +--
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../ai/bosses/EtisVanEtina/EtisVanEtina.java | 11 +--
.../scripts/ai/bosses/Fafurion/Fafurion.java | 5 +-
.../IceQueensCastleBattle.java | 5 +-
.../bosses/Frintezza/ScarletVanHalisha.java | 7 +-
.../data/scripts/ai/bosses/Helios/Helios.java | 5 +-
.../data/scripts/ai/bosses/Kelbim/Kelbim.java | 11 +--
.../data/scripts/ai/bosses/Lilith/Lilith.java | 13 +--
.../scripts/ai/bosses/Lindvior/Lindvior.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../data/scripts/ai/bosses/Ramona/Ramona.java | 21 ++---
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Trasken/Trasken.java | 5 +-
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../ai/others/TrainingCamp/TrainingCamp.java | 5 +-
.../FreyaCelebration/FreyaCelebration.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../TrainingWithDandy/TrainingWithDandy.java | 3 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../CastleDungeon/CastleDungeon.java | 5 +-
.../FortressDungeon/FortressDungeon.java | 5 +-
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../PailakaRuneCastle/PailakaRuneCastle.java | 7 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 57 ++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 29 +++----
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/HennaInfo.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../GainakUnderground/Lailly/Lailly.java | 3 +-
.../FourSepulchers/FourSepulchers.java | 5 +-
.../KeucereusAllianceBase/LindviorScene.java | 5 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../SeedOfAnnihilation.java | 9 ++-
.../data/scripts/ai/bosses/Anakim/Anakim.java | 11 +--
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../ai/bosses/EtisVanEtina/EtisVanEtina.java | 11 +--
.../scripts/ai/bosses/Fafurion/Fafurion.java | 5 +-
.../IceQueensCastleBattle.java | 5 +-
.../bosses/Frintezza/ScarletVanHalisha.java | 7 +-
.../data/scripts/ai/bosses/Helios/Helios.java | 5 +-
.../data/scripts/ai/bosses/Kelbim/Kelbim.java | 11 +--
.../data/scripts/ai/bosses/Lilith/Lilith.java | 13 +--
.../scripts/ai/bosses/Lindvior/Lindvior.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../data/scripts/ai/bosses/Ramona/Ramona.java | 21 ++---
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Trasken/Trasken.java | 5 +-
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../ai/others/TrainingCamp/TrainingCamp.java | 5 +-
.../FreyaCelebration/FreyaCelebration.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../TrainingWithDandy/TrainingWithDandy.java | 3 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../effecthandlers/AddHuntingTime.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../CastleDungeon/CastleDungeon.java | 5 +-
.../FortressDungeon/FortressDungeon.java | 5 +-
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../PailakaRuneCastle/PailakaRuneCastle.java | 7 +-
.../Q10825_ForVictory/Q10825_ForVictory.java | 3 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/RankManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 57 ++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 29 +++----
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../model/zone/type/TimedHuntingZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../sessionzones/ExTimedHuntingZoneEnter.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/HennaInfo.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../sessionzones/TimedHuntingZoneList.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../GainakUnderground/Lailly/Lailly.java | 3 +-
.../KeucereusAllianceBase/LindviorScene.java | 5 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../SeedOfAnnihilation.java | 9 ++-
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../ai/bosses/EtisVanEtina/EtisVanEtina.java | 11 +--
.../scripts/ai/bosses/Fafurion/Fafurion.java | 5 +-
.../IceQueensCastleBattle.java | 5 +-
.../bosses/Frintezza/ScarletVanHalisha.java | 7 +-
.../data/scripts/ai/bosses/Helios/Helios.java | 5 +-
.../data/scripts/ai/bosses/Kelbim/Kelbim.java | 11 +--
.../scripts/ai/bosses/Lindvior/Lindvior.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../data/scripts/ai/bosses/Ramona/Ramona.java | 21 ++---
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Trasken/Trasken.java | 5 +-
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../data/scripts/ai/others/AetherDrops.java | 3 +-
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../ai/others/TrainingCamp/TrainingCamp.java | 5 +-
.../FreyaCelebration/FreyaCelebration.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../TrainingWithDandy/TrainingWithDandy.java | 3 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../effecthandlers/AddHuntingTime.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../CastleDungeon/CastleDungeon.java | 5 +-
.../FortressDungeon/FortressDungeon.java | 5 +-
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../KastiaExceptional/KastiaExceptional.java | 2 +-
.../KastiaExtreme/KastiaExtreme.java | 2 +-
.../instances/KastiaHard/KastiaHard.java | 2 +-
.../instances/KastiaLow/KastiaLow.java | 2 +-
.../instances/KastiaMedium/KastiaMedium.java | 2 +-
.../PailakaRuneCastle/PailakaRuneCastle.java | 7 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/RankManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../org/l2jmobius/gameserver/model/World.java | 7 +-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 57 ++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 29 +++----
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../model/zone/type/TimedHuntingZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../homunculus/ExHomunculusCreateStart.java | 3 +-
.../homunculus/ExHomunculusInsert.java | 9 ++-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../sessionzones/ExTimedHuntingZoneEnter.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/HennaInfo.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../homunculus/ExHomonculusBirthInfo.java | 3 +-
.../sessionzones/TimedHuntingZoneList.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../model/actor/instance/PlayerInstance.java | 7 +-
.../gameserver/network/ClientThread.java | 9 ++-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../loginserver/LoginController.java | 3 +-
.../java/org/l2jmobius/util/Chronos.java | 80 +++++++++++++++++++
.../game/data/scripts/ai/bosses/Antharas.java | 21 ++---
.../game/data/scripts/ai/bosses/Baium.java | 13 +--
.../game/data/scripts/ai/bosses/Core.java | 5 +-
.../game/data/scripts/ai/bosses/Orfen.java | 5 +-
.../game/data/scripts/ai/bosses/QueenAnt.java | 5 +-
.../game/data/scripts/ai/bosses/Valakas.java | 13 +--
.../game/data/scripts/ai/bosses/Zaken.java | 5 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../l2jmobius/commons/util/IPv4Filter.java | 6 +-
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../l2jmobius/gameserver/TradeController.java | 7 +-
.../l2jmobius/gameserver/ai/NpcWalkerAI.java | 5 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/OfflineTradeTable.java | 3 +-
.../gameserver/data/sql/ClanTable.java | 7 +-
.../gameserver/data/sql/TradeListTable.java | 7 +-
.../admincommandhandlers/AdminDonator.java | 3 +-
.../handler/itemhandlers/HeroCustomItem.java | 3 +-
.../handler/itemhandlers/MOSKey.java | 5 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/PetitionManager.java | 3 +-
.../instancemanager/events/CTF.java | 11 +--
.../gameserver/instancemanager/events/DM.java | 11 +--
.../events/EventsGlobalTask.java | 3 +-
.../instancemanager/events/TvT.java | 11 +--
.../instancemanager/games/Lottery.java | 17 ++--
.../l2jmobius/gameserver/model/Timestamp.java | 8 +-
.../gameserver/model/actor/Attackable.java | 7 +-
.../gameserver/model/actor/Creature.java | 11 +--
.../actor/instance/AuctioneerInstance.java | 7 +-
.../model/actor/instance/NpcInstance.java | 9 ++-
.../model/actor/instance/PlayerInstance.java | 51 ++++++------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../model/items/instance/ItemInstance.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 29 +++----
.../model/residences/ClanHallAuction.java | 9 ++-
.../model/sevensigns/SevenSigns.java | 3 +-
.../model/sevensigns/SevenSignsFestival.java | 11 +--
.../gameserver/model/siege/ClanHallSiege.java | 5 +-
.../gameserver/model/siege/Siege.java | 7 +-
.../clanhalls/BanditStrongholdSiege.java | 7 +-
.../siege/clanhalls/DevastatedCastle.java | 7 +-
.../siege/clanhalls/FortressOfResistance.java | 7 +-
.../siege/clanhalls/WildBeastFarmSiege.java | 7 +-
.../gameserver/model/spawn/Spawn.java | 3 +-
.../gameserver/model/zone/type/BossZone.java | 9 ++-
.../gameserver/network/GameClient.java | 5 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/AttackRequest.java | 3 +-
.../network/clientpackets/DlgAnswer.java | 2 +-
.../network/clientpackets/EnterWorld.java | 5 +-
.../network/clientpackets/Logout.java | 5 +-
.../clientpackets/RequestJoinSiege.java | 5 +-
.../RequestOustPledgeMember.java | 5 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/serverpackets/CharSelectInfo.java | 5 +-
.../serverpackets/GMViewPledgeInfo.java | 3 +-
.../PledgeReceiveMemberInfo.java | 3 +-
.../PledgeShowMemberListAll.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 5 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../l2jmobius/gameserver/util/MinionList.java | 5 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 9 ++-
.../l2jmobius/telnet/GameStatusThread.java | 3 +-
.../l2jmobius/telnet/TelnetStatusThread.java | 3 +-
.../game/data/scripts/ai/bosses/Antharas.java | 21 ++---
.../game/data/scripts/ai/bosses/Baium.java | 13 +--
.../game/data/scripts/ai/bosses/Benom.java | 9 ++-
.../game/data/scripts/ai/bosses/Core.java | 5 +-
.../data/scripts/ai/bosses/Frintezza.java | 11 +--
.../game/data/scripts/ai/bosses/Orfen.java | 5 +-
.../game/data/scripts/ai/bosses/QueenAnt.java | 5 +-
.../game/data/scripts/ai/bosses/Valakas.java | 13 +--
.../data/scripts/ai/bosses/VanHalter.java | 5 +-
.../game/data/scripts/ai/bosses/Zaken.java | 5 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../l2jmobius/commons/util/IPv4Filter.java | 6 +-
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../l2jmobius/gameserver/TradeController.java | 7 +-
.../l2jmobius/gameserver/ai/NpcWalkerAI.java | 5 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/OfflineTradeTable.java | 3 +-
.../gameserver/data/sql/ClanTable.java | 7 +-
.../gameserver/data/sql/TradeListTable.java | 7 +-
.../AdminCursedWeapons.java | 3 +-
.../admincommandhandlers/AdminDonator.java | 3 +-
.../handler/itemhandlers/HeroCustomItem.java | 3 +-
.../handler/itemhandlers/MOSKey.java | 5 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../FishingChampionshipManager.java | 11 +--
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/PetitionManager.java | 3 +-
.../instancemanager/events/CTF.java | 11 +--
.../gameserver/instancemanager/events/DM.java | 11 +--
.../events/EventsGlobalTask.java | 3 +-
.../instancemanager/events/TvT.java | 11 +--
.../instancemanager/games/Lottery.java | 17 ++--
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/Timestamp.java | 8 +-
.../gameserver/model/actor/Attackable.java | 7 +-
.../gameserver/model/actor/Creature.java | 11 +--
.../actor/instance/AuctioneerInstance.java | 7 +-
.../model/actor/instance/NpcInstance.java | 9 ++-
.../model/actor/instance/PlayerInstance.java | 51 ++++++------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../model/items/instance/ItemInstance.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 29 +++----
.../model/residences/ClanHallAuction.java | 9 ++-
.../model/sevensigns/SevenSigns.java | 3 +-
.../model/sevensigns/SevenSignsFestival.java | 11 +--
.../gameserver/model/siege/ClanHallSiege.java | 5 +-
.../gameserver/model/siege/Siege.java | 7 +-
.../clanhalls/BanditStrongholdSiege.java | 7 +-
.../siege/clanhalls/DevastatedCastle.java | 7 +-
.../siege/clanhalls/FortressOfResistance.java | 7 +-
.../siege/clanhalls/WildBeastFarmSiege.java | 7 +-
.../gameserver/model/spawn/Spawn.java | 3 +-
.../gameserver/model/zone/type/BossZone.java | 9 ++-
.../gameserver/network/GameClient.java | 5 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/AttackRequest.java | 3 +-
.../network/clientpackets/DlgAnswer.java | 3 +-
.../network/clientpackets/EnterWorld.java | 5 +-
.../network/clientpackets/Logout.java | 5 +-
.../clientpackets/RequestJoinSiege.java | 5 +-
.../RequestOustPledgeMember.java | 5 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/serverpackets/CharSelectInfo.java | 5 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 5 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../l2jmobius/gameserver/util/MinionList.java | 5 +-
.../l2jmobius/loginserver/BruteProtector.java | 5 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/GameServerThread.java | 5 +-
.../l2jmobius/loginserver/LoginClient.java | 5 +-
.../loginserver/LoginController.java | 23 +++---
.../l2jmobius/telnet/GameStatusThread.java | 3 +-
.../l2jmobius/telnet/TelnetStatusThread.java | 3 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../scripts/ai/areas/Gracia/AI/Lindvior.java | 5 +-
.../HallOfErosionAttack.java | 5 +-
.../HallOfErosionDefence.java | 5 +-
.../HallOfSufferingAttack.java | 7 +-
.../HallOfSufferingDefence.java | 7 +-
.../HeartInfinityAttack.java | 7 +-
.../HeartInfinityDefence.java | 7 +-
.../SeedOfDestruction/SeedOfDestruction.java | 13 +--
.../AI/Zones/TowerOfNaia/TowerOfNaia.java | 7 +-
.../DemonPrinceFloor/DemonPrinceFloor.java | 3 +-
.../Instances/RankuFloor/RankuFloor.java | 3 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../scripts/ai/bosses/DrChaos/DrChaos.java | 11 +--
.../ai/bosses/Frintezza/Frintezza.java | 13 +--
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../RainbowSpringsChateau.java | 3 +-
.../CharacterBirthday/CharacterBirthday.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../admincommandhandlers/AdminCHSiege.java | 3 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../AdminTerritoryWar.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../usercommandhandlers/InstanceZone.java | 3 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../scripts/instances/AbstractInstance.java | 5 +-
.../CastleDungeon/CastleDungeon.java | 3 +-
.../CavernOfThePirateCaptain.java | 5 +-
.../instances/ChambersOfDelusion/Chamber.java | 13 +--
.../CrystalCaverns/CrystalCaverns.java | 15 ++--
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../Q00307_ControlDeviceOfTheGiants.java | 5 +-
.../Q00311_ExpulsionOfEvilSpirits.java | 7 +-
.../Q00511_AwlUnderFoot.java | 5 +-
.../Q00610_MagicalPowerOfWaterPart2.java | 5 +-
.../Q00616_MagicalPowerOfFirePart2.java | 5 +-
.../Q00726_LightWithinTheDarkness.java | 5 +-
.../Q00727_HopeWithinTheDarkness.java | 5 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../FishingChampionshipManager.java | 11 +--
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 3 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/SoDManager.java | 7 +-
.../instancemanager/SoIManager.java | 5 +-
.../instancemanager/TerritoryWarManager.java | 5 +-
.../instancemanager/events/TvTManager.java | 9 ++-
.../instancemanager/games/BlockChecker.java | 5 +-
.../instancemanager/games/Lottery.java | 17 ++--
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/Message.java | 7 +-
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/WorldObject.java | 3 +-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../actor/instance/AuctioneerInstance.java | 7 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 49 ++++++------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../tasks/player/LookingForFishTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../model/instancezone/Instance.java | 13 +--
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 9 ++-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGame.java | 5 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AuctionableHall.java | 13 +--
.../gameserver/model/residences/ClanHall.java | 5 +-
.../model/residences/ClanHallAuction.java | 9 ++-
.../model/sevensigns/SevenSigns.java | 3 +-
.../model/sevensigns/SevenSignsFestival.java | 11 +--
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/FortSiege.java | 5 +-
.../gameserver/model/siege/Siege.java | 5 +-
.../siege/clanhalls/ClanHallSiegeEngine.java | 5 +-
.../model/siege/clanhalls/SiegableHall.java | 3 +-
.../gameserver/model/zone/type/BossZone.java | 9 ++-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 7 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../clientpackets/RequestExEnchantSkill.java | 2 +-
.../RequestExEnchantSkillRouteChange.java | 2 +-
.../RequestExEnchantSkillSafe.java | 2 +-
.../RequestExEnchantSkillUntrain.java | 2 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinDominionWar.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 5 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExEnchantSkillInfo.java | 2 +-
.../ExEnchantSkillInfoDetail.java | 2 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../network/serverpackets/ServerList.java | 3 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/areas/FantasyIsle/Parade.java | 3 +-
.../ai/areas/FantasyIsle/TalentShow.java | 3 +-
.../scripts/ai/areas/Gracia/AI/Lindvior.java | 5 +-
.../SeedOfAnnihilation.java | 9 ++-
.../HallOfErosionAttack.java | 5 +-
.../HallOfErosionDefence.java | 5 +-
.../HallOfSufferingAttack.java | 7 +-
.../HallOfSufferingDefence.java | 7 +-
.../HeartInfinityAttack.java | 7 +-
.../HeartInfinityDefence.java | 7 +-
.../SeedOfDestruction/SeedOfDestruction.java | 13 +--
.../AI/Zones/TowerOfNaia/TowerOfNaia.java | 7 +-
.../DemonPrinceFloor/DemonPrinceFloor.java | 3 +-
.../Instances/RankuFloor/RankuFloor.java | 3 +-
.../ai/areas/Rune/RuneCastle/Venom/Venom.java | 3 +-
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Beleth/Beleth.java | 9 ++-
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../scripts/ai/bosses/DrChaos/DrChaos.java | 11 +--
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../ai/bosses/QueenShyeed/QueenShyeed.java | 5 +-
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../PriestOfBlessing/PriestOfBlessing.java | 13 +--
.../RainbowSpringsChateau.java | 3 +-
.../FreyaCelebration/FreyaCelebration.java | 3 +-
.../events/GiftOfVitality/GiftOfVitality.java | 7 +-
.../LoveYourGatekeeper.java | 7 +-
.../MasterOfEnchanting.java | 7 +-
.../events/SavingSanta/SavingSanta.java | 11 +--
.../admincommandhandlers/AdminCHSiege.java | 3 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../AdminTerritoryWar.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../usercommandhandlers/InstanceZone.java | 3 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../scripts/instances/AbstractInstance.java | 5 +-
.../CastleDungeon/CastleDungeon.java | 3 +-
.../CavernOfThePirateCaptain.java | 7 +-
.../instances/ChambersOfDelusion/Chamber.java | 13 +--
.../CrystalCaverns/CrystalCaverns.java | 15 ++--
.../FinalEmperialTomb/FinalEmperialTomb.java | 3 +-
.../FinalEmperialTomb/ScarletVanHalisha.java | 7 +-
.../IceQueensCastleBattle.java | 9 ++-
.../scripts/instances/Kamaloka/Kamaloka.java | 3 +-
.../Q00307_ControlDeviceOfTheGiants.java | 5 +-
.../Q00311_ExpulsionOfEvilSpirits.java | 7 +-
.../Q00511_AwlUnderFoot.java | 5 +-
.../Q00610_MagicalPowerOfWaterPart2.java | 5 +-
.../Q00616_MagicalPowerOfFirePart2.java | 5 +-
.../Q00726_LightWithinTheDarkness.java | 5 +-
.../Q00727_HopeWithinTheDarkness.java | 5 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../FishingChampionshipManager.java | 11 +--
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 3 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/SoDManager.java | 7 +-
.../instancemanager/SoIManager.java | 5 +-
.../instancemanager/TerritoryWarManager.java | 5 +-
.../instancemanager/events/TvTManager.java | 9 ++-
.../instancemanager/games/BlockChecker.java | 5 +-
.../instancemanager/games/Lottery.java | 17 ++--
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/Message.java | 7 +-
.../org/l2jmobius/gameserver/model/Nevit.java | 3 +-
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/WorldObject.java | 3 +-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../actor/instance/AuctioneerInstance.java | 7 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 47 +++++------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../tasks/player/LookingForFishTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../model/instancezone/Instance.java | 13 +--
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 9 ++-
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AuctionableHall.java | 13 +--
.../gameserver/model/residences/ClanHall.java | 5 +-
.../model/residences/ClanHallAuction.java | 9 ++-
.../model/sevensigns/SevenSigns.java | 3 +-
.../model/sevensigns/SevenSignsFestival.java | 11 +--
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/FortSiege.java | 5 +-
.../gameserver/model/siege/Siege.java | 5 +-
.../siege/clanhalls/ClanHallSiegeEngine.java | 5 +-
.../model/siege/clanhalls/SiegableHall.java | 3 +-
.../gameserver/model/zone/type/BossZone.java | 9 ++-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 5 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../clientpackets/RequestExEnchantSkill.java | 2 +-
.../RequestExEnchantSkillRouteChange.java | 2 +-
.../RequestExEnchantSkillSafe.java | 2 +-
.../RequestExEnchantSkillUntrain.java | 2 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinDominionWar.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 5 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExEnchantSkillInfo.java | 2 +-
.../ExEnchantSkillInfoDetail.java | 2 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../network/serverpackets/ServerList.java | 3 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 59 +++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../data/scripts/ai/bosses/Zaken/Zaken.java | 5 +-
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 59 +++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../ExOneDayReceiveRewardList.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../data/scripts/ai/bosses/Zaken/Zaken.java | 5 +-
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 59 +++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../ExOneDayReceiveRewardList.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../data/scripts/ai/bosses/Zaken/Zaken.java | 5 +-
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 59 +++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../ExOneDayReceiveRewardList.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../data/scripts/ai/bosses/Zaken/Zaken.java | 5 +-
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../LastImperialTomb/ScarletVanHalisha.java | 7 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 59 +++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../ExOneDayReceiveRewardList.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../data/scripts/ai/bosses/Zaken/Zaken.java | 5 +-
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../effecthandlers/AddHuntingTime.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../LastImperialTomb/ScarletVanHalisha.java | 7 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/RankManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 59 +++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../model/zone/type/TimedHuntingZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 4 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../sessionzones/ExTimedHuntingZoneEnter.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../ExOneDayReceiveRewardList.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../sessionzones/TimedHuntingZoneList.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../FourSepulchers/FourSepulchers.java | 5 +-
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../scripts/ai/bosses/DrChaos/DrChaos.java | 11 +--
.../bosses/Frintezza/ScarletVanHalisha.java | 7 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../scripts/ai/bosses/Sailren/Sailren.java | 11 +--
.../scripts/ai/bosses/Valakas/Valakas.java | 13 +--
.../data/scripts/ai/bosses/Zaken/Zaken.java | 5 +-
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../instancemanager/games/Lottery.java | 17 ++--
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 5 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 59 +++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../mentoring/ConfirmMenteeAdd.java | 5 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../ExOneDayReceiveRewardList.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
.../scripts/ai/areas/OrcBarracks/Tarba.java | 3 +-
.../scripts/ai/bosses/Antharas/Antharas.java | 13 +--
.../data/scripts/ai/bosses/Baium/Baium.java | 15 ++--
.../data/scripts/ai/bosses/Core/Core.java | 5 +-
.../data/scripts/ai/bosses/Orfen/Orfen.java | 5 +-
.../scripts/ai/bosses/QueenAnt/QueenAnt.java | 5 +-
.../data/scripts/ai/bosses/Zaken/Zaken.java | 5 +-
.../CastleChamberlain/CastleChamberlain.java | 2 +-
.../ClanHallAuctioneer.java | 9 ++-
.../ProvisionalHalls/ProvisionalHalls.java | 9 ++-
.../BlossomFestival/BlossomFestival.java | 3 +-
.../scripts/events/HappyHours/HappyHours.java | 7 +-
.../AdminCursedWeapons.java | 3 +-
.../AdminGraciaSeeds.java | 3 +-
.../AdminInstanceZone.java | 3 +-
.../admincommandhandlers/AdminPunishment.java | 3 +-
.../admincommandhandlers/AdminServerInfo.java | 5 +-
.../handlers/bypasshandlers/FindPvP.java | 3 +-
.../LoginMonthDailyMissionHandler.java | 5 +-
.../LoginWeekendDailyMissionHandler.java | 3 +-
.../effecthandlers/AddHuntingTime.java | 3 +-
.../effecthandlers/SayhaGraceSupport.java | 9 ++-
.../handlers/itemhandlers/LimitedSayha.java | 3 +-
.../punishmenthandlers/ChatBanHandler.java | 3 +-
.../punishmenthandlers/JailHandler.java | 3 +-
.../handlers/telnethandlers/player/Ban.java | 3 +-
.../telnethandlers/player/BanChat.java | 3 +-
.../handlers/telnethandlers/player/Jail.java | 3 +-
.../usercommandhandlers/ClanPenalty.java | 7 +-
.../handlers/usercommandhandlers/Time.java | 3 +-
.../voicedcommandhandlers/ChatAdmin.java | 3 +-
.../voicedcommandhandlers/Premium.java | 3 +-
.../LastImperialTomb/ScarletVanHalisha.java | 7 +-
.../org/l2jmobius/commons/util/Chronos.java | 80 +++++++++++++++++++
.../org/l2jmobius/gameserver/GameServer.java | 5 +-
.../gameserver/GameTimeController.java | 7 +-
.../gameserver/ItemsAutoDestroy.java | 5 +-
.../org/l2jmobius/gameserver/Shutdown.java | 7 +-
.../l2jmobius/gameserver/ai/CreatureAI.java | 3 +-
.../cache/WarehouseCacheManager.java | 5 +-
.../gameserver/data/BotReportTable.java | 13 +--
.../gameserver/data/sql/ClanTable.java | 5 +-
.../data/sql/OfflineTraderTable.java | 3 +-
.../handler/AbstractDailyMissionHandler.java | 3 +-
.../handler/AdminCommandHandler.java | 5 +-
.../instancemanager/AntiFeedManager.java | 5 +-
.../instancemanager/CastleManorManager.java | 3 +-
.../instancemanager/CursedWeaponsManager.java | 3 +-
.../instancemanager/DBSpawnManager.java | 7 +-
.../instancemanager/GraciaSeedsManager.java | 7 +-
.../gameserver/instancemanager/IdManager.java | 7 +-
.../instancemanager/InstanceManager.java | 7 +-
.../instancemanager/ItemsOnGroundManager.java | 3 +-
.../instancemanager/MentorManager.java | 3 +-
.../instancemanager/PremiumManager.java | 5 +-
.../instancemanager/PunishmentManager.java | 3 +-
.../instancemanager/RankManager.java | 3 +-
.../instancemanager/games/BlockChecker.java | 5 +-
.../gameserver/model/CursedWeapon.java | 9 ++-
.../l2jmobius/gameserver/model/ItemInfo.java | 5 +-
.../l2jmobius/gameserver/model/Message.java | 11 +--
.../l2jmobius/gameserver/model/Petition.java | 3 +-
.../org/l2jmobius/gameserver/model/Spawn.java | 3 +-
.../l2jmobius/gameserver/model/TimeStamp.java | 9 ++-
.../gameserver/model/actor/Attackable.java | 7 +-
.../gameserver/model/actor/Creature.java | 7 +-
.../l2jmobius/gameserver/model/actor/Npc.java | 3 +-
.../model/actor/instance/BlockInstance.java | 3 +-
.../model/actor/instance/PlayerInstance.java | 61 +++++++-------
.../actor/instance/VillageMasterInstance.java | 5 +-
.../model/actor/stat/PlayerStat.java | 3 +-
.../tasks/attackable/CommandChannelTimer.java | 3 +-
.../tasks/player/IllegalPlayerActionTask.java | 5 +-
.../gameserver/model/buylist/Product.java | 3 +-
.../ceremonyofchaos/CeremonyOfChaosEvent.java | 5 +-
.../l2jmobius/gameserver/model/clan/Clan.java | 25 +++---
.../gameserver/model/clan/ClanWar.java | 19 ++---
.../model/eventengine/EventScheduler.java | 7 +-
.../gameserver/model/events/EventType.java | 4 +-
.../model/holders/TrainingHolder.java | 3 +-
.../model/instancezone/Instance.java | 9 ++-
.../model/instancezone/InstanceTemplate.java | 7 +-
.../conditions/ConditionReenter.java | 3 +-
.../model/itemauction/ItemAuction.java | 9 ++-
.../itemauction/ItemAuctionInstance.java | 31 +++----
.../model/items/instance/ItemInstance.java | 11 +--
.../model/olympiad/AbstractOlympiadGame.java | 3 +-
.../gameserver/model/olympiad/Hero.java | 7 +-
.../model/olympiad/OlympiadGameNormal.java | 3 +-
.../model/punishment/PunishmentTask.java | 7 +-
.../gameserver/model/quest/LongTimeEvent.java | 5 +-
.../gameserver/model/quest/QuestState.java | 3 +-
.../model/residences/AbstractResidence.java | 3 +-
.../gameserver/model/residences/ClanHall.java | 7 +-
.../model/residences/ClanHallAuction.java | 3 +-
.../model/residences/ResidenceFunction.java | 7 +-
.../gameserver/model/shuttle/ShuttleStop.java | 9 ++-
.../gameserver/model/siege/Castle.java | 5 +-
.../gameserver/model/siege/Fort.java | 13 +--
.../gameserver/model/siege/Siege.java | 5 +-
.../stats/finalizers/RegenHPFinalizer.java | 4 +-
.../stats/finalizers/RegenMPFinalizer.java | 2 +-
.../model/zone/type/NoRestartZone.java | 3 +-
.../model/zone/type/TimedHuntingZone.java | 3 +-
.../gameserver/network/GameClient.java | 3 +-
.../network/clientpackets/AllyDismiss.java | 3 +-
.../network/clientpackets/AllyLeave.java | 3 +-
.../network/clientpackets/EnterWorld.java | 3 +-
.../clientpackets/MoveBackwardToLocation.java | 3 +-
.../clientpackets/RequestEnchantItem.java | 3 +-
.../RequestExAddEnchantScrollItem.java | 3 +-
.../RequestExRemoveEnchantSupportItem.java | 3 +-
.../RequestExSetPledgeCrestLarge.java | 3 +-
.../RequestExTryToPutEnchantSupportItem.java | 3 +-
.../RequestExTryToPutEnchantTargetItem.java | 3 +-
.../clientpackets/RequestJoinSiege.java | 3 +-
.../RequestMoveToLocationInVehicle.java | 3 +-
.../RequestOustPledgeMember.java | 5 +-
.../RequestPetitionFeedback.java | 3 +-
...questPledgeSignInForOpenJoiningMethod.java | 5 +-
.../clientpackets/RequestRestartPoint.java | 2 +-
.../clientpackets/RequestSetPledgeCrest.java | 3 +-
.../clientpackets/RequestStartPledgeWar.java | 3 +-
.../RequestWithdrawalPledge.java | 3 +-
.../network/clientpackets/UseItem.java | 3 +-
.../appearance/RequestShapeShiftingItem.java | 3 +-
.../RequestPurchaseLimitShopItemBuy.java | 5 +-
.../mentoring/ConfirmMenteeAdd.java | 4 +-
.../primeshop/RequestBRBuyProduct.java | 3 +-
.../primeshop/RequestBRPresentBuyProduct.java | 3 +-
.../sessionzones/ExTimedHuntingZoneEnter.java | 3 +-
.../training/NotifyTrainingRoomEnd.java | 5 +-
.../loginserverpackets/game/TempBan.java | 3 +-
.../serverpackets/CharSelectionInfo.java | 5 +-
.../serverpackets/ExInzoneWaiting.java | 3 +-
.../ExListPartyMatchingWaitingRoom.java | 3 +-
.../serverpackets/ExPartyRoomMember.java | 3 +-
.../serverpackets/ExShowReceivedPostList.java | 3 +-
.../serverpackets/ExShowSentPostList.java | 3 +-
.../network/serverpackets/SiegeInfo.java | 3 +-
.../network/serverpackets/SkillCoolTime.java | 3 +-
.../ExOneDayReceiveRewardList.java | 3 +-
.../friend/ExFriendDetailInfo.java | 3 +-
.../ExPurchaseLimitShopItemListNew.java | 3 +-
.../sessionzones/TimedHuntingZoneList.java | 3 +-
.../gameserver/scripting/ManagedScript.java | 4 +-
.../taskmanager/AttackStanceTaskManager.java | 5 +-
.../taskmanager/BuyListTaskManager.java | 3 +-
.../taskmanager/DecayTaskManager.java | 9 ++-
.../ItemAppearanceTaskManager.java | 3 +-
.../taskmanager/ItemLifeTimeTaskManager.java | 3 +-
.../taskmanager/ItemManaTaskManager.java | 5 +-
.../MessageDeletionTaskManager.java | 3 +-
.../PlayerAutoSaveTaskManager.java | 5 +-
.../taskmanager/PvpFlagTaskManager.java | 3 +-
.../RandomAnimationTaskManager.java | 5 +-
.../taskmanager/RespawnTaskManager.java | 3 +-
.../gameserver/taskmanager/TaskManager.java | 7 +-
.../l2jmobius/gameserver/ui/SystemPanel.java | 5 +-
.../gameserver/util/FloodProtectorAction.java | 5 +-
.../gameserver/util/OfflineTradeUtil.java | 3 +-
.../loginserver/FloodProtectedListener.java | 9 ++-
.../loginserver/LoginController.java | 13 +--
.../loginserver/network/LoginClient.java | 5 +-
.../loginserver/network/util/IPv4Filter.java | 8 +-
3419 files changed, 13203 insertions(+), 8113 deletions(-)
create mode 100644 L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/util/Chronos.java
create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_Classic_Interlude/java/org/l2jmobius/commons/util/Chronos.java
create mode 100644 L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/commons/util/Chronos.java
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 e66362d6c0..86b46f1919 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
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.model.Location;
@@ -137,7 +138,7 @@ public class Parade extends AbstractNpcAI
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
- LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
+ LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
}
void load()
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
index c91b42bb26..7757d82c61 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -304,7 +305,7 @@ public class TalentShow extends AbstractNpcAI
hourDiff *= 3600000;
minDiff *= 60000;
diff = hourDiff + minDiff;
- LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
+ LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
startQuestTimer("Start", diff, null, null); // first start
}
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 a00d59028e..037b29d579 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
@@ -29,6 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -516,7 +517,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
final GlobalVariablesManager vars = GlobalVariablesManager.getInstance();
final long var = vars.getLong("FourSepulchers" + npcId, 0) + (TIME_ATTACK * 60 * 1000);
- if (var > System.currentTimeMillis())
+ if (var > Chronos.currentTimeMillis())
{
showHtmlFile(player, npcId + "-NE.html", npc, null);
return;
@@ -581,7 +582,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
ThreadPool.schedule(() -> ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers(), TIME_ATTACK * 60 * 1000);
// Save attack time
- vars.set("FourSepulchers" + npcId, System.currentTimeMillis());
+ vars.set("FourSepulchers" + npcId, Chronos.currentTimeMillis());
// Init progress
STORED_PROGRESS.put(sepulcherId, 1); // start from 1
// Start
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
index 4badef030d..68a46309c8 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
@@ -19,6 +19,7 @@ package ai.areas.KeucereusAllianceBase;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
@@ -111,7 +112,7 @@ public class LindviorScene extends AbstractNpcAI
final GregorianCalendar date = new GregorianCalendar();
date.set(Calendar.MINUTE, RESET_MIN);
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
- if (System.currentTimeMillis() >= date.getTimeInMillis())
+ if (Chronos.currentTimeMillis() >= date.getTimeInMillis())
{
date.add(Calendar.DAY_OF_WEEK, 1);
}
@@ -129,7 +130,7 @@ public class LindviorScene extends AbstractNpcAI
{
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
}
- return date.getTimeInMillis() - System.currentTimeMillis();
+ return date.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
index 80dffe38b2..de8ea0aea9 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
@@ -19,6 +19,7 @@ package ai.areas.Rune.RuneCastle.Venom;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -111,7 +112,7 @@ public class Venom extends AbstractNpcAI
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
index a7d7250e8b..c42186c0d0 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -229,7 +230,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
int buffsNow = 0;
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
- if (var < System.currentTimeMillis())
+ if (var < Chronos.currentTimeMillis())
{
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
@@ -254,7 +255,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
reenter.set(Calendar.MINUTE, 0);
reenter.set(Calendar.HOUR_OF_DAY, 13);
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
- if (reenter.getTimeInMillis() <= System.currentTimeMillis())
+ if (reenter.getTimeInMillis() <= Chronos.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 7);
}
@@ -272,7 +273,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
}
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
private void spawnGroupOfMinion(MonsterInstance npc, int[] mobIds)
@@ -317,7 +318,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
zone.clearSkills();
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
else if (event.equalsIgnoreCase("transform"))
{
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
index e004e80b3d..8044c58bf3 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -345,7 +346,7 @@ public class Anakim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ANAKIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_anakim", time, null, null);
@@ -373,7 +374,7 @@ public class Anakim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(ANAKIM, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -550,7 +551,7 @@ public class Anakim extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_anakimStatus == WAITING) && (npc.getId() == ANAKIM_CUBIC))
@@ -578,7 +579,7 @@ public class Anakim extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid())// Anakim and minions
{
// Anti BUGGERS
@@ -614,7 +615,7 @@ public class Anakim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ANAKIM, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(ANAKIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ANAKIM, info);
startQuestTimer("unlock_anakim", respawnTime, null, null);
@@ -686,7 +687,7 @@ public class Anakim extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
index 4a77fb6bfd..fe808aef25 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.MountType;
@@ -169,14 +170,14 @@ public class Antharas extends AbstractNpcAI
_antharas = (GrandBossInstance) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
_antharas.setCurrentHpMp(curr_hp, curr_mp);
addBoss(_antharas);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
break;
}
case DEAD:
{
- final long remain = respawnTime - System.currentTimeMillis();
+ final long remain = respawnTime - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -272,7 +273,7 @@ public class Antharas extends AbstractNpcAI
_antharas.setRandomWalking(false);
_antharas.teleToLocation(181323, 114850, -7623, 32542);
setStatus(IN_FIGHT);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
zone.broadcastPacket(new PlaySound("BS02_A"));
startQuestTimer("CAMERA_1", 23, _antharas, null);
break;
@@ -367,7 +368,7 @@ public class Antharas extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 900000) < Chronos.currentTimeMillis()))
{
setStatus(ALIVE);
for (Creature creature : zone.getCharactersInside())
@@ -619,7 +620,7 @@ public class Antharas extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BOMBER)
{
if (npc.calculateDistance3D(attacker) < 230)
@@ -765,7 +766,7 @@ public class Antharas extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
+ GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
}
private final void refreshAiParams(PlayerInstance attacker, int damage)
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Baium/Baium.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Baium/Baium.java
index 58985ad33b..0cd17178d9 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Baium/Baium.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Baium/Baium.java
@@ -17,6 +17,7 @@
package ai.bosses.Baium;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.CategoryType;
@@ -136,7 +137,7 @@ public class Baium extends AbstractNpcAI
final int heading = info.getInt("heading");
_baium = (GrandBossInstance) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
_baium.setCurrentHpMp(curr_hp, curr_mp);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
addBoss(_baium);
for (Location loc : ARCHANGEL_LOC)
@@ -149,7 +150,7 @@ public class Baium extends AbstractNpcAI
}
case DEAD:
{
- final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -209,7 +210,7 @@ public class Baium extends AbstractNpcAI
_baium.disableCoreAI(true);
_baium.setRandomWalking(false);
addBoss(_baium);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
@@ -375,7 +376,7 @@ public class Baium extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
{
notifyEvent("CLEAR_ZONE", null, null);
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
@@ -383,7 +384,7 @@ public class Baium extends AbstractNpcAI
}
else if (npc != null)
{
- if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
+ if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
{
npc.setTarget(npc);
npc.doCast(HEAL_OF_BAIUM.getSkill());
@@ -484,7 +485,7 @@ public class Baium extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BAIUM)
{
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
@@ -663,7 +664,7 @@ public class Baium extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
+ GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
}
private void manageSkills(Npc npc)
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
index aa8528926d..dfce75d90b 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -108,7 +109,7 @@ public class Beleth extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("BELETH_UNLOCK", time, null, null);
@@ -349,7 +350,7 @@ public class Beleth extends AbstractNpcAI
c.setImmobilized(false);
}
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, null, null);
startQuestTimer("SPAWN25", 60000, null, null);
break;
@@ -507,7 +508,7 @@ public class Beleth extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((_lastAttack + 900000) < System.currentTimeMillis())
+ if ((_lastAttack + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -708,7 +709,7 @@ public class Beleth extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(REAL_BELETH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
deleteAll();
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Core/Core.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Core/Core.java
index 969bb08788..69dc20dc5d 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Core/Core.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Core/Core.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -89,7 +90,7 @@ public class Core extends AbstractNpcAI
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
@@ -206,7 +207,7 @@ public class Core extends AbstractNpcAI
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
index 3ed92d8f08..b499a47575 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.MountType;
@@ -295,7 +296,7 @@ public class IceQueensCastleBattle extends AbstractInstance
{
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
- controller.getVariables().set("TIMER_END", System.currentTimeMillis() + 360000);
+ controller.getVariables().set("TIMER_END", Chronos.currentTimeMillis() + 360000);
}
break;
}
@@ -688,7 +689,7 @@ public class IceQueensCastleBattle extends AbstractInstance
}
case "SHOW_GLAKIAS_TIMER":
{
- final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - System.currentTimeMillis()) / 1000);
+ final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - Chronos.currentTimeMillis()) / 1000);
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
break;
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
index acbc2c3094..6023594423 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
@@ -23,6 +23,7 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -143,11 +144,11 @@ public class ScarletVanHalisha extends AbstractNpcAI
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
}
@@ -248,7 +249,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
case FRINTEZZA_DAEMON_MORPH:
case FRINTEZZA_DAEMON_FIELD:
{
- _lastRangedSkillTime = System.currentTimeMillis();
+ _lastRangedSkillTime = Chronos.currentTimeMillis();
skillRange = 550;
break;
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
index 62507c9762..510a8060de 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -371,7 +372,7 @@ public class Lilith extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LILITH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lilith", time, null, null);
@@ -399,7 +400,7 @@ public class Lilith extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(LILITH, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -576,7 +577,7 @@ public class Lilith extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_lilithStatus == WAITING) && (npc.getId() == LILITH_CUBIC))
@@ -594,7 +595,7 @@ public class Lilith extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid()) // Lilith and minions
{
// Anti BUGGERS
@@ -630,7 +631,7 @@ public class Lilith extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LILITH, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(LILITH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LILITH, info);
startQuestTimer("unlock_lilith", respawnTime, null, null);
@@ -702,7 +703,7 @@ public class Lilith extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
@Override
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 6b02643bc0..63811284a1 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
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -213,7 +214,7 @@ public class Lindvior extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lindvior", time, null, null);
@@ -863,7 +864,7 @@ public class Lindvior extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
final long respawnTime = (Config.LINDVIOR_SPAWN_INTERVAL + getRandom(-Config.LINDVIOR_SPAWN_RANDOM, Config.LINDVIOR_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
startQuestTimer("unlock_lindvior", respawnTime, null, null);
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
index edd3abc4b8..801d31427b 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -97,7 +98,7 @@ public class Orfen extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for Orfen from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if Orfen is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -328,7 +329,7 @@ public class Orfen extends AbstractNpcAI
startQuestTimer("orfen_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ORFEN, info);
cancelQuestTimer("check_minion_loc", npc, null);
cancelQuestTimer("check_orfen_pos", npc, null);
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 f2869a3fe9..c00a82fb97 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
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -96,7 +97,7 @@ public class QueenAnt extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for queen ant from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if queen ant is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -367,7 +368,7 @@ public class QueenAnt extends AbstractNpcAI
cancelQuestTimer("heal", null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(QUEEN, info);
_nurses.clear();
_larva.deleteMe();
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
index eda49595a1..fd26faf27c 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.QueenShyeed;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -87,7 +88,7 @@ public class QueenShyeed extends AbstractNpcAI
private void spawnShyeed()
{
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
- final long remain = respawn != 0 ? respawn - System.currentTimeMillis() : 0;
+ final long remain = respawn != 0 ? respawn - Chronos.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("respawn", remain, null, null);
@@ -103,7 +104,7 @@ public class QueenShyeed extends AbstractNpcAI
private void startRespawn()
{
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
- GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(System.currentTimeMillis() + respawnTime));
+ GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(Chronos.currentTimeMillis() + respawnTime));
startQuestTimer("respawn", respawnTime, null, null);
// MOB_BUFF_ZONE.setEnabled(false);
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
index 4d4eb8653a..be58208558 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.Sailren;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -71,7 +72,7 @@ public class Sailren extends AbstractNpcAI
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
- final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
+ final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - Chronos.currentTimeMillis();
if (remain > 0)
{
STATUS = Status.DEAD;
@@ -118,7 +119,7 @@ public class Sailren extends AbstractNpcAI
{
takeItems(player, GAZKH, 1);
STATUS = Status.IN_FIGHT;
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
for (PlayerInstance member : player.getParty().getMembers())
{
if (member.isInsideRadius3D(npc, 1000))
@@ -237,7 +238,7 @@ public class Sailren extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
+ if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < Chronos.currentTimeMillis()))
{
cancelQuestTimer("TIME_OUT", null, null);
notifyEvent("TIME_OUT", null, null);
@@ -257,7 +258,7 @@ public class Sailren extends AbstractNpcAI
{
if (zone.isCharacterInZone(attacker))
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -274,7 +275,7 @@ public class Sailren extends AbstractNpcAI
STATUS = Status.DEAD;
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
final long respawnTime = RESPAWN * 3600000;
- GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set("SailrenRespawn", Chronos.currentTimeMillis() + respawnTime);
cancelQuestTimer("CHECK_ATTACK", null, null);
cancelQuestTimer("TIME_OUT", null, null);
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
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 0c824fd3b2..523f53e898 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
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -326,7 +327,7 @@ public class Trasken extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_trasken", time, null, null);
@@ -604,7 +605,7 @@ public class Trasken extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
startQuestTimer("unlock_trasken", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
index 94d29e346e..c8e0f497af 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.MountType;
@@ -129,7 +130,7 @@ public class Valakas extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for valakas from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (temp > 0)
{
// The time has not yet expired. Mark Valakas as currently locked (dead).
@@ -168,7 +169,7 @@ public class Valakas extends AbstractNpcAI
if (status == FIGHTING)
{
// stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
startQuestTimer("regen_task", 60000, valakas, null, true);
startQuestTimer("skill_task", 2000, valakas, null, true);
@@ -196,7 +197,7 @@ public class Valakas extends AbstractNpcAI
if (event.equalsIgnoreCase("beginning"))
{
// Stores current time
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
// Teleport Valakas to his lair.
npc.teleToLocation(VALAKAS_LAIR);
@@ -220,7 +221,7 @@ public class Valakas extends AbstractNpcAI
else if (event.equalsIgnoreCase("regen_task"))
{
// Inactivity task - 15min
- if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
+ if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < Chronos.currentTimeMillis()))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
@@ -416,7 +417,7 @@ public class Valakas extends AbstractNpcAI
npc.setTarget(attacker);
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
}
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -447,7 +448,7 @@ public class Valakas extends AbstractNpcAI
startQuestTimer("valakas_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
return super.onKill(npc, killer, isSummon);
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
index ddc6ff9e74..40bd1cf6c2 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
@@ -46,8 +46,8 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcManorBypass;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.teleporter.TeleportHolder;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index 1c6b4d8097..fd735bb6cd 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -26,6 +26,7 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -153,7 +154,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -189,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
@@ -247,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
@@ -296,7 +297,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0]
");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
sb.append(" | ");
sb.append(auction.getHighestBid());
sb.append(" | ");
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
index f469c39159..2362aa9446 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -21,6 +21,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.Location;
@@ -73,7 +74,7 @@ public class ProvisionalHalls extends AbstractNpcAI
if (resetTime > 0)
{
cancelQuestTimers(HALL_RESET_VAR + id);
- startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
}
}
}
@@ -126,7 +127,7 @@ public class ProvisionalHalls extends AbstractNpcAI
for (int id : CLAN_HALLS.keySet())
{
- if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < Chronos.currentTimeMillis()))
{
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
@@ -137,7 +138,7 @@ public class ProvisionalHalls extends AbstractNpcAI
clanHall.setOwner(player.getClan());
}
player.sendMessage("Congratulations! You now own a provisional clan hall!");
- startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
return null;
}
}
@@ -177,7 +178,7 @@ public class ProvisionalHalls extends AbstractNpcAI
else if (event.startsWith(HALL_RESET_VAR))
{
final String id = event.replace(HALL_RESET_VAR, "");
- if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
{
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
if (clanId > 0)
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index 18f813b1a2..a3c74220a9 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -19,6 +19,7 @@ package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -111,7 +112,7 @@ public class TrainingCamp extends AbstractNpcAI
player.teleToLocation(TRAINING_LOCATION);
player.setImmobilized(true);
// @Sdw: Here we are supposed to send ExUserInfoEquipSlot with a fake equip of a SLS, feels ugly to me, not doing it.
- player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
+ player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), Chronos.currentTimeMillis(), -1));
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
@@ -203,7 +204,7 @@ public class TrainingCamp extends AbstractNpcAI
final TrainingHolder holder = player.getTraingCampInfo();
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
index 49dfa6b963..6140daa716 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
@@ -16,6 +16,7 @@
*/
package events.FreyaCelebration;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -79,7 +80,7 @@ public class FreyaCelebration extends LongTimeEvent
{
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
if (currentTime > reuseTime)
{
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
index cce5b52533..d97b3c74db 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
@@ -16,6 +16,7 @@
*/
package events.GiftOfVitality;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -94,9 +95,9 @@ public class GiftOfVitality extends LongTimeEvent
case "vitality":
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -110,7 +111,7 @@ public class GiftOfVitality extends LongTimeEvent
{
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
htmltext = "4306-okvitality.htm";
}
break;
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
index 038d7883b0..7fb3b481dd 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
@@ -16,6 +16,7 @@
*/
package events.LoveYourGatekeeper;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -58,9 +59,9 @@ public class LoveYourGatekeeper extends LongTimeEvent
if (player.getAdena() >= PRICE)
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -73,7 +74,7 @@ public class LoveYourGatekeeper extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, PRICE);
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
}
}
else
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
index 0898d8dbc5..088b261fbe 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
@@ -16,6 +16,7 @@
*/
package events.MasterOfEnchanting;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -86,7 +87,7 @@ public class MasterOfEnchanting extends LongTimeEvent
}
else if (event.equalsIgnoreCase("buy_scroll_24"))
{
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
final String value = player.getVariables().getString("MasterOfEnchanting", "");
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
@@ -100,7 +101,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
@@ -134,7 +135,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/SavingSanta/SavingSanta.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
index 4f95514f8c..b6900127dc 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -324,7 +325,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_rewardedPlayers.containsKey(pl.getAccountName()))
{
- final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
+ final long elapsedTimeSinceLastRewarded = Chronos.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
{
continue;
@@ -333,7 +334,7 @@ public class SavingSanta extends LongTimeEvent
else
{
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
- if ((System.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
+ if ((Chronos.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
{
_rewardedPlayers.put(pl.getAccountName(), time);
continue;
@@ -343,8 +344,8 @@ public class SavingSanta extends LongTimeEvent
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
- _rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
- player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
+ _rewardedPlayers.put(pl.getAccountName(), Chronos.currentTimeMillis());
+ player.getVariables().set("LAST_SANTA_REWARD", Chronos.currentTimeMillis());
startQuestTimer("SantaRewarding0", 500, santa, pl);
}
}
@@ -437,7 +438,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
{
startQuestTimer("SantaBlessings", 15000, null, null);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Npc santaHelper1 : _santaHelpers)
{
for (PlayerInstance plb : World.getInstance().getVisibleObjects(santaHelper1, PlayerInstance.class))
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
index 64d4112e1f..729838d853 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Collection;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.CursedWeapon;
@@ -209,7 +210,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
}
- cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
+ cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
cw.reActivate();
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
index 9801093a20..0e4285c8e3 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Calendar;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -66,7 +67,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
{
final Calendar nextChangeDate = Calendar.getInstance();
- nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
+ nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
html.replace("%sodtime%", nextChangeDate.getTime().toString());
}
else
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
index e2c17e3d50..dec3cec950 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,7 +119,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
int hours = 0;
int minutes = 0;
final int id = entry.getKey();
- final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
if (remainingTime > 0)
{
hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
index 5fffc77ae3..8c3faede2d 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -233,7 +234,7 @@ public class AdminPunishment implements IAdminCommandHandler
long expirationTime = Integer.parseInt(exp);
if (expirationTime > 0)
{
- expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
+ expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
}
final PunishmentAffect affect = PunishmentAffect.getByName(af);
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
index aa1d6dd435..ae1bb4e0b2 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -60,7 +61,7 @@ public class AdminServerInfo implements IAdminCommandHandler
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
- html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
+ html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
html.replace("%serverUpTime%", getServerUpTime());
html.replace("%onlineAll%", getPlayersCount("ALL"));
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
@@ -76,7 +77,7 @@ public class AdminServerInfo implements IAdminCommandHandler
private String getServerUpTime()
{
- long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
+ long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
final long days = TimeUnit.MILLISECONDS.toDays(time);
time -= TimeUnit.DAYS.toMillis(days);
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
index ff3b82a10f..21489c89f6 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IBypassHandler;
@@ -133,7 +134,7 @@ public class FindPvP implements IBypassHandler
player.setSpawnProtection(true);
if (!player.isGM())
{
- player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
player.startPvPFlag();
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
index 71928b144a..c2ea6f7a5a 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.punishmenthandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.model.World;
@@ -126,7 +127,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
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 245af11bfa..2abbe8e8e8 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
@@ -17,6 +17,7 @@
package handlers.punishmenthandlers;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
@@ -180,7 +181,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
index 3dd1cdc97d..fd92c92ed9 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Ban implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
index f653561c0d..85b92a163b 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class BanChat implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
index cf3736fc0e..c21718ad0c 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Jail implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
index 43b6df41dc..a57194664d 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
@@ -18,6 +18,7 @@ package handlers.usercommandhandlers;
import java.text.SimpleDateFormat;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -46,7 +47,7 @@ public class ClanPenalty implements IUserCommandHandler
final StringBuilder htmlContent = new StringBuilder(500);
htmlContent.append("");
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append("Unable to join a clan. | ");
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
@@ -54,7 +55,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append(" | Unable to create a clan. | ");
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
@@ -62,7 +63,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
+ if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
{
htmlContent.append(" | Unable to invite a clan member. | ");
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/usercommandhandlers/Time.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
index 530047a4f2..57bd48cd81 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Time implements IUserCommandHandler
player.sendPacket(sm);
if (Config.DISPLAY_SERVER_TIME)
{
- player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
+ player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
}
return true;
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
index a2eab150c7..f727b3518f 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
@@ -18,6 +18,7 @@ package handlers.voicedcommandhandlers;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
@@ -103,7 +104,7 @@ public class ChatAdmin implements IVoicedCommandHandler
return false;
}
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
if (expirationTime > 0)
{
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
index 213e03e20a..5bf36c47d0 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
@@ -19,6 +19,7 @@ package handlers.voicedcommandhandlers;
import java.text.SimpleDateFormat;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Premium implements IVoicedCommandHandler
html.append(" |
Spoil Chance: x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " |
");
html.append("Spoil Amount: x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " |
");
html.append("Expires: " + format.format(endDate) + " |
");
- html.append("Current Date: " + format.format(System.currentTimeMillis()) + "
|
");
+ html.append("Current Date: " + format.format(Chronos.currentTimeMillis()) + "
|
");
html.append("Premium Info & Rules
|
");
html.append("1. Premium accounts CAN NOT BE TRANSFERED. |
");
html.append("2. Premium does not effect party members. |
");
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 4dedee6473..6a07191990 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
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -156,7 +157,7 @@ public class CastleDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -174,7 +175,7 @@ public class CastleDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
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 686b01379b..ea8ca11b83 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
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -169,7 +170,7 @@ public class FortressDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -197,7 +198,7 @@ public class FortressDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
index 298c540332..cba8d2bb56 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
@@ -469,7 +470,7 @@ public class Kamaloka extends AbstractInstance
continue;
}
// if found instance still can't be reentered - exit
- if (System.currentTimeMillis() < entry.getValue().longValue())
+ if (Chronos.currentTimeMillis() < entry.getValue().longValue())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
sm.addPcName(partyMember);
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
index b3de2f227a..31fa72d28c 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
@@ -260,7 +261,7 @@ public class PailakaRuneCastle extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first wave
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
}
@@ -280,7 +281,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
@@ -309,7 +310,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q00307_ControlDeviceOfTheGiants/Q00307_ControlDeviceOfTheGiants.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q00307_ControlDeviceOfTheGiants/Q00307_ControlDeviceOfTheGiants.java
index 36b940fad1..19dedba42e 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q00307_ControlDeviceOfTheGiants/Q00307_ControlDeviceOfTheGiants.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q00307_ControlDeviceOfTheGiants/Q00307_ControlDeviceOfTheGiants.java
@@ -16,6 +16,7 @@
*/
package quests.Q00307_ControlDeviceOfTheGiants;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -101,7 +102,7 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
{
return "32711-09.html";
}
- if ((GlobalVariablesManager.getInstance().getLong("GiantsControlDeviceRespawn", 0) - System.currentTimeMillis()) > 0)
+ if ((GlobalVariablesManager.getInstance().getLong("GiantsControlDeviceRespawn", 0) - Chronos.currentTimeMillis()) > 0)
{
return "32711-09a.html";
}
@@ -168,7 +169,7 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
qst.setCond(2, true);
}
}
- GlobalVariablesManager.getInstance().set("GiantsControlDeviceRespawn", Long.toString(System.currentTimeMillis() + RESPAWN_DELAY));
+ GlobalVariablesManager.getInstance().set("GiantsControlDeviceRespawn", Long.toString(Chronos.currentTimeMillis() + RESPAWN_DELAY));
}
break;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/Chronos.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/Chronos.java
new file mode 100644
index 0000000000..a4d15f77e5
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/Chronos.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2021 Pantelis Andrianakis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.l2jmobius.commons.util;
+
+/**
+ * Chronos updates an internal long value with System.currentTimeMillis() approximately every 1 millisecond.
+ * To get the current time in milliseconds use Chronos.currentTimeMillis()
+ * @author Pantelis Andrianakis
+ * @version February 3rd 2021
+ */
+public class Chronos extends Thread
+{
+ private long _currentTimeMillis = System.currentTimeMillis();
+
+ public Chronos()
+ {
+ super.setName("Chronos");
+ super.setPriority(MAX_PRIORITY);
+ super.setDaemon(true);
+ super.start();
+ }
+
+ @Override
+ public void run()
+ {
+ while (true)
+ {
+ _currentTimeMillis = System.currentTimeMillis();
+
+ // Sleep for approximately 1 millisecond.
+ try
+ {
+ Thread.sleep(1);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /**
+ * Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond,the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
+ *
+ * See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).
+ * @return the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+ */
+ public static long currentTimeMillis()
+ {
+ return getInstance()._currentTimeMillis;
+ }
+
+ public static Chronos getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final Chronos INSTANCE = new Chronos();
+ }
+}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java
index e0ee65aba1..4df08e3d52 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java
@@ -32,6 +32,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.enums.ServerMode;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.DeadLockDetector;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.BotReportTable;
@@ -176,7 +177,7 @@ public class GameServer
public GameServer() throws Exception
{
- final long serverLoadStart = System.currentTimeMillis();
+ final long serverLoadStart = Chronos.currentTimeMillis();
// GUI
if (!GraphicsEnvironment.isHeadless())
@@ -453,7 +454,7 @@ public class GameServer
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
- LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
+ LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
ClientNetworkManager.getInstance().start();
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/GameTimeController.java
index aa4d359090..48391b466d 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/GameTimeController.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange;
@@ -97,7 +98,7 @@ public class GameTimeController extends Thread
*/
public int getGameTicks()
{
- return (int) ((System.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
+ return (int) ((Chronos.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
}
/**
@@ -155,7 +156,7 @@ public class GameTimeController extends Thread
while (true)
{
- nextTickTime = ((System.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
+ nextTickTime = ((Chronos.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
try
{
@@ -166,7 +167,7 @@ public class GameTimeController extends Thread
LOGGER.log(Level.WARNING, getClass().getSimpleName(), e);
}
- sleepTime = nextTickTime - System.currentTimeMillis();
+ sleepTime = nextTickTime - Chronos.currentTimeMillis();
if (sleepTime > 0)
{
try
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
index 2fcae24603..cfb16ebb07 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -42,7 +43,7 @@ public class ItemsAutoDestroy
public synchronized void addItem(ItemInstance item)
{
- item.setDropTime(System.currentTimeMillis());
+ item.setDropTime(Chronos.currentTimeMillis());
_items.add(item);
}
@@ -53,7 +54,7 @@ public class ItemsAutoDestroy
return;
}
- final long curtime = System.currentTimeMillis();
+ final long curtime = Chronos.currentTimeMillis();
final Iterator itemIterator = _items.iterator();
while (itemIterator.hasNext())
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/Shutdown.java
index 5279bac36d..d7328247aa 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/Shutdown.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseBackup;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
@@ -529,19 +530,19 @@ public class Shutdown extends Thread
protected void restartCounter()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
}
protected long getEstimatedTimeAndRestartCounter()
{
- final long toReturn = System.currentTimeMillis() - _startTime;
+ final long toReturn = Chronos.currentTimeMillis() - _startTime;
restartCounter();
return toReturn;
}
protected long getEstimatedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/CreatureAI.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/CreatureAI.java
index 22de59f51a..e03e0463be 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/CreatureAI.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/CreatureAI.java
@@ -33,6 +33,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -308,7 +309,7 @@ public class CreatureAI extends AbstractAI
if (_actor.isAttackingNow())
{
- ThreadPool.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(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index fa5cca3384..26734231aa 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -39,7 +40,7 @@ public class WarehouseCacheManager
public void addCacheTask(PlayerInstance pc)
{
- CACHED_WH.put(pc, System.currentTimeMillis());
+ CACHED_WH.put(pc, Chronos.currentTimeMillis());
}
public void remCacheTask(PlayerInstance pc)
@@ -56,7 +57,7 @@ public class WarehouseCacheManager
@Override
public void run()
{
- final long cTime = System.currentTimeMillis();
+ final long cTime = Chronos.currentTimeMillis();
for (Entry entry : CACHED_WH.entrySet())
{
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/BotReportTable.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/BotReportTable.java
index 2dd2c9abf7..6c7daf4120 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/BotReportTable.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/BotReportTable.java
@@ -39,6 +39,7 @@ import org.xml.sax.helpers.DefaultHandler;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -124,7 +125,7 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() < c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() < c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
}
@@ -290,7 +291,7 @@ public class BotReportTable
return false;
}
- final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
+ final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
@@ -301,7 +302,7 @@ public class BotReportTable
}
}
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
if (rcd == null)
{
rcd = new ReportedCharData();
@@ -418,12 +419,12 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() > c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() > c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
}
- ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
+ ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - Chronos.currentTimeMillis());
}
catch (Exception e)
{
@@ -464,7 +465,7 @@ public class BotReportTable
{
if (map.containsKey(objectId))
{
- return (System.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
+ return (Chronos.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
}
return true;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/sql/ClanTable.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
index b3cb0d7e2d..3ebc968ea1 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.enums.ClanWarState;
@@ -170,7 +171,7 @@ public class ClanTable
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
return null;
}
- if (System.currentTimeMillis() < player.getClanCreateExpiryTime())
+ if (Chronos.currentTimeMillis() < player.getClanCreateExpiryTime())
{
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
return null;
@@ -342,7 +343,7 @@ public class ClanTable
{
destroyClan(clanId);
}
- }, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
+ }, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
}
public boolean isAllyExists(String allyName)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index a0110c454b..3d8844ae9f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem;
@@ -183,7 +184,7 @@ public class OfflineTraderTable
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- if (cal.getTimeInMillis() <= System.currentTimeMillis())
+ if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
{
continue;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
index 025c3208e6..ecb5b8dc95 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.enums.PlayerAction;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -115,7 +116,7 @@ public class AdminCommandHandler implements IHandler
{
- final long begin = System.currentTimeMillis();
+ final long begin = Chronos.currentTimeMillis();
try
{
if (Config.GMAUDIT)
@@ -133,7 +134,7 @@ public class AdminCommandHandler implements IHandler 5000)
{
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
index fedf7cd9dc..ee7642eca5 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -48,7 +49,7 @@ public class AntiFeedManager
*/
public void setLastDeathTime(int objectId)
{
- _lastDeathTimes.put(objectId, System.currentTimeMillis());
+ _lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
}
/**
@@ -81,7 +82,7 @@ public class AntiFeedManager
return false;
}
- if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
+ if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((Chronos.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
{
return false;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index 3d8c1f50e4..301806d976 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ManorMode;
@@ -276,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
- ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
+ ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
}
public void changeMode()
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
index 4a91b5c214..64143c7c65 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.model.CursedWeapon;
import org.l2jmobius.gameserver.model.actor.Attackable;
@@ -313,7 +314,7 @@ public class CursedWeaponsManager implements IXmlReader
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING);
sm.addString(cw.getName());
// sm.addItemName(cw.getItemId());
- sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
+ sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
player.sendPacket(sm);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index 72602e0968..babf2e1476 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -193,7 +194,7 @@ public class DBSpawnManager
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
- final long respawnTime = System.currentTimeMillis() + respawnDelay;
+ final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
info.set("currentHP", npc.getMaxHp());
info.set("currentMP", npc.getMaxMp());
info.set("respawnTime", respawnTime);
@@ -235,7 +236,7 @@ public class DBSpawnManager
}
final int npcId = spawn.getId();
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SpawnTable.getInstance().addNewSpawn(spawn, false);
if ((respawnTime == 0) || (time > respawnTime))
{
@@ -257,7 +258,7 @@ public class DBSpawnManager
}
else
{
- final long spawnTime = respawnTime - System.currentTimeMillis();
+ final long spawnTime = respawnTime - Chronos.currentTimeMillis();
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index 60a818cab6..06cce0d3a3 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -21,6 +21,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -104,7 +105,7 @@ public class GraciaSeedsManager
case 2:
{
// Conquest Complete state, if too much time is passed than change to defense state
- final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
+ final long timePast = Chronos.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
if (timePast >= Config.SOD_STAGE_2_LENGTH)
{
// change to Attack state because Defend statet is not implemented
@@ -172,7 +173,7 @@ public class GraciaSeedsManager
public void setSoDState(int value, boolean doSave)
{
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
- _SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
+ _SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
_SoDState = value;
// reset number of Tiat kills
if (_SoDState == 1)
@@ -198,7 +199,7 @@ public class GraciaSeedsManager
}
case 2:
{
- return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
+ return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
}
case 3:
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index d595a5befa..052f8984d2 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.util.PrimeFinder;
/**
@@ -85,7 +86,7 @@ public class IdManager
try (Connection con = DatabaseFactory.getConnection();
Statement statement = con.createStatement())
{
- final long cleanupStart = System.currentTimeMillis();
+ final long cleanupStart = Chronos.currentTimeMillis();
int cleanCount = 0;
// Characters
@@ -157,7 +158,7 @@ public class IdManager
statement.executeUpdate("UPDATE characters SET clanid=0, clan_privs=0, wantspeace=0, subpledge=0, lvl_joined_academy=0, apprentice=0, sponsor=0, clan_join_expiry_time=0, clan_create_expiry_time=0 WHERE characters.clanid > 0 AND characters.clanid NOT IN (SELECT clan_id FROM clan_data);");
statement.executeUpdate("UPDATE fort SET owner=0 WHERE owner NOT IN (SELECT clan_id FROM clan_data);");
- LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((System.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
+ LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((Chronos.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
}
catch (Exception e)
{
@@ -173,7 +174,7 @@ public class IdManager
{
try (PreparedStatement statement = con.prepareStatement(line))
{
- statement.setLong(1, System.currentTimeMillis());
+ statement.setLong(1, Chronos.currentTimeMillis());
cleanCount += statement.executeUpdate();
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
index d47e436ace..d1f8cd35e2 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
@@ -40,6 +40,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.data.xml.SpawnData;
@@ -521,7 +522,7 @@ public class InstanceManager implements IXmlReader
{
// Check if instance penalty passed
final long time = rs.getLong("time");
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
// Load params
final int charId = rs.getInt("charId");
@@ -556,7 +557,7 @@ public class InstanceManager implements IXmlReader
final List invalidPenalty = new ArrayList<>(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- if (entry.getValue() <= System.currentTimeMillis())
+ if (entry.getValue() <= Chronos.currentTimeMillis())
{
invalidPenalty.add(entry.getKey());
}
@@ -615,7 +616,7 @@ public class InstanceManager implements IXmlReader
// If reenter time is higher then current, delete it
final long time = playerData.get(id);
- if (time <= System.currentTimeMillis())
+ if (time <= Chronos.currentTimeMillis())
{
deleteInstanceTime(player, id);
return -1;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 739f67e9a9..dfb4734ca5 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -83,7 +84,7 @@ public class ItemsOnGroundManager implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(str))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.execute();
}
catch (Exception e)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
index df45860d40..d429a2f8c9 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Mentee;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -145,7 +146,7 @@ public class MentorManager
{
final PlayerInstance player = World.getInstance().getPlayer(mentorId);
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
- vars.set("Mentor-Penalty-" + mentorId, String.valueOf(System.currentTimeMillis() + penalty));
+ vars.set("Mentor-Penalty-" + mentorId, String.valueOf(Chronos.currentTimeMillis() + penalty));
}
public long getMentorPenalty(int mentorId)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 7768cebd95..ba4e95fe3f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.Containers;
@@ -79,7 +80,7 @@ public class PremiumManager
final PlayerInstance player = event.getPlayer();
final String accountName = player.getAccountName();
loadPremiumData(accountName);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
final long premiumExpiration = getPremiumExpiration(accountName);
player.setPremiumStatus(premiumExpiration > now);
if (player.hasPremiumStatus())
@@ -153,7 +154,7 @@ public class PremiumManager
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
{
final long addTime = timeUnit.toMillis(timeValue);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
// new premium task at least from now
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
final long newPremiumExpiration = oldPremiumExpiration + addTime;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
index 9617f26e43..08193f9c5b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
@@ -71,7 +72,7 @@ public class PunishmentManager
final String punishedBy = rset.getString("punishedBy");
if ((type != null) && (affect != null))
{
- if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
+ if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
{
expired++;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
index 687d1288b9..ab73056bb1 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -424,7 +425,7 @@ public class BlockChecker
// Start up player parameters
setUpPlayers();
// Set the started time
- _startedTime = System.currentTimeMillis() + 300000;
+ _startedTime = Chronos.currentTimeMillis() + 300000;
}
}
@@ -524,7 +525,7 @@ public class BlockChecker
_redPoints += _numOfBoxes / 2;
_bluePoints += _numOfBoxes / 2;
- final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((_startedTime - Chronos.currentTimeMillis()) / 1000);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
_holder.broadCastPacketToTeam(changePoints);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/CursedWeapon.java
index 07e4d9b6d6..cf80e1b21a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/CursedWeapon.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
@@ -237,7 +238,7 @@ public class CursedWeapon implements INamable
@Override
public void run()
{
- if (System.currentTimeMillis() >= _endTime)
+ if (Chronos.currentTimeMillis() >= _endTime)
{
endOfLife();
}
@@ -366,7 +367,7 @@ public class CursedWeapon implements INamable
public void reActivate()
{
_isActivated = true;
- if ((_endTime - System.currentTimeMillis()) <= 0)
+ if ((_endTime - Chronos.currentTimeMillis()) <= 0)
{
endOfLife();
}
@@ -384,7 +385,7 @@ public class CursedWeapon implements INamable
dropIt(attackable, player);
// Start the Life Task
- _endTime = System.currentTimeMillis() + (_duration * 60000);
+ _endTime = Chronos.currentTimeMillis() + (_duration * 60000);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
return true;
}
@@ -678,7 +679,7 @@ public class CursedWeapon implements INamable
public long getTimeLeft()
{
- return _endTime - System.currentTimeMillis();
+ return _endTime - Chronos.currentTimeMillis();
}
public void goTo(PlayerInstance player)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/ItemInfo.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/ItemInfo.java
index 1456161b76..5a9e9f4b4a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/ItemInfo.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/ItemInfo.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model;
import java.util.Objects;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.model.buylist.Product;
import org.l2jmobius.gameserver.model.items.Item;
@@ -144,14 +145,14 @@ public class ItemInfo
}
_option = item.getEnchantOptions();
_visualId = item.getVisualId();
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(ItemInstance item, int change)
{
this(item);
_change = change;
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(TradeItem item)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Message.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Message.java
index e6b1c31d32..53d2f20768 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Message.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Message.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.enums.MailType;
@@ -104,7 +105,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = text;
- _expiration = (isCod ? System.currentTimeMillis() + (COD_EXPIRATION * 3600000) : System.currentTimeMillis() + (EXPIRATION * 3600000));
+ _expiration = (isCod ? Chronos.currentTimeMillis() + (COD_EXPIRATION * 3600000) : Chronos.currentTimeMillis() + (EXPIRATION * 3600000));
_hasAttachments = false;
_unread = true;
_deletedBySender = false;
@@ -123,7 +124,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_reqAdena = 0;
_hasAttachments = false;
_unread = true;
@@ -143,7 +144,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_hasAttachments = false;
_unread = true;
_deletedBySender = true;
@@ -162,7 +163,7 @@ public class Message
_receiverId = msg.getSenderId();
_subject = "";
_content = "";
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_deletedByReceiver = false;
@@ -182,7 +183,7 @@ public class Message
_receiverId = receiverId;
_subject = "";
_content = item.getName();
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_messageType = mailType;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Petition.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Petition.java
index b19b6f9025..d3f95461ac 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Petition.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Petition.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PetitionState;
import org.l2jmobius.gameserver.enums.PetitionType;
import org.l2jmobius.gameserver.instancemanager.IdManager;
@@ -36,7 +37,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class Petition
{
- private final long _submitTime = System.currentTimeMillis();
+ private final long _submitTime = Chronos.currentTimeMillis();
private final int _id;
private final PetitionType _type;
private PetitionState _state = PetitionState.PENDING;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Spawn.java
index 4a1a2926b3..eb57e4e69b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -258,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
_scheduledCount++;
// Schedule the next respawn.
- RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
+ RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/TimeStamp.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/TimeStamp.java
index 8c232969e0..9bdb39d293 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/TimeStamp.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/TimeStamp.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -52,7 +53,7 @@ public class TimeStamp
_id2 = skill.getLevel();
_id3 = skill.getSubLevel();
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = -1;
}
@@ -68,7 +69,7 @@ public class TimeStamp
_id2 = item.getObjectId();
_id3 = 0;
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = item.getSharedReuseGroup();
}
@@ -155,7 +156,7 @@ public class TimeStamp
{
return 0;
}
- final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
+ final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
if (remainingTime == 0)
{
_stamp = 0;
@@ -173,7 +174,7 @@ public class TimeStamp
{
return false;
}
- final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
+ final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
if (!hasNotPassed)
{
_stamp = 0;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java
index 8c72a24145..b668a436c0 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.AttackableAI;
import org.l2jmobius.gameserver.ai.CreatureAI;
@@ -220,7 +221,7 @@ public class Attackable extends Npc
if (_firstCommandChannelAttacked != null)
{
_commandChannelTimer = new CommandChannelTimer(this);
- _commandChannelLastAttack = System.currentTimeMillis();
+ _commandChannelLastAttack = Chronos.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
@@ -229,7 +230,7 @@ public class Attackable extends Npc
}
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
{
- _commandChannelLastAttack = System.currentTimeMillis(); // update last attack time
+ _commandChannelLastAttack = Chronos.currentTimeMillis(); // update last attack time
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java
index ac5089ff54..20863bbf93 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -41,6 +41,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.EmptyQueue;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -1393,7 +1394,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : _reuseTimeStampsItems.values())
{
if (ts.getSharedReuseGroup() == group)
@@ -1523,7 +1524,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return;
}
- _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? System.currentTimeMillis() + delay : Long.MAX_VALUE);
+ _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? Chronos.currentTimeMillis() + delay : Long.MAX_VALUE);
}
/**
@@ -1571,7 +1572,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return false;
}
- if (stamp < System.currentTimeMillis())
+ if (stamp < Chronos.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java
index 510c9b6cbc..109e51ca03 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -203,7 +204,7 @@ public class Npc extends Creature
public void onRandomAnimation(int animationId)
{
// Send a packet SocialAction to all PlayerInstance in the _KnownPlayers of the NpcInstance
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
{
_lastSocialBroadcast = now;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
index 7eacda4aa1..c87a2006a9 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.actor.instance;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
@@ -141,7 +142,7 @@ public class BlockInstance extends MonsterInstance
{
eng.increasePlayerPoints(player, team);
- final int timeLeft = (int) ((eng.getStarterTime() - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((eng.getStarterTime() - Chronos.currentTimeMillis()) / 1000);
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints());
final ExCubeGameExtendedChangePoints secretPoints = new ExCubeGameExtendedChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints(), isRed, player, eng.getPlayerPoints(player, isRed));
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index bfb54b8225..ba7a250379 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -46,6 +46,7 @@ import java.util.stream.Collectors;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -2832,7 +2833,7 @@ public class PlayerInstance extends Playable
public void setOnlineTime(long time)
{
_onlineTime = time;
- _onlineBeginTime = System.currentTimeMillis();
+ _onlineBeginTime = Chronos.currentTimeMillis();
}
/**
@@ -3891,22 +3892,22 @@ public class PlayerInstance extends Playable
public boolean isSpawnProtected()
{
- return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
+ return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
}
public boolean isTeleportProtected()
{
- return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
+ return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
}
public void setSpawnProtection(boolean protect)
{
- _spawnProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
+ _spawnProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
}
public void setTeleportProtection(boolean protect)
{
- _teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
+ _teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
}
/**
@@ -5231,7 +5232,7 @@ public class PlayerInstance extends Playable
{
return;
}
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
if (_pvpFlag == 0)
{
startPvPFlag();
@@ -5264,11 +5265,11 @@ public class PlayerInstance extends Playable
{
if (checkIfPvP(targetPlayer))
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
}
else
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
}
if (_pvpFlag == 0)
{
@@ -6146,7 +6147,7 @@ public class PlayerInstance extends Playable
public long getUptime()
{
- return System.currentTimeMillis() - _uptime;
+ return Chronos.currentTimeMillis() - _uptime;
}
/**
@@ -6390,7 +6391,7 @@ public class PlayerInstance extends Playable
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
{
statement.setInt(1, isOnlineInt());
- statement.setLong(2, System.currentTimeMillis());
+ statement.setLong(2, Chronos.currentTimeMillis());
statement.setInt(3, getObjectId());
statement.execute();
}
@@ -6515,12 +6516,12 @@ public class PlayerInstance extends Playable
}
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
- if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanJoinExpiryTime(0);
}
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
- if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanCreateExpiryTime(0);
}
@@ -6582,7 +6583,7 @@ public class PlayerInstance extends Playable
player.getAppearance().setTitleColor(titleColor);
}
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
- player.setUptime(System.currentTimeMillis());
+ player.setUptime(Chronos.currentTimeMillis());
currentHp = rset.getDouble("curHp");
currentCp = rset.getDouble("curCp");
@@ -7099,7 +7100,7 @@ public class PlayerInstance extends Playable
long totalOnlineTime = _onlineTime;
if (_onlineBeginTime > 0)
{
- totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
+ totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
}
statement.setLong(34, totalOnlineTime);
@@ -7185,7 +7186,7 @@ public class PlayerInstance extends Playable
int buffIndex = 0;
final List storedSkills = new ArrayList<>();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
// Store all effect data along with calulated remaining
// reuse delays for matching skills. 'restore_type'= 0.
@@ -7300,7 +7301,7 @@ public class PlayerInstance extends Playable
ps1.setInt(1, getObjectId());
ps1.execute();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : getItemReuseTimeStamps().values())
{
if ((ts != null) && (currentTime < ts.getStamp()))
@@ -7623,7 +7624,7 @@ public class PlayerInstance extends Playable
statement.setInt(2, _classIndex);
try (ResultSet rset = statement.executeQuery())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
final int remainingTime = rset.getInt("remaining_time");
@@ -7685,7 +7686,7 @@ public class PlayerInstance extends Playable
long systime;
boolean isInInventory;
long remainingTime;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
itemId = rset.getInt("itemId");
@@ -7760,7 +7761,7 @@ public class PlayerInstance extends Playable
{
int slot;
int symbolId;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
slot = rset.getInt("slot");
@@ -7883,7 +7884,7 @@ public class PlayerInstance extends Playable
// Send Server->Client UserInfo packet to this PlayerInstance
broadcastUserInfo(UserInfoType.BASE_STATS, UserInfoType.MAX_HPCPMP, UserInfoType.STATS, UserInfoType.SPEED);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long timeLeft = getVariables().getLong("HennaDuration" + slot, currentTime) - currentTime;
if ((henna.getDuration() < 0) || (timeLeft > 0))
{
@@ -7974,7 +7975,7 @@ public class PlayerInstance extends Playable
// Task for henna duration
if (henna.getDuration() > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
@@ -12436,7 +12437,7 @@ public class PlayerInstance extends Playable
public int getBirthdays()
{
- long time = (System.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
+ long time = (Chronos.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
time /= TimeUnit.DAYS.toMillis(365);
return (int) time;
}
@@ -12677,7 +12678,7 @@ public class PlayerInstance extends Playable
return false;
}
- if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
+ if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@@ -12737,7 +12738,7 @@ public class PlayerInstance extends Playable
*/
public void setFalling()
{
- _fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
+ _fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
}
/**
@@ -12758,7 +12759,7 @@ public class PlayerInstance extends Playable
*/
public void updateLastItemAuctionRequest()
{
- _lastItemAuctionInfoRequest = System.currentTimeMillis();
+ _lastItemAuctionInfoRequest = Chronos.currentTimeMillis();
}
/**
@@ -12767,7 +12768,7 @@ public class PlayerInstance extends Playable
*/
public boolean isItemAuctionPolling()
{
- return (System.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
+ return (Chronos.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
}
@Override
@@ -13150,7 +13151,7 @@ public class PlayerInstance extends Playable
public void updateNotMoveUntil()
{
- _notMoveUntil = System.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
+ _notMoveUntil = Chronos.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
}
@Override
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
index 7d586645f8..a667254408 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
@@ -22,6 +22,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.AcquireSkillType;
@@ -35,9 +36,9 @@ import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.Clan.SubPledge;
+import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.siege.Castle;
import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -338,13 +339,13 @@ public class VillageMasterInstance extends NpcInstance
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
return;
}
- clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setDissolvingExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
// The clan leader should take the XP penalty of a full death.
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 843165d245..18d77105c7 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.attackable;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
/**
@@ -40,7 +41,7 @@ public class CommandChannelTimer implements Runnable
return;
}
- if ((System.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
+ if ((Chronos.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
{
_attackable.setCommandChannelTimer(null);
_attackable.setFirstCommandChannelAttacked(null);
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
index e2130407ac..290e49a99f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.player;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -92,12 +93,12 @@ public class IllegalPlayerActionTask implements Runnable
}
case KICKBAN:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
case JAIL:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/buylist/Product.java
index 0782846eba..3fc18a73e3 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/buylist/Product.java
@@ -25,6 +25,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.type.EtcItemType;
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
@@ -134,7 +135,7 @@ public class Product
public void restartRestockTask(long nextRestockTime)
{
- final long remainTime = nextRestockTime - System.currentTimeMillis();
+ final long remainTime = nextRestockTime - Chronos.currentTimeMillis();
if (remainTime > 0)
{
BuyListTaskManager.getInstance().update(this, remainTime);
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
index 13040871bb..152426427e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
@@ -27,6 +27,7 @@ import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
import org.l2jmobius.gameserver.instancemanager.CeremonyOfChaosManager;
@@ -274,7 +275,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
});
}
}
- _battleStartTime = System.currentTimeMillis();
+ _battleStartTime = Chronos.currentTimeMillis();
getTimers().addRepeatingTimer("update", 1000, null, null);
}
@@ -471,7 +472,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
private void updateLifeTime(CeremonyOfChaosMember member)
{
- member.setLifeTime(((int) (System.currentTimeMillis() - _battleStartTime) / 1000));
+ member.setLifeTime(((int) (Chronos.currentTimeMillis() - _battleStartTime) / 1000));
}
public List getWinners()
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/clan/Clan.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/clan/Clan.java
index 619fc44a79..e9da636180 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/clan/Clan.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/clan/Clan.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -497,7 +498,7 @@ public class Clan implements IIdentifiable, INamable
if (player.isClanLeader())
{
SiegeManager.getInstance().removeSiegeSkills(player);
- player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ player.setClanCreateExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
}
// remove Clan skills from Player
@@ -530,7 +531,7 @@ public class Clan implements IIdentifiable, INamable
}
else
{
- removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
+ removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
}
// Notify to scripts
@@ -1090,12 +1091,12 @@ public class Clan implements IIdentifiable, INamable
setAllyId(clanData.getInt("ally_id"));
setAllyName(clanData.getString("ally_name"));
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
- if (_allyPenaltyExpiryTime < System.currentTimeMillis())
+ if (_allyPenaltyExpiryTime < Chronos.currentTimeMillis())
{
setAllyPenaltyExpiryTime(0, 0);
}
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
- if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
+ if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < Chronos.currentTimeMillis()) // 24*60*60*1000 = 86400000
{
setCharPenaltyExpiryTime(0);
}
@@ -2206,7 +2207,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
return false;
}
- if (_charPenaltyExpiryTime > System.currentTimeMillis())
+ if (_charPenaltyExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return false;
@@ -2218,7 +2219,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (target.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (target.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(target.getName());
@@ -2267,7 +2268,7 @@ public class Clan implements IIdentifiable, INamable
return false;
}
final Clan leaderClan = player.getClan();
- if (leaderClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (leaderClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN)
{
@@ -2306,7 +2307,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
{
@@ -2400,12 +2401,12 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
return;
}
- if ((_allyPenaltyExpiryTime > System.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
+ if ((_allyPenaltyExpiryTime > Chronos.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
return;
}
- if (_dissolvingExpiryTime > System.currentTimeMillis())
+ if (_dissolvingExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
return;
@@ -2457,7 +2458,7 @@ public class Clan implements IIdentifiable, INamable
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
{
if (clan.getId() != getId())
@@ -2483,7 +2484,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
return false;
}
- if (System.currentTimeMillis() < _dissolvingExpiryTime)
+ if (Chronos.currentTimeMillis() < _dissolvingExpiryTime)
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
return false;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/clan/ClanWar.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
index 22b82ab179..ebb01d6c06 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -54,9 +55,9 @@ public class ClanWar
{
_attackerClanId = attacker.getId();
_attackedClanId = attacked.getId();
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_state = ClanWarState.BLOOD_DECLARATION;
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
attacker.addWar(attacked.getId(), this);
attacked.addWar(attacker.getId(), this);
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
@@ -79,15 +80,15 @@ public class ClanWar
_attackerKillCount.set(attackerKillCount);
_attackedKillCount.set(attackedKillCount);
_winnerClanId = winnerClan;
- if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > System.currentTimeMillis())
+ if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > Chronos.currentTimeMillis())
{
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
}
if (_endTime > 0)
{
final long endTimePeriod = _endTime + (_state == ClanWarState.TIE ? TIME_TO_DELETION_AFTER_CANCELLATION : TIME_TO_DELETION_AFTER_DEFEAT);
- if (endTimePeriod > System.currentTimeMillis())
+ if (endTimePeriod > Chronos.currentTimeMillis())
{
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(_attackerClanId, _attackedClanId), 10000);
}
@@ -177,8 +178,8 @@ public class ClanWar
winnerClan.broadcastToOnlineMembers(sm);
_winnerClanId = winnerClan.getId();
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - Chronos.currentTimeMillis());
}
public void clanWarTimeout()
@@ -196,8 +197,8 @@ public class ClanWar
attackerClan.broadcastToOnlineMembers(sm);
_state = ClanWarState.TIE;
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - Chronos.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index f150ec3238..b1b3a83fd1 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.StatSet;
import it.sauronsoftware.cron4j.PastPredictor;
@@ -112,7 +113,7 @@ public class EventScheduler
final Predictor predictor = new Predictor(_pattern);
final long nextSchedule = predictor.nextMatchingTime();
- final long timeSchedule = nextSchedule - System.currentTimeMillis();
+ final long timeSchedule = nextSchedule - Chronos.currentTimeMillis();
if (timeSchedule <= (30 * 1000))
{
LOGGER.warning("Wrong reschedule for " + _eventManager.getClass().getSimpleName() + " end up run in " + (timeSchedule / 1000) + " seconds!");
@@ -144,10 +145,10 @@ public class EventScheduler
{
ps.setString(1, _eventManager.getName());
ps.setString(2, _name);
- ps.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(3, new Timestamp(Chronos.currentTimeMillis()));
ps.setString(4, _eventManager.getName());
ps.setString(5, _name);
- ps.setTimestamp(6, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(6, new Timestamp(Chronos.currentTimeMillis()));
ps.execute();
return true;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/events/EventType.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/events/EventType.java
index aa64ab0744..eebca64a89 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/events/EventType.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/events/EventType.java
@@ -76,7 +76,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
@@ -84,8 +83,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaR
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemAdd;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDestroy;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDrop;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemTransfer;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
@@ -114,7 +115,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
index 77e7205bfa..6139454534 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -85,7 +86,7 @@ public class TrainingHolder implements Serializable
public long getElapsedTime()
{
- return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
+ return TimeUnit.SECONDS.convert(Chronos.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
index 6c9ca907b7..62649739ea 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -39,6 +39,7 @@ import java.util.stream.Stream;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -105,7 +106,7 @@ public class Instance implements IIdentifiable, INamable
// Set basic instance info
_id = id;
_template = template;
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_spawns = new ArrayList<>(template.getSpawns().size());
// Clone and add the spawn templates
@@ -755,7 +756,7 @@ public class Instance implements IIdentifiable, INamable
}
// Set new cleanup task
- _endTime = System.currentTimeMillis() + millis;
+ _endTime = Chronos.currentTimeMillis() + millis;
if (minutes < 1) // Destroy instance
{
destroy();
@@ -858,7 +859,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getElapsedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
/**
@@ -867,7 +868,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getRemainingTime()
{
- return (_endTime == -1) ? -1 : (_endTime - System.currentTimeMillis());
+ return (_endTime == -1) ? -1 : (_endTime - Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
index 973dab1661..84466d8e0a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.GroupType;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -547,7 +548,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
{
if (data.getTime() > 0)
{
- time = System.currentTimeMillis() + data.getTime();
+ time = Chronos.currentTimeMillis() + data.getTime();
break;
}
@@ -557,7 +558,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
calendar.set(Calendar.SECOND, 0);
// If calendar time is lower than current, add one more day
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
@@ -574,7 +575,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Set exact day. If modified date is before current, add one more week.
calendar.set(Calendar.DAY_OF_WEEK, day);
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.WEEK_OF_MONTH, 1);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
index 1850d30783..07ce5a3538 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.instancezone.conditions;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -39,6 +40,6 @@ public class ConditionReenter extends Condition
protected boolean test(PlayerInstance player, Npc npc)
{
final int instanceId = getParameters().getInt("instanceId", getInstanceTemplate().getId());
- return System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
+ return Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index dc7bc9fba9..f852953226 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.ItemInfo;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -181,12 +182,12 @@ public class ItemAuction
public long getStartingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public long getFinishingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public void storeMe()
@@ -339,7 +340,7 @@ public class ItemAuction
_highestBid = bid;
}
- if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
+ if ((_endingTime - Chronos.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
{
switch (_auctionEndingExtendState)
{
@@ -426,7 +427,7 @@ public class ItemAuction
}
case FINISHED:
{
- if (_startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
+ if (_startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
{
return false;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 8d81451dc9..f14581064a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -243,7 +244,7 @@ public class ItemAuctionInstance
{
case 0:
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
case 1:
@@ -252,10 +253,10 @@ public class ItemAuctionInstance
{
case CREATED:
{
- if (auctions[0].getStartingTime() < (System.currentTimeMillis() + START_TIME_SPACE))
+ if (auctions[0].getStartingTime() < (Chronos.currentTimeMillis() + START_TIME_SPACE))
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
else
{
@@ -266,13 +267,13 @@ public class ItemAuctionInstance
case STARTED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, System.currentTimeMillis() + START_TIME_SPACE));
+ nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, Chronos.currentTimeMillis() + START_TIME_SPACE));
break;
}
case FINISHED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
default:
@@ -287,7 +288,7 @@ public class ItemAuctionInstance
{
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
// just to make sure we won't skip any auction because of little different times
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (ItemAuction auction : auctions)
{
if (auction.getAuctionState() == ItemAuctionState.STARTED)
@@ -311,7 +312,7 @@ public class ItemAuctionInstance
}
if (nextAuction == null)
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
break;
}
@@ -326,17 +327,17 @@ public class ItemAuctionInstance
{
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
}
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
}
}
@@ -422,7 +423,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -432,7 +433,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -442,7 +443,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -452,7 +453,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
}
@@ -577,7 +578,7 @@ public class ItemAuctionInstance
return null;
}
- if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
+ if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
{
LOGGER.info(getClass().getSimpleName() + ": Clearing expired auction: " + auctionId);
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
index 0ac50821f6..d6958b7a37 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData;
@@ -194,7 +195,7 @@ public class ItemInstance extends WorldObject
_type2 = 0;
_dropTime = 0;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -217,7 +218,7 @@ public class ItemInstance extends WorldObject
super.setName(_item.getName());
_loc = ItemLocation.VOID;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -1516,7 +1517,7 @@ public class ItemInstance extends WorldObject
setSpawned(true);
setXYZ(x, y, z);
- setDropTime(System.currentTimeMillis());
+ setDropTime(Chronos.currentTimeMillis());
setDropperObjectId(dropper != null ? dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
// Add the ItemInstance dropped in the world as a visible object
@@ -1789,7 +1790,7 @@ public class ItemInstance extends WorldObject
public long getRemainingTime()
{
- return _time - System.currentTimeMillis();
+ return _time - Chronos.currentTimeMillis();
}
public void endOfLife()
@@ -2164,7 +2165,7 @@ public class ItemInstance extends WorldObject
if (getVisualLifeTime() > 0)
{
final long endTime = getVisualLifeTime();
- if ((endTime - System.currentTimeMillis()) > 0)
+ if ((endTime - Chronos.currentTimeMillis()) > 0)
{
ItemAppearanceTaskManager.getInstance().add(this, endTime);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index 1a62d6495f..8aad3cfbb6 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -21,6 +21,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
@@ -81,7 +82,7 @@ public abstract class AbstractOlympiadGame
protected boolean makeCompetitionStart()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
return !_aborted;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 10af0d183d..a0334635fe 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
@@ -765,7 +766,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", template.getName() + " was defeated");
@@ -786,7 +787,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", castle.getName() + " Castle was successfuly taken");
@@ -800,7 +801,7 @@ public class Hero
PreparedStatement ps = con.prepareStatement("INSERT INTO heroes_diary (charId, time, action, param) values(?,?,?,?)"))
{
ps.setInt(1, charId);
- ps.setLong(2, System.currentTimeMillis());
+ ps.setLong(2, Chronos.currentTimeMillis());
ps.setInt(3, action);
ps.setInt(4, param);
ps.execute();
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index 215121ef64..4a3d3e49e8 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,6 +27,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
@@ -546,7 +547,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
String winner = "draw";
// Calculate Fight time
- final long _fightTime = (System.currentTimeMillis() - _startTime);
+ final long _fightTime = (Chronos.currentTimeMillis() - _startTime);
double playerOneHp = 0;
if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index 119e447b15..4bb2fc156e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.handler.PunishmentHandler;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
@@ -133,7 +134,7 @@ public class PunishmentTask implements Runnable
*/
public boolean isExpired()
{
- return (_expirationTime > 0) && (System.currentTimeMillis() > _expirationTime);
+ return (_expirationTime > 0) && (Chronos.currentTimeMillis() > _expirationTime);
}
/**
@@ -149,7 +150,7 @@ public class PunishmentTask implements Runnable
onStart();
if (_expirationTime > 0) // Has expiration?
{
- _task = ThreadPool.schedule(this, (_expirationTime - System.currentTimeMillis()));
+ _task = ThreadPool.schedule(this, (_expirationTime - Chronos.currentTimeMillis()));
}
}
@@ -226,7 +227,7 @@ public class PunishmentTask implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement st = con.prepareStatement(UPDATE_QUERY))
{
- st.setLong(1, System.currentTimeMillis());
+ st.setLong(1, Chronos.currentTimeMillis());
st.setLong(2, _id);
st.execute();
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 7c2d57fdc6..2e36bece7c 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -32,6 +32,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.EventDroplist;
import org.l2jmobius.gameserver.data.ItemTable;
@@ -100,7 +101,7 @@ public class LongTimeEvent extends Quest
}
else if (_eventPeriod.getStartDate().after(new Date()))
{
- final long delay = _eventPeriod.getStartDate().getTime() - System.currentTimeMillis();
+ final long delay = _eventPeriod.getStartDate().getTime() - Chronos.currentTimeMillis();
ThreadPool.schedule(new ScheduleStart(), delay);
LOGGER.info("Event " + _eventName + " will be started at " + _eventPeriod.getStartDate());
}
@@ -323,7 +324,7 @@ public class LongTimeEvent extends Quest
}
// Add spawns.
- final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - System.currentTimeMillis();
+ final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - Chronos.currentTimeMillis();
for (NpcSpawn spawn : _spawnList)
{
addSpawn(spawn.npcId, spawn.loc.getX(), spawn.loc.getY(), spawn.loc.getZ(), spawn.loc.getHeading(), false, millisToEventEnd, false);
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 1218569d81..4264d72834 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.enums.QuestType;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
@@ -785,7 +786,7 @@ public class QuestState
public boolean isNowAvailable()
{
final String val = get("restartTime");
- return (val != null) && (Long.parseLong(val) <= System.currentTimeMillis());
+ return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
public void setSimulated(boolean simulated)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
index cf665da8f8..b4d0d36648 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.SocialClass;
@@ -138,7 +139,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
final int level = rs.getInt("level");
final long expiration = rs.getLong("expiration");
final ResidenceFunction func = new ResidenceFunction(id, level, expiration, this);
- if ((expiration <= System.currentTimeMillis()) && !func.reactivate())
+ if ((expiration <= Chronos.currentTimeMillis()) && !func.reactivate())
{
removeFunction(func);
continue;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
index a292c439e5..d81d7f08af 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanHallGrade;
import org.l2jmobius.gameserver.enums.ClanHallType;
@@ -265,7 +266,7 @@ public class ClanHall extends AbstractResidence
final int failDays = getCostFailDay();
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : _paidUntil;
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - Chronos.currentTimeMillis());
}
else
{
@@ -310,7 +311,7 @@ public class ClanHall extends AbstractResidence
*/
public long getNextPayment()
{
- return (_checkPaymentTask != null) ? System.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
+ return (_checkPaymentTask != null) ? Chronos.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
}
public Location getOwnerLocation()
@@ -382,7 +383,7 @@ public class ClanHall extends AbstractResidence
{
_owner.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, _lease, null, null);
setPaidUntil(Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(7)).toEpochMilli());
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - Chronos.currentTimeMillis());
updateDB();
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
index 2fa683814d..faac3921be 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
@@ -30,6 +30,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
@@ -85,7 +86,7 @@ public class ClanHallAuction
public void addBid(Clan clan, long bid)
{
- addBid(clan, bid, System.currentTimeMillis());
+ addBid(clan, bid, Chronos.currentTimeMillis());
}
public void addBid(Clan clan, long bid, long bidTime)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index c71380874f..841d3b180c 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -20,6 +20,7 @@ import java.time.Instant;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ResidenceFunctionsData;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -63,9 +64,9 @@ public class ResidenceFunction
private void init()
{
final ResidenceFunctionTemplate template = getTemplate();
- if ((template != null) && (_expiration > System.currentTimeMillis()))
+ if ((template != null) && (_expiration > Chronos.currentTimeMillis()))
{
- _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
+ _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - Chronos.currentTimeMillis());
}
}
@@ -170,7 +171,7 @@ public class ResidenceFunction
if (wh.destroyItem("FunctionFee", item, template.getCost().getCount(), null, this) != null)
{
- _expiration = System.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
+ _expiration = Chronos.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
init();
}
return true;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
index 3a425c9b03..af7fd2e85e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.shuttle;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Location;
/**
@@ -29,7 +30,7 @@ public class ShuttleStop
private final int _id;
private boolean _isOpen = true;
private final List _dimensions = new ArrayList<>(3);
- private long _lastDoorStatusChanges = System.currentTimeMillis();
+ private long _lastDoorStatusChanges = Chronos.currentTimeMillis();
public ShuttleStop(int id)
{
@@ -64,7 +65,7 @@ public class ShuttleStop
}
_isOpen = true;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public void closeDoor()
@@ -75,11 +76,11 @@ public class ShuttleStop
}
_isOpen = false;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public boolean hasDoorChanged()
{
- return (System.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
+ return (Chronos.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Castle.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Castle.java
index 8aa51ae1d1..a85192d134 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Castle.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Castle.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.CastleData;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -160,7 +161,7 @@ public class Castle extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -195,7 +196,7 @@ public class Castle extends AbstractResidence
fee = _tempFee;
}
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Fort.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Fort.java
index 95839a8065..de66de79ed 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Fort.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Fort.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.FortUpdater;
import org.l2jmobius.gameserver.FortUpdater.UpdaterType;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -163,7 +164,7 @@ public class Fort extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -193,7 +194,7 @@ public class Fort extends AbstractResidence
if ((_fortOwner.getWarehouse().getAdena() >= _fee) || !_cwh)
{
final int fee = _endDate == -1 ? _tempFee : _fee;
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
@@ -580,7 +581,7 @@ public class Fort extends AbstractResidence
clan.setFortId(getResidenceId());
setOwnerClan(clan);
final int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
- long initial = System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
+ long initial = Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
while (initial > (Config.FS_UPDATE_FRQ * 60000))
{
initial -= Config.FS_UPDATE_FRQ * 60000;
@@ -786,7 +787,7 @@ public class Fort extends AbstractResidence
if (clan != null)
{
clanId = clan.getId();
- _lastOwnedTime.setTimeInMillis(System.currentTimeMillis());
+ _lastOwnedTime.setTimeInMillis(Chronos.currentTimeMillis());
}
else
{
@@ -920,12 +921,12 @@ public class Fort extends AbstractResidence
public int getOwnedTime()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
}
public int getTimeTillRebelArmy()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - System.currentTimeMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - Chronos.currentTimeMillis()) / 1000);
}
public long getTimeTillNextFortUpdate()
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Siege.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Siege.java
index d5e4b76039..789a93ff5c 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Siege.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/siege/Siege.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SiegeScheduleData;
import org.l2jmobius.gameserver.enums.SiegeClanType;
@@ -1434,9 +1435,9 @@ public class Siege implements Siegable
}
final Calendar calendar = _castle.getSiegeDate();
- if (calendar.getTimeInMillis() < System.currentTimeMillis())
+ if (calendar.getTimeInMillis() < Chronos.currentTimeMillis())
{
- calendar.setTimeInMillis(System.currentTimeMillis());
+ calendar.setTimeInMillis(Chronos.currentTimeMillis());
}
calendar.set(Calendar.DAY_OF_WEEK, holder.getDay());
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
index c7b80987c7..77396cff6d 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
@@ -32,10 +32,10 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
+import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
import org.l2jmobius.gameserver.model.stats.Stat;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
index c3ac06e1fc..18161a6c75 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
@@ -30,8 +30,8 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
index 5428c6f7dd..497f4e7247 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.zone.type;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -99,7 +100,7 @@ public class NoRestartZone extends ZoneType
return;
}
- if (((System.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
+ if (((Chronos.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
{
player.teleToLocation(TeleportWhereType.TOWN);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/GameClient.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/GameClient.java
index badd7b05a1..99c66513d8 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/GameClient.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/GameClient.java
@@ -30,6 +30,7 @@ import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.ICrypt;
import org.l2jmobius.commons.network.IIncomingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -341,7 +342,7 @@ public class GameClient extends ChannelInboundHandler
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps2 = con.prepareStatement("UPDATE characters SET deletetime=? WHERE charId=?"))
{
- ps2.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ ps2.setLong(1, Chronos.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
ps2.setInt(2, objectId);
ps2.execute();
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
index bf151234da..cf2986ced6 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -81,7 +82,7 @@ public class AllyDismiss implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000), Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
leaderClan.updateClanInDB();
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
index 3d5c508a4c..7cc2fa0c1f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class AllyLeave implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
clan.setAllyId(0);
clan.setAllyName(null);
clan.changeAllyCrest(0, true);
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 6b1b12e27a..2364f82a6d 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
@@ -534,7 +535,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_RECENTLY_BEEN_DISMISSED_FROM_A_CLAN_YOU_ARE_NOT_ALLOWED_TO_JOIN_ANOTHER_CLAN_FOR_24_HOURS);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
index c63a8bfcf4..854d89da8d 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.AdminTeleportType;
@@ -74,7 +75,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
player.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
index 781933df52..eec6279105 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
@@ -20,6 +20,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.enums.ItemSkillType;
@@ -126,7 +127,7 @@ public class RequestEnchantItem implements IClientIncomingPacket
}
// fast auto-enchant cheat check
- if ((request.getTimestamp() == 0) || ((System.currentTimeMillis() - request.getTimestamp()) < 2000))
+ if ((request.getTimestamp() == 0) || ((Chronos.currentTimeMillis() - request.getTimestamp()) < 2000))
{
Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " use autoenchant program ", Config.DEFAULT_PUNISH);
player.removeRequest(request.getClass());
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
index b8a07b77e8..bad73f8c28 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -82,7 +83,7 @@ public class RequestExAddEnchantScrollItem implements IClientIncomingPacket
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantScrollItemResult(_scrollObjectId));
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
index db4db5e742..b004d448e0 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -55,7 +56,7 @@ public class RequestExRemoveEnchantSupportItem implements IClientIncomingPacket
request.setSupportItem(PlayerInstance.ID_NONE);
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(ExRemoveEnchantSupportItemResult.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
index 7081788fa8..b7c0e01d93 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -69,7 +70,7 @@ public class RequestExSetPledgeCrestLarge implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
index c9e0cf1be8..7a2a1c706a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -85,7 +86,7 @@ public class RequestExTryToPutEnchantSupportItem implements IClientIncomingPacke
}
request.setSupportItem(support.getObjectId());
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantSupportItemResult(_supportObjectId));
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
index cdf3996711..4b04a3965e 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -76,7 +77,7 @@ public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
}
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
client.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
index 715be58f93..cd86a6542c 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -69,7 +70,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
{
if (_isJoining == 1)
{
- if (System.currentTimeMillis() < clan.getDissolvingExpiryTime())
+ if (Chronos.currentTimeMillis() < clan.getDissolvingExpiryTime())
{
client.sendPacket(SystemMessageId.YOUR_CLAN_MAY_NOT_REGISTER_TO_PARTICIPATE_IN_A_SIEGE_WHILE_UNDER_A_GRACE_PERIOD_OF_THE_CLAN_S_DISSOLUTION);
return;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
index 1e78964e1b..e31721fdce 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.BoatManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.instance.BoatInstance;
@@ -61,7 +62,7 @@ public class RequestMoveToLocationInVehicle implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
client.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
index 5563872c57..0fd55d3ffe 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
@@ -80,8 +81,8 @@ public class RequestOustPledgeMember implements IClientIncomingPacket
}
// this also updates the database
- clan.removeClanMember(member.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
- clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(member.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setCharPenaltyExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
final SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_HAS_BEEN_EXPELLED);
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
index 0bf1ebf5ec..a61cc79835 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
@@ -22,6 +22,7 @@ import java.sql.SQLException;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -68,7 +69,7 @@ public class RequestPetitionFeedback implements IClientIncomingPacket
statement.setString(2, player.getLastPetitionGmName());
statement.setInt(3, _rate);
statement.setString(4, _message);
- statement.setLong(5, System.currentTimeMillis());
+ statement.setLong(5, Chronos.currentTimeMillis());
statement.execute();
}
catch (SQLException e)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 30e0b1b097..9c606fc9fe 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -34,8 +34,8 @@ import org.l2jmobius.gameserver.model.quest.Event;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.network.GameClient;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
index ed6c0db580..2d92eb4df9 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -74,7 +75,7 @@ public class RequestSetPledgeCrest implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
index 16f6b732ba..f1d9597133 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.enums.UserInfoType;
@@ -101,7 +102,7 @@ public class RequestStartPledgeWar implements IClientIncomingPacket
client.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
- else if (clanDeclaredWar.getDissolvingExpiryTime() > System.currentTimeMillis())
+ else if (clanDeclaredWar.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(new SystemMessage(SystemMessageId.A_CLAN_WAR_CAN_NOT_BE_DECLARED_AGAINST_A_CLAN_THAT_IS_BEING_DISSOLVED));
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
index 8d0f9b92cc..48988b5249 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class RequestWithdrawalPledge implements IClientIncomingPacket
}
final Clan clan = player.getClan();
- clan.removeClanMember(player.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(player.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
index e1f30a1018..c379f83677 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlEvent;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.NextAction;
@@ -258,7 +259,7 @@ public class UseItem implements IClientIncomingPacket
else if (player.isAttackingNow())
{
// Equip or unEquip.
- ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
+ ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
index aef68ac971..96ce901338 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.appearance;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.enums.InventorySlot;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -252,7 +253,7 @@ public class RequestShapeShiftingItem implements IClientIncomingPacket
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getLifeTime() > 0))
{
- targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, System.currentTimeMillis() + appearanceStone.getLifeTime());
+ targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, Chronos.currentTimeMillis() + appearanceStone.getLifeTime());
targetItem.scheduleVisualLifeTime();
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
index 2aa7eeeeac..d6bbe9b766 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,9 +119,9 @@ public class ConfirmMenteeAdd implements IClientIncomingPacket
mentor.sendPacket(SystemMessageId.YOU_MUST_AWAKEN_IN_ORDER_TO_BECOME_A_MENTOR);
return false;
}
- else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > System.currentTimeMillis())
+ else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > Chronos.currentTimeMillis())
{
- long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - System.currentTimeMillis()) / 1000;
+ long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - Chronos.currentTimeMillis()) / 1000;
final int days = (int) (remainingTime / 86400);
remainingTime = remainingTime % 86400;
final int hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
index e06cd9048d..1e8aba6d16 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
@@ -119,7 +120,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
index f6702caa41..9c076a29a5 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.enums.MailType;
@@ -140,7 +141,7 @@ public class RequestBRPresentBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
index c3faad961a..138ed60513 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.training;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.TrainingHolder;
import org.l2jmobius.gameserver.network.GameClient;
@@ -52,7 +53,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
if (holder.isTraining())
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
@@ -60,7 +61,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
player.setImmobilized(false);
player.teleToLocation(player.getLastLocation());
player.sendPacket(ExTrainingZone_Leaving.STATIC_PACKET);
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
index ee1c787150..3f1213f2ee 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.loginserverpackets.game;
import org.l2jmobius.commons.network.BaseSendablePacket;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author mrTJO
@@ -28,7 +29,7 @@ public class TempBan extends BaseSendablePacket
writeC(0x0A);
writeS(accountName);
writeS(ip);
- writeQ(System.currentTimeMillis() + (time * 60000));
+ writeQ(Chronos.currentTimeMillis() + (time * 60000));
// if (reason != null)
// {
// writeC(0x01);
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
index 0852a21da4..5a9ce7f545 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.CharSelectInfoPackage;
@@ -188,7 +189,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP
packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP
- packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
+ packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0);
packet.writeD(charInfoPackage.getClassId());
packet.writeD(i == _activeId ? 1 : 0);
@@ -284,7 +285,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
// See if the char must be deleted
final long deletetime = chardata.getLong("deletetime");
- if ((deletetime > 0) && (System.currentTimeMillis() > deletetime))
+ if ((deletetime > 0) && (Chronos.currentTimeMillis() > deletetime))
{
final Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
if (clan != null)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
index 4bdb9d3951..e1c3fc3f54 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
@@ -50,7 +51,7 @@ public class ExInzoneWaiting implements IClientOutgoingPacket
packet.writeD(_instanceTimes.size());
for (Entry entry : _instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
index a40690e845..6f7b5f8735 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MatchingRoomManager;
@@ -73,7 +74,7 @@ public class ExListPartyMatchingWaitingRoom implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
index d455d825fd..5921d44781 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MatchingMemberType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -61,7 +62,7 @@ public class ExPartyRoomMember implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
index 3656ddbc4e..ab85228caf 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MailType;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
@@ -45,7 +46,7 @@ public class ExShowReceivedPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_RECEIVED_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_inbox != null) && !_inbox.isEmpty())
{
packet.writeD(_inbox.size());
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
index 2ae09181a7..db4bccc928 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -40,7 +41,7 @@ public class ExShowSentPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_SENT_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_outbox != null) && !_outbox.isEmpty())
{
packet.writeD(_outbox.size());
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
index 1584453ac4..1220552935 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.items.Henna;
import org.l2jmobius.gameserver.model.stats.BaseStat;
@@ -73,7 +74,7 @@ public class HennaInfo implements IClientOutgoingPacket
int duration = premium.getDuration();
if (duration > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
duration = (int) Math.max(0, _player.getVariables().getLong("HennaDuration4", currentTime) - currentTime) / 1000;
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
index 5ed678042b..caed96260b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -88,7 +89,7 @@ public class SiegeInfo implements IClientOutgoingPacket
packet.writeS(""); // Ally Name
}
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if (!_castle.isTimeRegistrationOver() && _player.isClanLeader() && (_player.getClanId() == _castle.getOwnerId()))
{
final Calendar cal = Calendar.getInstance();
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
index 5871334785..c6de3ccd8b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.TimeStamp;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -36,7 +37,7 @@ public class SkillCoolTime implements IClientOutgoingPacket
public SkillCoolTime(PlayerInstance player)
{
- _currentTime = System.currentTimeMillis();
+ _currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : player.getSkillReuseTimeStamps().values())
{
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel()).isNotBroadcastable())
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
index 74955d8a26..2ffa34919b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets.friend;
import java.util.Calendar;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -39,7 +40,7 @@ public class ExFriendDetailInfo implements IClientOutgoingPacket
_objectId = player.getObjectId();
_name = name;
_friend = World.getInstance().getPlayer(_name);
- _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) System.currentTimeMillis() : (int) (System.currentTimeMillis() - _friend.getLastAccess()) / 1000;
+ _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) Chronos.currentTimeMillis() : (int) (Chronos.currentTimeMillis() - _friend.getLastAccess()) / 1000;
}
@Override
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/scripting/ManagedScript.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
index 00235baa25..9d206480d8 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
@@ -20,6 +20,8 @@ import java.nio.file.Path;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* Abstract class for classes that are meant to be implemented by scripts.
* @author KenM
@@ -35,7 +37,7 @@ public abstract class ManagedScript
public ManagedScript()
{
_scriptFile = getScriptPath();
- setLastLoadTime(System.currentTimeMillis());
+ setLastLoadTime(Chronos.currentTimeMillis());
}
public abstract Path getScriptPath();
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9c8c4bb5dd..b5a2e04233 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -54,7 +55,7 @@ public class AttackStanceTaskManager
}
_working = true;
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
try
{
final Iterator> iterator = _attackStanceTasks.entrySet().iterator();
@@ -105,7 +106,7 @@ public class AttackStanceTaskManager
return;
}
- _attackStanceTasks.put(creature, System.currentTimeMillis());
+ _attackStanceTasks.put(creature, Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
index 8ab6c99d28..d56e0b8a23 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.buylist.Product;
/**
@@ -45,7 +46,7 @@ public class BuyListTaskManager
}
_workingProducts = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : PRODUCTS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 8b4a7db319..f8218055f3 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@@ -44,7 +45,7 @@ public class DecayTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -87,7 +88,7 @@ public class DecayTaskManager
}
// Add to decay schedules.
- DECAY_SCHEDULES.put(creature, System.currentTimeMillis() + (delay * 1000));
+ DECAY_SCHEDULES.put(creature, Chronos.currentTimeMillis() + (delay * 1000));
}
/**
@@ -107,7 +108,7 @@ public class DecayTaskManager
public long getRemainingTime(Creature creature)
{
final Long time = DECAY_SCHEDULES.get(creature);
- return time != null ? time.longValue() - System.currentTimeMillis() : Long.MAX_VALUE;
+ return time != null ? time.longValue() - Chronos.currentTimeMillis() : Long.MAX_VALUE;
}
@Override
@@ -122,7 +123,7 @@ public class DecayTaskManager
ret.append("Tasks dump:");
ret.append(Config.EOL);
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
ret.append("Class/Name: ");
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
index c3834ecbb9..e0f823bef4 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemAppearanceTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
index 27f0273802..de10959db8 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemLifeTimeTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 396633692c..160debb492 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -42,7 +43,7 @@ public class ItemManaTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
@@ -61,7 +62,7 @@ public class ItemManaTaskManager
{
if (!ITEMS.containsKey(item))
{
- ITEMS.put(item, System.currentTimeMillis() + MANA_CONSUMPTION_RATE);
+ ITEMS.put(item, Chronos.currentTimeMillis() + MANA_CONSUMPTION_RATE);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
index eb0dd7a59f..a2f0dc5563 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.model.World;
@@ -48,7 +49,7 @@ public class MessageDeletionTaskManager
Integer msgId;
Message msg;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_MESSAGES.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
index 2f270649fb..82483a498a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PlayerAutoSaveTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SEARCH: for (Entry entry : PLAYER_TIMES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -63,7 +64,7 @@ public class PlayerAutoSaveTaskManager
public void add(PlayerInstance player)
{
- PLAYER_TIMES.put(player, System.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
+ PLAYER_TIMES.put(player, Chronos.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
}
public void remove(PlayerInstance player)
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
index 6a406a9591..3a812e2fcb 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PvpFlagTaskManager
if (!PLAYERS.isEmpty())
{
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (PlayerInstance player : PLAYERS)
{
if (time > player.getPvpFlagLasts())
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
index 5473f21a8f..b8135996f8 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -43,7 +44,7 @@ public class RandomAnimationTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_ANIMATIONS.entrySet())
{
if (time > entry.getValue().longValue())
@@ -65,7 +66,7 @@ public class RandomAnimationTaskManager
{
if (npc.hasRandomAnimation())
{
- PENDING_ANIMATIONS.putIfAbsent(npc, System.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
+ PENDING_ANIMATIONS.putIfAbsent(npc, Chronos.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
index 8e8e818908..debb0d68e6 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Spawn;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -42,7 +43,7 @@ public class RespawnTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_RESPAWNS.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
index 990efb8b45..d1946b860a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -36,6 +36,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskBirthday;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskRecom;
@@ -94,7 +95,7 @@ public class TaskManager
public void run()
{
task.onTimeElapsed(this);
- lastActivation = System.currentTimeMillis();
+ lastActivation = Chronos.currentTimeMillis();
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement statement = con.prepareStatement(SQL_STATEMENTS[1]))
{
@@ -242,7 +243,7 @@ public class TaskManager
try
{
final Date desired = DateFormat.getInstance().parse(task.getParams()[0]);
- final long diff = desired.getTime() - System.currentTimeMillis();
+ final long diff = desired.getTime() - Chronos.currentTimeMillis();
if (diff >= 0)
{
task.scheduled = ThreadPool.schedule(task, diff);
@@ -293,7 +294,7 @@ public class TaskManager
return false;
}
- delay = min.getTimeInMillis() - System.currentTimeMillis();
+ delay = min.getTimeInMillis() - Chronos.currentTimeMillis();
if (check.after(min) || (delay < 0))
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ui/SystemPanel.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ui/SystemPanel.java
index 8c01c1f8fe..a19a873bfe 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ui/SystemPanel.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ui/SystemPanel.java
@@ -31,6 +31,7 @@ import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.util.Locator;
@@ -42,7 +43,7 @@ public class SystemPanel extends JPanel
{
protected static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
- protected static final long START_TIME = System.currentTimeMillis();
+ protected static final long START_TIME = Chronos.currentTimeMillis();
public SystemPanel()
{
@@ -136,7 +137,7 @@ public class SystemPanel extends JPanel
lblConnected.setText("Connected: " + playerCount);
lblMaxConnected.setText("Max connected: " + World.MAX_CONNECTED_COUNT);
lblOfflineShops.setText("Offline trade: " + World.OFFLINE_TRADE_COUNT);
- lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - START_TIME));
+ lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(Chronos.currentTimeMillis() - START_TIME));
}
}, 1000, 1000);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
index ec95816f82..cc8059f91a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.PlayerCondOverride;
@@ -151,7 +152,7 @@ public class FloodProtectorAction
*/
private void banAccount()
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
if (LOGGER.isLoggable(Level.WARNING))
{
log(" banned for flooding ", _config.PUNISHMENT_TIME <= 0 ? "forever" : "for " + (_config.PUNISHMENT_TIME / 60000) + " mins");
@@ -171,7 +172,7 @@ public class FloodProtectorAction
final int charId = _client.getPlayer().getObjectId();
if (charId > 0)
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
}
if (LOGGER.isLoggable(Level.WARNING))
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
index e5912dd51b..d6580161c7 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World;
@@ -143,7 +144,7 @@ public class OfflineTradeUtil
if (player.getOfflineStartTime() == 0)
{
- player.setOfflineStartTime(System.currentTimeMillis());
+ player.setOfflineStartTime(Chronos.currentTimeMillis());
}
// Store trade on exit, if realtime saving is enabled.
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/FloodProtectedListener.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/FloodProtectedListener.java
index ba2fc6536a..e2bbcc1aa3 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/FloodProtectedListener.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/FloodProtectedListener.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author -Wooden-
@@ -63,9 +64,9 @@ public abstract class FloodProtectedListener extends Thread
if (fConnection != null)
{
fConnection.connectionNumber += 1;
- if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((System.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((System.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
+ if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
{
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
connection.close();
fConnection.connectionNumber -= 1;
if (!fConnection.isFlooding)
@@ -80,11 +81,11 @@ public abstract class FloodProtectedListener extends Thread
fConnection.isFlooding = false;
LOGGER.info(connection.getInetAddress().getHostAddress() + " is not considered as flooding anymore.");
}
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
}
else
{
- fConnection = new ForeignConnection(System.currentTimeMillis());
+ fConnection = new ForeignConnection(Chronos.currentTimeMillis());
_floodProtection.put(connection.getInetAddress().getHostAddress(), fConnection);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/LoginController.java
index 189b90e2ee..9d382c646b 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/LoginController.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/LoginController.java
@@ -41,6 +41,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.GameServerTable.GameServerInfo;
@@ -176,7 +177,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(USER_INFO_SELECT))
{
- ps.setString(1, Long.toString(System.currentTimeMillis()));
+ ps.setString(1, Long.toString(Chronos.currentTimeMillis()));
ps.setString(2, login);
try (ResultSet rset = ps.executeQuery())
{
@@ -208,7 +209,7 @@ public class LoginController
{
ps.setString(1, login);
ps.setString(2, hashBase64);
- ps.setLong(3, System.currentTimeMillis());
+ ps.setLong(3, Chronos.currentTimeMillis());
ps.setInt(4, 0);
ps.setString(5, addr.getHostAddress());
ps.execute();
@@ -273,7 +274,7 @@ public class LoginController
*/
public void addBanForAddress(InetAddress address, long duration)
{
- _bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
+ _bannedIps.putIfAbsent(address, Chronos.currentTimeMillis() + duration);
}
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
@@ -294,7 +295,7 @@ public class LoginController
}
if (bi != null)
{
- if ((bi > 0) && (bi < System.currentTimeMillis()))
+ if ((bi > 0) && (bi < Chronos.currentTimeMillis()))
{
_bannedIps.remove(address);
LOGGER.info("Removed expired ip address ban " + address.getHostAddress() + ".");
@@ -541,7 +542,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(ACCOUNT_INFO_UPDATE))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.setString(2, address.getHostAddress());
ps.setString(3, info.getLogin());
ps.execute();
@@ -613,7 +614,7 @@ public class LoginController
{
continue;
}
- if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < System.currentTimeMillis())
+ if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < Chronos.currentTimeMillis())
{
client.close(LoginFailReason.REASON_ACCESS_FAILED);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/LoginClient.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/LoginClient.java
index 04455664e2..93194a11c0 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/LoginClient.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/LoginClient.java
@@ -27,6 +27,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.IIncomingPacket;
import org.l2jmobius.commons.network.IOutgoingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.LoginController;
@@ -82,14 +83,14 @@ public class LoginClient extends ChannelInboundHandler
_addr = address.getAddress();
_channel = ctx.channel();
_sessionId = Rnd.nextInt();
- _connectionStartTime = System.currentTimeMillis();
+ _connectionStartTime = Chronos.currentTimeMillis();
sendPacket(new Init(_scrambledPair.getScrambledModulus(), _blowfishKey.getEncoded(), _sessionId));
}
@Override
public void channelInactive(ChannelHandlerContext ctx)
{
- if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < System.currentTimeMillis()))
+ if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < Chronos.currentTimeMillis()))
{
LoginController.getInstance().removeAuthedLoginClient(getAccount());
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/serverpackets/ServerList.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/serverpackets/ServerList.java
index 2ff46a5410..90ca7077ee 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/serverpackets/ServerList.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/serverpackets/ServerList.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.network.IOutgoingPacket;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.loginserver.GameServerTable;
import org.l2jmobius.loginserver.GameServerTable.GameServerInfo;
import org.l2jmobius.loginserver.network.LoginClient;
@@ -166,7 +167,7 @@ public class ServerList implements IOutgoingPacket
packet.writeC(_charsToDelete.get(servId).length);
for (long deleteTime : _charsToDelete.get(servId))
{
- packet.writeD((int) ((deleteTime - System.currentTimeMillis()) / 1000));
+ packet.writeD((int) ((deleteTime - Chronos.currentTimeMillis()) / 1000));
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
index 801bc957ae..875759b72a 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
@@ -24,6 +24,8 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* IPv4 filter.
* @author Forsaiken
@@ -59,7 +61,7 @@ public class IPv4Filter implements Runnable
Flood()
{
- lastAccess = System.currentTimeMillis();
+ lastAccess = Chronos.currentTimeMillis();
trys = 0;
}
}
@@ -74,7 +76,7 @@ public class IPv4Filter implements Runnable
}
final int h = hash(addr.getAddress());
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
Flood f;
synchronized (_ipFloodMap)
{
@@ -120,7 +122,7 @@ public class IPv4Filter implements Runnable
{
while (true)
{
- final long reference = System.currentTimeMillis() - (1000 * 300);
+ final long reference = Chronos.currentTimeMillis() - (1000 * 300);
synchronized (_ipFloodMap)
{
final Iterator> it = _ipFloodMap.entrySet().iterator();
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 e66362d6c0..86b46f1919 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
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.model.Location;
@@ -137,7 +138,7 @@ public class Parade extends AbstractNpcAI
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
- LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
+ LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
}
void load()
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
index c91b42bb26..7757d82c61 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -304,7 +305,7 @@ public class TalentShow extends AbstractNpcAI
hourDiff *= 3600000;
minDiff *= 60000;
diff = hourDiff + minDiff;
- LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
+ LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
startQuestTimer("Start", diff, null, null); // first start
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
index 940193f4fc..32c8b9f9f1 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
@@ -16,6 +16,7 @@
*/
package ai.areas.GainakUnderground.Lailly;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -64,7 +65,7 @@ public class Lailly extends AbstractNpcAI
case "okay":
{
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
- if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis()))
+ if ((instance != null) && (instance.getEndTime() > Chronos.currentTimeMillis()))
{
switch (instance.getTemplateId())
{
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 a00d59028e..037b29d579 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
@@ -29,6 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -516,7 +517,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
final GlobalVariablesManager vars = GlobalVariablesManager.getInstance();
final long var = vars.getLong("FourSepulchers" + npcId, 0) + (TIME_ATTACK * 60 * 1000);
- if (var > System.currentTimeMillis())
+ if (var > Chronos.currentTimeMillis())
{
showHtmlFile(player, npcId + "-NE.html", npc, null);
return;
@@ -581,7 +582,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
ThreadPool.schedule(() -> ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers(), TIME_ATTACK * 60 * 1000);
// Save attack time
- vars.set("FourSepulchers" + npcId, System.currentTimeMillis());
+ vars.set("FourSepulchers" + npcId, Chronos.currentTimeMillis());
// Init progress
STORED_PROGRESS.put(sepulcherId, 1); // start from 1
// Start
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
index 4badef030d..68a46309c8 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
@@ -19,6 +19,7 @@ package ai.areas.KeucereusAllianceBase;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
@@ -111,7 +112,7 @@ public class LindviorScene extends AbstractNpcAI
final GregorianCalendar date = new GregorianCalendar();
date.set(Calendar.MINUTE, RESET_MIN);
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
- if (System.currentTimeMillis() >= date.getTimeInMillis())
+ if (Chronos.currentTimeMillis() >= date.getTimeInMillis())
{
date.add(Calendar.DAY_OF_WEEK, 1);
}
@@ -129,7 +130,7 @@ public class LindviorScene extends AbstractNpcAI
{
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
}
- return date.getTimeInMillis() - System.currentTimeMillis();
+ return date.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
index 80dffe38b2..de8ea0aea9 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
@@ -19,6 +19,7 @@ package ai.areas.Rune.RuneCastle.Venom;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -111,7 +112,7 @@ public class Venom extends AbstractNpcAI
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
index a7d7250e8b..c42186c0d0 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -229,7 +230,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
int buffsNow = 0;
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
- if (var < System.currentTimeMillis())
+ if (var < Chronos.currentTimeMillis())
{
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
@@ -254,7 +255,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
reenter.set(Calendar.MINUTE, 0);
reenter.set(Calendar.HOUR_OF_DAY, 13);
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
- if (reenter.getTimeInMillis() <= System.currentTimeMillis())
+ if (reenter.getTimeInMillis() <= Chronos.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 7);
}
@@ -272,7 +273,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
}
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
private void spawnGroupOfMinion(MonsterInstance npc, int[] mobIds)
@@ -317,7 +318,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
zone.clearSkills();
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
else if (event.equalsIgnoreCase("transform"))
{
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
index e004e80b3d..8044c58bf3 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -345,7 +346,7 @@ public class Anakim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ANAKIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_anakim", time, null, null);
@@ -373,7 +374,7 @@ public class Anakim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(ANAKIM, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -550,7 +551,7 @@ public class Anakim extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_anakimStatus == WAITING) && (npc.getId() == ANAKIM_CUBIC))
@@ -578,7 +579,7 @@ public class Anakim extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid())// Anakim and minions
{
// Anti BUGGERS
@@ -614,7 +615,7 @@ public class Anakim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ANAKIM, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(ANAKIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ANAKIM, info);
startQuestTimer("unlock_anakim", respawnTime, null, null);
@@ -686,7 +687,7 @@ public class Anakim extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
index 4a77fb6bfd..fe808aef25 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.MountType;
@@ -169,14 +170,14 @@ public class Antharas extends AbstractNpcAI
_antharas = (GrandBossInstance) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
_antharas.setCurrentHpMp(curr_hp, curr_mp);
addBoss(_antharas);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
break;
}
case DEAD:
{
- final long remain = respawnTime - System.currentTimeMillis();
+ final long remain = respawnTime - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -272,7 +273,7 @@ public class Antharas extends AbstractNpcAI
_antharas.setRandomWalking(false);
_antharas.teleToLocation(181323, 114850, -7623, 32542);
setStatus(IN_FIGHT);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
zone.broadcastPacket(new PlaySound("BS02_A"));
startQuestTimer("CAMERA_1", 23, _antharas, null);
break;
@@ -367,7 +368,7 @@ public class Antharas extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 900000) < Chronos.currentTimeMillis()))
{
setStatus(ALIVE);
for (Creature creature : zone.getCharactersInside())
@@ -619,7 +620,7 @@ public class Antharas extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BOMBER)
{
if (npc.calculateDistance3D(attacker) < 230)
@@ -765,7 +766,7 @@ public class Antharas extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
+ GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
}
private final void refreshAiParams(PlayerInstance attacker, int damage)
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Baium/Baium.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Baium/Baium.java
index 58985ad33b..0cd17178d9 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Baium/Baium.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Baium/Baium.java
@@ -17,6 +17,7 @@
package ai.bosses.Baium;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.CategoryType;
@@ -136,7 +137,7 @@ public class Baium extends AbstractNpcAI
final int heading = info.getInt("heading");
_baium = (GrandBossInstance) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
_baium.setCurrentHpMp(curr_hp, curr_mp);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
addBoss(_baium);
for (Location loc : ARCHANGEL_LOC)
@@ -149,7 +150,7 @@ public class Baium extends AbstractNpcAI
}
case DEAD:
{
- final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -209,7 +210,7 @@ public class Baium extends AbstractNpcAI
_baium.disableCoreAI(true);
_baium.setRandomWalking(false);
addBoss(_baium);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
@@ -375,7 +376,7 @@ public class Baium extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
{
notifyEvent("CLEAR_ZONE", null, null);
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
@@ -383,7 +384,7 @@ public class Baium extends AbstractNpcAI
}
else if (npc != null)
{
- if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
+ if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
{
npc.setTarget(npc);
npc.doCast(HEAL_OF_BAIUM.getSkill());
@@ -484,7 +485,7 @@ public class Baium extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BAIUM)
{
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
@@ -663,7 +664,7 @@ public class Baium extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
+ GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
}
private void manageSkills(Npc npc)
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
index aa8528926d..dfce75d90b 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -108,7 +109,7 @@ public class Beleth extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("BELETH_UNLOCK", time, null, null);
@@ -349,7 +350,7 @@ public class Beleth extends AbstractNpcAI
c.setImmobilized(false);
}
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, null, null);
startQuestTimer("SPAWN25", 60000, null, null);
break;
@@ -507,7 +508,7 @@ public class Beleth extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((_lastAttack + 900000) < System.currentTimeMillis())
+ if ((_lastAttack + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -708,7 +709,7 @@ public class Beleth extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(REAL_BELETH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
deleteAll();
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Core/Core.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Core/Core.java
index 969bb08788..69dc20dc5d 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Core/Core.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Core/Core.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -89,7 +90,7 @@ public class Core extends AbstractNpcAI
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
@@ -206,7 +207,7 @@ public class Core extends AbstractNpcAI
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
index 3ed92d8f08..b499a47575 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.MountType;
@@ -295,7 +296,7 @@ public class IceQueensCastleBattle extends AbstractInstance
{
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
- controller.getVariables().set("TIMER_END", System.currentTimeMillis() + 360000);
+ controller.getVariables().set("TIMER_END", Chronos.currentTimeMillis() + 360000);
}
break;
}
@@ -688,7 +689,7 @@ public class IceQueensCastleBattle extends AbstractInstance
}
case "SHOW_GLAKIAS_TIMER":
{
- final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - System.currentTimeMillis()) / 1000);
+ final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - Chronos.currentTimeMillis()) / 1000);
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
break;
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
index acbc2c3094..6023594423 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
@@ -23,6 +23,7 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -143,11 +144,11 @@ public class ScarletVanHalisha extends AbstractNpcAI
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
}
@@ -248,7 +249,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
case FRINTEZZA_DAEMON_MORPH:
case FRINTEZZA_DAEMON_FIELD:
{
- _lastRangedSkillTime = System.currentTimeMillis();
+ _lastRangedSkillTime = Chronos.currentTimeMillis();
skillRange = 550;
break;
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
index 81fd9ae6e8..9c32d36ecf 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.Movie;
@@ -121,7 +122,7 @@ public class Kelbim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(KELBIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_kelbim", time, null, null);
@@ -156,7 +157,7 @@ public class Kelbim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(KELBIM, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -193,7 +194,7 @@ public class Kelbim extends AbstractNpcAI
{
_kelbimBoss = (GrandBossInstance) addSpawn(KELBIM, -56340, 60801, -269, 54262, false, 0);
GrandBossManager.getInstance().addBoss(_kelbimBoss);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
startQuestTimer("stage_all_random_area_attack", Rnd.get(2, 3) * 60000, null, null);
break;
@@ -369,7 +370,7 @@ public class Kelbim extends AbstractNpcAI
{
if (npc.getId() == KELBIM)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
switch (_bossStage)
{
@@ -434,7 +435,7 @@ public class Kelbim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(KELBIM, DEAD);
final long respawnTime = (Config.KELBIM_SPAWN_INTERVAL + getRandom(-Config.KELBIM_SPAWN_RANDOM, Config.KELBIM_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(KELBIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(KELBIM, info);
startQuestTimer("unlock_kelbim", respawnTime, null, null);
startQuestTimer("end_kelbim", 1800000, null, null);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
index 62507c9762..510a8060de 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -371,7 +372,7 @@ public class Lilith extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LILITH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lilith", time, null, null);
@@ -399,7 +400,7 @@ public class Lilith extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(LILITH, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -576,7 +577,7 @@ public class Lilith extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_lilithStatus == WAITING) && (npc.getId() == LILITH_CUBIC))
@@ -594,7 +595,7 @@ public class Lilith extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid()) // Lilith and minions
{
// Anti BUGGERS
@@ -630,7 +631,7 @@ public class Lilith extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LILITH, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(LILITH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LILITH, info);
startQuestTimer("unlock_lilith", respawnTime, null, null);
@@ -702,7 +703,7 @@ public class Lilith extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
@Override
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 6b02643bc0..63811284a1 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
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -213,7 +214,7 @@ public class Lindvior extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lindvior", time, null, null);
@@ -863,7 +864,7 @@ public class Lindvior extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
final long respawnTime = (Config.LINDVIOR_SPAWN_INTERVAL + getRandom(-Config.LINDVIOR_SPAWN_RANDOM, Config.LINDVIOR_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
startQuestTimer("unlock_lindvior", respawnTime, null, null);
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
index edd3abc4b8..801d31427b 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -97,7 +98,7 @@ public class Orfen extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for Orfen from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if Orfen is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -328,7 +329,7 @@ public class Orfen extends AbstractNpcAI
startQuestTimer("orfen_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ORFEN, info);
cancelQuestTimer("check_minion_loc", npc, null);
cancelQuestTimer("check_orfen_pos", npc, null);
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 f2869a3fe9..c00a82fb97 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
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -96,7 +97,7 @@ public class QueenAnt extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for queen ant from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if queen ant is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -367,7 +368,7 @@ public class QueenAnt extends AbstractNpcAI
cancelQuestTimer("heal", null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(QUEEN, info);
_nurses.clear();
_larva.deleteMe();
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
index eda49595a1..fd26faf27c 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.QueenShyeed;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -87,7 +88,7 @@ public class QueenShyeed extends AbstractNpcAI
private void spawnShyeed()
{
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
- final long remain = respawn != 0 ? respawn - System.currentTimeMillis() : 0;
+ final long remain = respawn != 0 ? respawn - Chronos.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("respawn", remain, null, null);
@@ -103,7 +104,7 @@ public class QueenShyeed extends AbstractNpcAI
private void startRespawn()
{
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
- GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(System.currentTimeMillis() + respawnTime));
+ GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(Chronos.currentTimeMillis() + respawnTime));
startQuestTimer("respawn", respawnTime, null, null);
// MOB_BUFF_ZONE.setEnabled(false);
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
index 4d4eb8653a..be58208558 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.Sailren;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -71,7 +72,7 @@ public class Sailren extends AbstractNpcAI
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
- final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
+ final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - Chronos.currentTimeMillis();
if (remain > 0)
{
STATUS = Status.DEAD;
@@ -118,7 +119,7 @@ public class Sailren extends AbstractNpcAI
{
takeItems(player, GAZKH, 1);
STATUS = Status.IN_FIGHT;
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
for (PlayerInstance member : player.getParty().getMembers())
{
if (member.isInsideRadius3D(npc, 1000))
@@ -237,7 +238,7 @@ public class Sailren extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
+ if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < Chronos.currentTimeMillis()))
{
cancelQuestTimer("TIME_OUT", null, null);
notifyEvent("TIME_OUT", null, null);
@@ -257,7 +258,7 @@ public class Sailren extends AbstractNpcAI
{
if (zone.isCharacterInZone(attacker))
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -274,7 +275,7 @@ public class Sailren extends AbstractNpcAI
STATUS = Status.DEAD;
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
final long respawnTime = RESPAWN * 3600000;
- GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set("SailrenRespawn", Chronos.currentTimeMillis() + respawnTime);
cancelQuestTimer("CHECK_ATTACK", null, null);
cancelQuestTimer("TIME_OUT", null, null);
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
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 0c824fd3b2..523f53e898 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
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -326,7 +327,7 @@ public class Trasken extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_trasken", time, null, null);
@@ -604,7 +605,7 @@ public class Trasken extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
startQuestTimer("unlock_trasken", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
index 94d29e346e..c8e0f497af 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.MountType;
@@ -129,7 +130,7 @@ public class Valakas extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for valakas from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (temp > 0)
{
// The time has not yet expired. Mark Valakas as currently locked (dead).
@@ -168,7 +169,7 @@ public class Valakas extends AbstractNpcAI
if (status == FIGHTING)
{
// stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
startQuestTimer("regen_task", 60000, valakas, null, true);
startQuestTimer("skill_task", 2000, valakas, null, true);
@@ -196,7 +197,7 @@ public class Valakas extends AbstractNpcAI
if (event.equalsIgnoreCase("beginning"))
{
// Stores current time
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
// Teleport Valakas to his lair.
npc.teleToLocation(VALAKAS_LAIR);
@@ -220,7 +221,7 @@ public class Valakas extends AbstractNpcAI
else if (event.equalsIgnoreCase("regen_task"))
{
// Inactivity task - 15min
- if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
+ if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < Chronos.currentTimeMillis()))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
@@ -416,7 +417,7 @@ public class Valakas extends AbstractNpcAI
npc.setTarget(attacker);
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
}
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -447,7 +448,7 @@ public class Valakas extends AbstractNpcAI
startQuestTimer("valakas_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
return super.onKill(npc, killer, isSummon);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
index ddc6ff9e74..40bd1cf6c2 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
@@ -46,8 +46,8 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcManorBypass;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.teleporter.TeleportHolder;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index a7e5e42043..75ce73d138 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -26,6 +26,7 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -153,7 +154,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -189,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
@@ -247,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
@@ -296,7 +297,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0]");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
sb.append(" | ");
sb.append(auction.getHighestBid());
sb.append(" | ");
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
index f469c39159..2362aa9446 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -21,6 +21,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.Location;
@@ -73,7 +74,7 @@ public class ProvisionalHalls extends AbstractNpcAI
if (resetTime > 0)
{
cancelQuestTimers(HALL_RESET_VAR + id);
- startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
}
}
}
@@ -126,7 +127,7 @@ public class ProvisionalHalls extends AbstractNpcAI
for (int id : CLAN_HALLS.keySet())
{
- if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < Chronos.currentTimeMillis()))
{
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
@@ -137,7 +138,7 @@ public class ProvisionalHalls extends AbstractNpcAI
clanHall.setOwner(player.getClan());
}
player.sendMessage("Congratulations! You now own a provisional clan hall!");
- startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
return null;
}
}
@@ -177,7 +178,7 @@ public class ProvisionalHalls extends AbstractNpcAI
else if (event.startsWith(HALL_RESET_VAR))
{
final String id = event.replace(HALL_RESET_VAR, "");
- if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
{
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
if (clanId > 0)
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index 18f813b1a2..a3c74220a9 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -19,6 +19,7 @@ package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -111,7 +112,7 @@ public class TrainingCamp extends AbstractNpcAI
player.teleToLocation(TRAINING_LOCATION);
player.setImmobilized(true);
// @Sdw: Here we are supposed to send ExUserInfoEquipSlot with a fake equip of a SLS, feels ugly to me, not doing it.
- player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
+ player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), Chronos.currentTimeMillis(), -1));
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
@@ -203,7 +204,7 @@ public class TrainingCamp extends AbstractNpcAI
final TrainingHolder holder = player.getTraingCampInfo();
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
index 49dfa6b963..6140daa716 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
@@ -16,6 +16,7 @@
*/
package events.FreyaCelebration;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -79,7 +80,7 @@ public class FreyaCelebration extends LongTimeEvent
{
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
if (currentTime > reuseTime)
{
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
index cce5b52533..d97b3c74db 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
@@ -16,6 +16,7 @@
*/
package events.GiftOfVitality;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -94,9 +95,9 @@ public class GiftOfVitality extends LongTimeEvent
case "vitality":
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -110,7 +111,7 @@ public class GiftOfVitality extends LongTimeEvent
{
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
htmltext = "4306-okvitality.htm";
}
break;
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
index 038d7883b0..7fb3b481dd 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
@@ -16,6 +16,7 @@
*/
package events.LoveYourGatekeeper;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -58,9 +59,9 @@ public class LoveYourGatekeeper extends LongTimeEvent
if (player.getAdena() >= PRICE)
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -73,7 +74,7 @@ public class LoveYourGatekeeper extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, PRICE);
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
}
}
else
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
index 0898d8dbc5..088b261fbe 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
@@ -16,6 +16,7 @@
*/
package events.MasterOfEnchanting;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -86,7 +87,7 @@ public class MasterOfEnchanting extends LongTimeEvent
}
else if (event.equalsIgnoreCase("buy_scroll_24"))
{
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
final String value = player.getVariables().getString("MasterOfEnchanting", "");
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
@@ -100,7 +101,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
@@ -134,7 +135,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/SavingSanta/SavingSanta.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
index 4f95514f8c..b6900127dc 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -324,7 +325,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_rewardedPlayers.containsKey(pl.getAccountName()))
{
- final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
+ final long elapsedTimeSinceLastRewarded = Chronos.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
{
continue;
@@ -333,7 +334,7 @@ public class SavingSanta extends LongTimeEvent
else
{
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
- if ((System.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
+ if ((Chronos.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
{
_rewardedPlayers.put(pl.getAccountName(), time);
continue;
@@ -343,8 +344,8 @@ public class SavingSanta extends LongTimeEvent
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
- _rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
- player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
+ _rewardedPlayers.put(pl.getAccountName(), Chronos.currentTimeMillis());
+ player.getVariables().set("LAST_SANTA_REWARD", Chronos.currentTimeMillis());
startQuestTimer("SantaRewarding0", 500, santa, pl);
}
}
@@ -437,7 +438,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
{
startQuestTimer("SantaBlessings", 15000, null, null);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Npc santaHelper1 : _santaHelpers)
{
for (PlayerInstance plb : World.getInstance().getVisibleObjects(santaHelper1, PlayerInstance.class))
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
index 64d4112e1f..729838d853 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Collection;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.CursedWeapon;
@@ -209,7 +210,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
}
- cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
+ cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
cw.reActivate();
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
index 9801093a20..0e4285c8e3 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Calendar;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -66,7 +67,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
{
final Calendar nextChangeDate = Calendar.getInstance();
- nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
+ nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
html.replace("%sodtime%", nextChangeDate.getTime().toString());
}
else
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
index e2c17e3d50..dec3cec950 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,7 +119,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
int hours = 0;
int minutes = 0;
final int id = entry.getKey();
- final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
if (remainingTime > 0)
{
hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
index 5fffc77ae3..8c3faede2d 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -233,7 +234,7 @@ public class AdminPunishment implements IAdminCommandHandler
long expirationTime = Integer.parseInt(exp);
if (expirationTime > 0)
{
- expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
+ expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
}
final PunishmentAffect affect = PunishmentAffect.getByName(af);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
index aa1d6dd435..ae1bb4e0b2 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -60,7 +61,7 @@ public class AdminServerInfo implements IAdminCommandHandler
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
- html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
+ html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
html.replace("%serverUpTime%", getServerUpTime());
html.replace("%onlineAll%", getPlayersCount("ALL"));
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
@@ -76,7 +77,7 @@ public class AdminServerInfo implements IAdminCommandHandler
private String getServerUpTime()
{
- long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
+ long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
final long days = TimeUnit.MILLISECONDS.toDays(time);
time -= TimeUnit.DAYS.toMillis(days);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
index ff3b82a10f..21489c89f6 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IBypassHandler;
@@ -133,7 +134,7 @@ public class FindPvP implements IBypassHandler
player.setSpawnProtection(true);
if (!player.isGM())
{
- player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
player.startPvPFlag();
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
index a81161c50a..adb3c27701 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.dailymissionhandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -61,9 +62,9 @@ public class LoginMonthDailyMissionHandler extends AbstractDailyMissionHandler
final long lastCompleted = entry.getLastCompleted();
if (lastCompleted == 0) // Initial entry.
{
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
}
- else if ((System.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
+ else if ((Chronos.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
index 9fee9dd50e..0322107487 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
@@ -18,6 +18,7 @@ package handlers.dailymissionhandlers;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -63,7 +64,7 @@ public class LoginWeekendDailyMissionHandler extends AbstractDailyMissionHandler
final int currentDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
final long lastCompleted = entry.getLastCompleted();
if (((currentDay == Calendar.SATURDAY) || (currentDay == Calendar.SUNDAY)) // Reward only on weekend.
- && ((lastCompleted == 0) || ((System.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
+ && ((lastCompleted == 0) || ((Chronos.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
index 71928b144a..c2ea6f7a5a 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.punishmenthandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.model.World;
@@ -126,7 +127,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
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 245af11bfa..2abbe8e8e8 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
@@ -17,6 +17,7 @@
package handlers.punishmenthandlers;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
@@ -180,7 +181,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
index 3dd1cdc97d..fd92c92ed9 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Ban implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
index f653561c0d..85b92a163b 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class BanChat implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
index cf3736fc0e..c21718ad0c 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Jail implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
index 43b6df41dc..a57194664d 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
@@ -18,6 +18,7 @@ package handlers.usercommandhandlers;
import java.text.SimpleDateFormat;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -46,7 +47,7 @@ public class ClanPenalty implements IUserCommandHandler
final StringBuilder htmlContent = new StringBuilder(500);
htmlContent.append("");
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append("Unable to join a clan. | ");
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
@@ -54,7 +55,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append(" | Unable to create a clan. | ");
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
@@ -62,7 +63,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
+ if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
{
htmlContent.append(" | Unable to invite a clan member. | ");
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/usercommandhandlers/Time.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
index 530047a4f2..57bd48cd81 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Time implements IUserCommandHandler
player.sendPacket(sm);
if (Config.DISPLAY_SERVER_TIME)
{
- player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
+ player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
}
return true;
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
index a2eab150c7..f727b3518f 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
@@ -18,6 +18,7 @@ package handlers.voicedcommandhandlers;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
@@ -103,7 +104,7 @@ public class ChatAdmin implements IVoicedCommandHandler
return false;
}
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
if (expirationTime > 0)
{
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
index 213e03e20a..5bf36c47d0 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
@@ -19,6 +19,7 @@ package handlers.voicedcommandhandlers;
import java.text.SimpleDateFormat;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Premium implements IVoicedCommandHandler
html.append(" |
Spoil Chance: x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " |
");
html.append("Spoil Amount: x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " |
");
html.append("Expires: " + format.format(endDate) + " |
");
- html.append("Current Date: " + format.format(System.currentTimeMillis()) + "
|
");
+ html.append("Current Date: " + format.format(Chronos.currentTimeMillis()) + "
|
");
html.append("Premium Info & Rules
|
");
html.append("1. Premium accounts CAN NOT BE TRANSFERED. |
");
html.append("2. Premium does not effect party members. |
");
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 4dedee6473..6a07191990 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
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -156,7 +157,7 @@ public class CastleDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -174,7 +175,7 @@ public class CastleDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
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 686b01379b..ea8ca11b83 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
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -169,7 +170,7 @@ public class FortressDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -197,7 +198,7 @@ public class FortressDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
index 298c540332..cba8d2bb56 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
@@ -469,7 +470,7 @@ public class Kamaloka extends AbstractInstance
continue;
}
// if found instance still can't be reentered - exit
- if (System.currentTimeMillis() < entry.getValue().longValue())
+ if (Chronos.currentTimeMillis() < entry.getValue().longValue())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
sm.addPcName(partyMember);
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
index b3de2f227a..31fa72d28c 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
@@ -260,7 +261,7 @@ public class PailakaRuneCastle extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first wave
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
}
@@ -280,7 +281,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
@@ -309,7 +310,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00307_ControlDeviceOfTheGiants/Q00307_ControlDeviceOfTheGiants.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00307_ControlDeviceOfTheGiants/Q00307_ControlDeviceOfTheGiants.java
index 36b940fad1..19dedba42e 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00307_ControlDeviceOfTheGiants/Q00307_ControlDeviceOfTheGiants.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00307_ControlDeviceOfTheGiants/Q00307_ControlDeviceOfTheGiants.java
@@ -16,6 +16,7 @@
*/
package quests.Q00307_ControlDeviceOfTheGiants;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -101,7 +102,7 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
{
return "32711-09.html";
}
- if ((GlobalVariablesManager.getInstance().getLong("GiantsControlDeviceRespawn", 0) - System.currentTimeMillis()) > 0)
+ if ((GlobalVariablesManager.getInstance().getLong("GiantsControlDeviceRespawn", 0) - Chronos.currentTimeMillis()) > 0)
{
return "32711-09a.html";
}
@@ -168,7 +169,7 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
qst.setCond(2, true);
}
}
- GlobalVariablesManager.getInstance().set("GiantsControlDeviceRespawn", Long.toString(System.currentTimeMillis() + RESPAWN_DELAY));
+ GlobalVariablesManager.getInstance().set("GiantsControlDeviceRespawn", Long.toString(Chronos.currentTimeMillis() + RESPAWN_DELAY));
}
break;
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/Chronos.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/Chronos.java
new file mode 100644
index 0000000000..a4d15f77e5
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/Chronos.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2021 Pantelis Andrianakis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.l2jmobius.commons.util;
+
+/**
+ * Chronos updates an internal long value with System.currentTimeMillis() approximately every 1 millisecond.
+ * To get the current time in milliseconds use Chronos.currentTimeMillis()
+ * @author Pantelis Andrianakis
+ * @version February 3rd 2021
+ */
+public class Chronos extends Thread
+{
+ private long _currentTimeMillis = System.currentTimeMillis();
+
+ public Chronos()
+ {
+ super.setName("Chronos");
+ super.setPriority(MAX_PRIORITY);
+ super.setDaemon(true);
+ super.start();
+ }
+
+ @Override
+ public void run()
+ {
+ while (true)
+ {
+ _currentTimeMillis = System.currentTimeMillis();
+
+ // Sleep for approximately 1 millisecond.
+ try
+ {
+ Thread.sleep(1);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /**
+ * Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond,the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
+ *
+ * See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).
+ * @return the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+ */
+ public static long currentTimeMillis()
+ {
+ return getInstance()._currentTimeMillis;
+ }
+
+ public static Chronos getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final Chronos INSTANCE = new Chronos();
+ }
+}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/GameServer.java
index 85652fbcbf..6e6044e866 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/GameServer.java
@@ -32,6 +32,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.enums.ServerMode;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.DeadLockDetector;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.BotReportTable;
@@ -180,7 +181,7 @@ public class GameServer
public GameServer() throws Exception
{
- final long serverLoadStart = System.currentTimeMillis();
+ final long serverLoadStart = Chronos.currentTimeMillis();
// GUI
if (!GraphicsEnvironment.isHeadless())
@@ -461,7 +462,7 @@ public class GameServer
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
- LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
+ LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
ClientNetworkManager.getInstance().start();
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/GameTimeController.java
index aa4d359090..48391b466d 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/GameTimeController.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange;
@@ -97,7 +98,7 @@ public class GameTimeController extends Thread
*/
public int getGameTicks()
{
- return (int) ((System.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
+ return (int) ((Chronos.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
}
/**
@@ -155,7 +156,7 @@ public class GameTimeController extends Thread
while (true)
{
- nextTickTime = ((System.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
+ nextTickTime = ((Chronos.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
try
{
@@ -166,7 +167,7 @@ public class GameTimeController extends Thread
LOGGER.log(Level.WARNING, getClass().getSimpleName(), e);
}
- sleepTime = nextTickTime - System.currentTimeMillis();
+ sleepTime = nextTickTime - Chronos.currentTimeMillis();
if (sleepTime > 0)
{
try
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
index 2fcae24603..cfb16ebb07 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -42,7 +43,7 @@ public class ItemsAutoDestroy
public synchronized void addItem(ItemInstance item)
{
- item.setDropTime(System.currentTimeMillis());
+ item.setDropTime(Chronos.currentTimeMillis());
_items.add(item);
}
@@ -53,7 +54,7 @@ public class ItemsAutoDestroy
return;
}
- final long curtime = System.currentTimeMillis();
+ final long curtime = Chronos.currentTimeMillis();
final Iterator itemIterator = _items.iterator();
while (itemIterator.hasNext())
{
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/Shutdown.java
index 5279bac36d..d7328247aa 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/Shutdown.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseBackup;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
@@ -529,19 +530,19 @@ public class Shutdown extends Thread
protected void restartCounter()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
}
protected long getEstimatedTimeAndRestartCounter()
{
- final long toReturn = System.currentTimeMillis() - _startTime;
+ final long toReturn = Chronos.currentTimeMillis() - _startTime;
restartCounter();
return toReturn;
}
protected long getEstimatedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/CreatureAI.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/CreatureAI.java
index 22de59f51a..e03e0463be 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/CreatureAI.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/CreatureAI.java
@@ -33,6 +33,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -308,7 +309,7 @@ public class CreatureAI extends AbstractAI
if (_actor.isAttackingNow())
{
- ThreadPool.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(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index fa5cca3384..26734231aa 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -39,7 +40,7 @@ public class WarehouseCacheManager
public void addCacheTask(PlayerInstance pc)
{
- CACHED_WH.put(pc, System.currentTimeMillis());
+ CACHED_WH.put(pc, Chronos.currentTimeMillis());
}
public void remCacheTask(PlayerInstance pc)
@@ -56,7 +57,7 @@ public class WarehouseCacheManager
@Override
public void run()
{
- final long cTime = System.currentTimeMillis();
+ final long cTime = Chronos.currentTimeMillis();
for (Entry entry : CACHED_WH.entrySet())
{
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/BotReportTable.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/BotReportTable.java
index 2dd2c9abf7..6c7daf4120 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/BotReportTable.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/BotReportTable.java
@@ -39,6 +39,7 @@ import org.xml.sax.helpers.DefaultHandler;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -124,7 +125,7 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() < c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() < c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
}
@@ -290,7 +291,7 @@ public class BotReportTable
return false;
}
- final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
+ final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
@@ -301,7 +302,7 @@ public class BotReportTable
}
}
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
if (rcd == null)
{
rcd = new ReportedCharData();
@@ -418,12 +419,12 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() > c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() > c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
}
- ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
+ ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - Chronos.currentTimeMillis());
}
catch (Exception e)
{
@@ -464,7 +465,7 @@ public class BotReportTable
{
if (map.containsKey(objectId))
{
- return (System.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
+ return (Chronos.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
}
return true;
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/sql/ClanTable.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
index b3cb0d7e2d..3ebc968ea1 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.enums.ClanWarState;
@@ -170,7 +171,7 @@ public class ClanTable
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
return null;
}
- if (System.currentTimeMillis() < player.getClanCreateExpiryTime())
+ if (Chronos.currentTimeMillis() < player.getClanCreateExpiryTime())
{
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
return null;
@@ -342,7 +343,7 @@ public class ClanTable
{
destroyClan(clanId);
}
- }, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
+ }, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
}
public boolean isAllyExists(String allyName)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index a0110c454b..3d8844ae9f 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem;
@@ -183,7 +184,7 @@ public class OfflineTraderTable
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- if (cal.getTimeInMillis() <= System.currentTimeMillis())
+ if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
{
continue;
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
index 1673fb1298..22f94dd7e9 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
import org.l2jmobius.gameserver.model.DailyMissionPlayerEntry;
@@ -101,7 +102,7 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
final DailyMissionPlayerEntry entry = getPlayerEntry(player.getObjectId(), true);
entry.setStatus(DailyMissionStatus.COMPLETED);
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
storePlayerEntry(entry);
return true;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
index 025c3208e6..ecb5b8dc95 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.enums.PlayerAction;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -115,7 +116,7 @@ public class AdminCommandHandler implements IHandler
{
- final long begin = System.currentTimeMillis();
+ final long begin = Chronos.currentTimeMillis();
try
{
if (Config.GMAUDIT)
@@ -133,7 +134,7 @@ public class AdminCommandHandler implements IHandler 5000)
{
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
index fedf7cd9dc..ee7642eca5 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -48,7 +49,7 @@ public class AntiFeedManager
*/
public void setLastDeathTime(int objectId)
{
- _lastDeathTimes.put(objectId, System.currentTimeMillis());
+ _lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
}
/**
@@ -81,7 +82,7 @@ public class AntiFeedManager
return false;
}
- if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
+ if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((Chronos.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
{
return false;
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index 3d8c1f50e4..301806d976 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ManorMode;
@@ -276,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
- ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
+ ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
}
public void changeMode()
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
index 4a91b5c214..64143c7c65 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.model.CursedWeapon;
import org.l2jmobius.gameserver.model.actor.Attackable;
@@ -313,7 +314,7 @@ public class CursedWeaponsManager implements IXmlReader
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING);
sm.addString(cw.getName());
// sm.addItemName(cw.getItemId());
- sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
+ sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
player.sendPacket(sm);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index 72602e0968..babf2e1476 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -193,7 +194,7 @@ public class DBSpawnManager
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
- final long respawnTime = System.currentTimeMillis() + respawnDelay;
+ final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
info.set("currentHP", npc.getMaxHp());
info.set("currentMP", npc.getMaxMp());
info.set("respawnTime", respawnTime);
@@ -235,7 +236,7 @@ public class DBSpawnManager
}
final int npcId = spawn.getId();
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SpawnTable.getInstance().addNewSpawn(spawn, false);
if ((respawnTime == 0) || (time > respawnTime))
{
@@ -257,7 +258,7 @@ public class DBSpawnManager
}
else
{
- final long spawnTime = respawnTime - System.currentTimeMillis();
+ final long spawnTime = respawnTime - Chronos.currentTimeMillis();
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index 60a818cab6..06cce0d3a3 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -21,6 +21,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -104,7 +105,7 @@ public class GraciaSeedsManager
case 2:
{
// Conquest Complete state, if too much time is passed than change to defense state
- final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
+ final long timePast = Chronos.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
if (timePast >= Config.SOD_STAGE_2_LENGTH)
{
// change to Attack state because Defend statet is not implemented
@@ -172,7 +173,7 @@ public class GraciaSeedsManager
public void setSoDState(int value, boolean doSave)
{
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
- _SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
+ _SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
_SoDState = value;
// reset number of Tiat kills
if (_SoDState == 1)
@@ -198,7 +199,7 @@ public class GraciaSeedsManager
}
case 2:
{
- return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
+ return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
}
case 3:
{
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index d595a5befa..052f8984d2 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.util.PrimeFinder;
/**
@@ -85,7 +86,7 @@ public class IdManager
try (Connection con = DatabaseFactory.getConnection();
Statement statement = con.createStatement())
{
- final long cleanupStart = System.currentTimeMillis();
+ final long cleanupStart = Chronos.currentTimeMillis();
int cleanCount = 0;
// Characters
@@ -157,7 +158,7 @@ public class IdManager
statement.executeUpdate("UPDATE characters SET clanid=0, clan_privs=0, wantspeace=0, subpledge=0, lvl_joined_academy=0, apprentice=0, sponsor=0, clan_join_expiry_time=0, clan_create_expiry_time=0 WHERE characters.clanid > 0 AND characters.clanid NOT IN (SELECT clan_id FROM clan_data);");
statement.executeUpdate("UPDATE fort SET owner=0 WHERE owner NOT IN (SELECT clan_id FROM clan_data);");
- LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((System.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
+ LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((Chronos.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
}
catch (Exception e)
{
@@ -173,7 +174,7 @@ public class IdManager
{
try (PreparedStatement statement = con.prepareStatement(line))
{
- statement.setLong(1, System.currentTimeMillis());
+ statement.setLong(1, Chronos.currentTimeMillis());
cleanCount += statement.executeUpdate();
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
index d47e436ace..d1f8cd35e2 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
@@ -40,6 +40,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.data.xml.SpawnData;
@@ -521,7 +522,7 @@ public class InstanceManager implements IXmlReader
{
// Check if instance penalty passed
final long time = rs.getLong("time");
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
// Load params
final int charId = rs.getInt("charId");
@@ -556,7 +557,7 @@ public class InstanceManager implements IXmlReader
final List invalidPenalty = new ArrayList<>(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- if (entry.getValue() <= System.currentTimeMillis())
+ if (entry.getValue() <= Chronos.currentTimeMillis())
{
invalidPenalty.add(entry.getKey());
}
@@ -615,7 +616,7 @@ public class InstanceManager implements IXmlReader
// If reenter time is higher then current, delete it
final long time = playerData.get(id);
- if (time <= System.currentTimeMillis())
+ if (time <= Chronos.currentTimeMillis())
{
deleteInstanceTime(player, id);
return -1;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 739f67e9a9..dfb4734ca5 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -83,7 +84,7 @@ public class ItemsOnGroundManager implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(str))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.execute();
}
catch (Exception e)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
index df45860d40..d429a2f8c9 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Mentee;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -145,7 +146,7 @@ public class MentorManager
{
final PlayerInstance player = World.getInstance().getPlayer(mentorId);
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
- vars.set("Mentor-Penalty-" + mentorId, String.valueOf(System.currentTimeMillis() + penalty));
+ vars.set("Mentor-Penalty-" + mentorId, String.valueOf(Chronos.currentTimeMillis() + penalty));
}
public long getMentorPenalty(int mentorId)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 7768cebd95..ba4e95fe3f 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.Containers;
@@ -79,7 +80,7 @@ public class PremiumManager
final PlayerInstance player = event.getPlayer();
final String accountName = player.getAccountName();
loadPremiumData(accountName);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
final long premiumExpiration = getPremiumExpiration(accountName);
player.setPremiumStatus(premiumExpiration > now);
if (player.hasPremiumStatus())
@@ -153,7 +154,7 @@ public class PremiumManager
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
{
final long addTime = timeUnit.toMillis(timeValue);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
// new premium task at least from now
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
final long newPremiumExpiration = oldPremiumExpiration + addTime;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
index 9617f26e43..08193f9c5b 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
@@ -71,7 +72,7 @@ public class PunishmentManager
final String punishedBy = rset.getString("punishedBy");
if ((type != null) && (affect != null))
{
- if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
+ if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
{
expired++;
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
index 687d1288b9..ab73056bb1 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -424,7 +425,7 @@ public class BlockChecker
// Start up player parameters
setUpPlayers();
// Set the started time
- _startedTime = System.currentTimeMillis() + 300000;
+ _startedTime = Chronos.currentTimeMillis() + 300000;
}
}
@@ -524,7 +525,7 @@ public class BlockChecker
_redPoints += _numOfBoxes / 2;
_bluePoints += _numOfBoxes / 2;
- final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((_startedTime - Chronos.currentTimeMillis()) / 1000);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
_holder.broadCastPacketToTeam(changePoints);
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/CursedWeapon.java
index 07e4d9b6d6..cf80e1b21a 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/CursedWeapon.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
@@ -237,7 +238,7 @@ public class CursedWeapon implements INamable
@Override
public void run()
{
- if (System.currentTimeMillis() >= _endTime)
+ if (Chronos.currentTimeMillis() >= _endTime)
{
endOfLife();
}
@@ -366,7 +367,7 @@ public class CursedWeapon implements INamable
public void reActivate()
{
_isActivated = true;
- if ((_endTime - System.currentTimeMillis()) <= 0)
+ if ((_endTime - Chronos.currentTimeMillis()) <= 0)
{
endOfLife();
}
@@ -384,7 +385,7 @@ public class CursedWeapon implements INamable
dropIt(attackable, player);
// Start the Life Task
- _endTime = System.currentTimeMillis() + (_duration * 60000);
+ _endTime = Chronos.currentTimeMillis() + (_duration * 60000);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
return true;
}
@@ -678,7 +679,7 @@ public class CursedWeapon implements INamable
public long getTimeLeft()
{
- return _endTime - System.currentTimeMillis();
+ return _endTime - Chronos.currentTimeMillis();
}
public void goTo(PlayerInstance player)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/ItemInfo.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/ItemInfo.java
index 9ea4c13763..16f3dfe23e 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/ItemInfo.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/ItemInfo.java
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.model.buylist.Product;
import org.l2jmobius.gameserver.model.ensoul.EnsoulOption;
@@ -151,14 +152,14 @@ public class ItemInfo
_soulCrystalOptions = item.getSpecialAbilities();
_soulCrystalSpecialOptions = item.getAdditionalSpecialAbilities();
_visualId = item.getVisualId();
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(ItemInstance item, int change)
{
this(item);
_change = change;
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(TradeItem item)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Message.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Message.java
index e6b1c31d32..53d2f20768 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Message.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Message.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.enums.MailType;
@@ -104,7 +105,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = text;
- _expiration = (isCod ? System.currentTimeMillis() + (COD_EXPIRATION * 3600000) : System.currentTimeMillis() + (EXPIRATION * 3600000));
+ _expiration = (isCod ? Chronos.currentTimeMillis() + (COD_EXPIRATION * 3600000) : Chronos.currentTimeMillis() + (EXPIRATION * 3600000));
_hasAttachments = false;
_unread = true;
_deletedBySender = false;
@@ -123,7 +124,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_reqAdena = 0;
_hasAttachments = false;
_unread = true;
@@ -143,7 +144,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_hasAttachments = false;
_unread = true;
_deletedBySender = true;
@@ -162,7 +163,7 @@ public class Message
_receiverId = msg.getSenderId();
_subject = "";
_content = "";
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_deletedByReceiver = false;
@@ -182,7 +183,7 @@ public class Message
_receiverId = receiverId;
_subject = "";
_content = item.getName();
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_messageType = mailType;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Petition.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Petition.java
index b19b6f9025..d3f95461ac 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Petition.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Petition.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PetitionState;
import org.l2jmobius.gameserver.enums.PetitionType;
import org.l2jmobius.gameserver.instancemanager.IdManager;
@@ -36,7 +37,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class Petition
{
- private final long _submitTime = System.currentTimeMillis();
+ private final long _submitTime = Chronos.currentTimeMillis();
private final int _id;
private final PetitionType _type;
private PetitionState _state = PetitionState.PENDING;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Spawn.java
index 4a1a2926b3..eb57e4e69b 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -258,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
_scheduledCount++;
// Schedule the next respawn.
- RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
+ RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/TimeStamp.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/TimeStamp.java
index 8c232969e0..9bdb39d293 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/TimeStamp.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/TimeStamp.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -52,7 +53,7 @@ public class TimeStamp
_id2 = skill.getLevel();
_id3 = skill.getSubLevel();
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = -1;
}
@@ -68,7 +69,7 @@ public class TimeStamp
_id2 = item.getObjectId();
_id3 = 0;
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = item.getSharedReuseGroup();
}
@@ -155,7 +156,7 @@ public class TimeStamp
{
return 0;
}
- final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
+ final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
if (remainingTime == 0)
{
_stamp = 0;
@@ -173,7 +174,7 @@ public class TimeStamp
{
return false;
}
- final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
+ final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
if (!hasNotPassed)
{
_stamp = 0;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java
index 0410084704..e39ed646e7 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.AttackableAI;
import org.l2jmobius.gameserver.ai.CreatureAI;
@@ -216,7 +217,7 @@ public class Attackable extends Npc
if (_firstCommandChannelAttacked != null)
{
_commandChannelTimer = new CommandChannelTimer(this);
- _commandChannelLastAttack = System.currentTimeMillis();
+ _commandChannelLastAttack = Chronos.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
@@ -225,7 +226,7 @@ public class Attackable extends Npc
}
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
{
- _commandChannelLastAttack = System.currentTimeMillis(); // update last attack time
+ _commandChannelLastAttack = Chronos.currentTimeMillis(); // update last attack time
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java
index ac5089ff54..20863bbf93 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -41,6 +41,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.EmptyQueue;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -1393,7 +1394,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : _reuseTimeStampsItems.values())
{
if (ts.getSharedReuseGroup() == group)
@@ -1523,7 +1524,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return;
}
- _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? System.currentTimeMillis() + delay : Long.MAX_VALUE);
+ _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? Chronos.currentTimeMillis() + delay : Long.MAX_VALUE);
}
/**
@@ -1571,7 +1572,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return false;
}
- if (stamp < System.currentTimeMillis())
+ if (stamp < Chronos.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java
index 62f1d1049f..d288fe8816 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -203,7 +204,7 @@ public class Npc extends Creature
public void onRandomAnimation(int animationId)
{
// Send a packet SocialAction to all PlayerInstance in the _KnownPlayers of the NpcInstance
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
{
_lastSocialBroadcast = now;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
index 7eacda4aa1..c87a2006a9 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.actor.instance;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
@@ -141,7 +142,7 @@ public class BlockInstance extends MonsterInstance
{
eng.increasePlayerPoints(player, team);
- final int timeLeft = (int) ((eng.getStarterTime() - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((eng.getStarterTime() - Chronos.currentTimeMillis()) / 1000);
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints());
final ExCubeGameExtendedChangePoints secretPoints = new ExCubeGameExtendedChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints(), isRed, player, eng.getPlayerPoints(player, isRed));
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 05682537d8..3f3cbea575 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -46,6 +46,7 @@ import java.util.stream.Collectors;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -2838,7 +2839,7 @@ public class PlayerInstance extends Playable
public void setOnlineTime(long time)
{
_onlineTime = time;
- _onlineBeginTime = System.currentTimeMillis();
+ _onlineBeginTime = Chronos.currentTimeMillis();
}
/**
@@ -3897,22 +3898,22 @@ public class PlayerInstance extends Playable
public boolean isSpawnProtected()
{
- return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
+ return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
}
public boolean isTeleportProtected()
{
- return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
+ return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
}
public void setSpawnProtection(boolean protect)
{
- _spawnProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
+ _spawnProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
}
public void setTeleportProtection(boolean protect)
{
- _teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
+ _teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
}
/**
@@ -5237,7 +5238,7 @@ public class PlayerInstance extends Playable
{
return;
}
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
if (_pvpFlag == 0)
{
startPvPFlag();
@@ -5270,11 +5271,11 @@ public class PlayerInstance extends Playable
{
if (checkIfPvP(targetPlayer))
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
}
else
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
}
if (_pvpFlag == 0)
{
@@ -6152,7 +6153,7 @@ public class PlayerInstance extends Playable
public long getUptime()
{
- return System.currentTimeMillis() - _uptime;
+ return Chronos.currentTimeMillis() - _uptime;
}
/**
@@ -6396,7 +6397,7 @@ public class PlayerInstance extends Playable
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
{
statement.setInt(1, isOnlineInt());
- statement.setLong(2, System.currentTimeMillis());
+ statement.setLong(2, Chronos.currentTimeMillis());
statement.setInt(3, getObjectId());
statement.execute();
}
@@ -6522,12 +6523,12 @@ public class PlayerInstance extends Playable
}
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
- if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanJoinExpiryTime(0);
}
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
- if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanCreateExpiryTime(0);
}
@@ -6589,7 +6590,7 @@ public class PlayerInstance extends Playable
player.getAppearance().setTitleColor(titleColor);
}
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
- player.setUptime(System.currentTimeMillis());
+ player.setUptime(Chronos.currentTimeMillis());
currentHp = rset.getDouble("curHp");
currentCp = rset.getDouble("curCp");
@@ -7106,7 +7107,7 @@ public class PlayerInstance extends Playable
long totalOnlineTime = _onlineTime;
if (_onlineBeginTime > 0)
{
- totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
+ totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
}
statement.setLong(34, totalOnlineTime);
@@ -7192,7 +7193,7 @@ public class PlayerInstance extends Playable
int buffIndex = 0;
final List storedSkills = new ArrayList<>();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
// Store all effect data along with calulated remaining
// reuse delays for matching skills. 'restore_type'= 0.
@@ -7307,7 +7308,7 @@ public class PlayerInstance extends Playable
ps1.setInt(1, getObjectId());
ps1.execute();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : getItemReuseTimeStamps().values())
{
if ((ts != null) && (currentTime < ts.getStamp()))
@@ -7630,7 +7631,7 @@ public class PlayerInstance extends Playable
statement.setInt(2, _classIndex);
try (ResultSet rset = statement.executeQuery())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
final int remainingTime = rset.getInt("remaining_time");
@@ -7692,7 +7693,7 @@ public class PlayerInstance extends Playable
long systime;
boolean isInInventory;
long remainingTime;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
itemId = rset.getInt("itemId");
@@ -7767,7 +7768,7 @@ public class PlayerInstance extends Playable
{
int slot;
int symbolId;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
slot = rset.getInt("slot");
@@ -7890,7 +7891,7 @@ public class PlayerInstance extends Playable
// Send Server->Client UserInfo packet to this PlayerInstance
broadcastUserInfo(UserInfoType.BASE_STATS, UserInfoType.MAX_HPCPMP, UserInfoType.STATS, UserInfoType.SPEED);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long timeLeft = getVariables().getLong("HennaDuration" + slot, currentTime) - currentTime;
if ((henna.getDuration() < 0) || (timeLeft > 0))
{
@@ -7981,7 +7982,7 @@ public class PlayerInstance extends Playable
// Task for henna duration
if (henna.getDuration() > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
@@ -12443,7 +12444,7 @@ public class PlayerInstance extends Playable
public int getBirthdays()
{
- long time = (System.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
+ long time = (Chronos.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
time /= TimeUnit.DAYS.toMillis(365);
return (int) time;
}
@@ -12684,7 +12685,7 @@ public class PlayerInstance extends Playable
return false;
}
- if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
+ if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@@ -12744,7 +12745,7 @@ public class PlayerInstance extends Playable
*/
public void setFalling()
{
- _fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
+ _fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
}
/**
@@ -12765,7 +12766,7 @@ public class PlayerInstance extends Playable
*/
public void updateLastItemAuctionRequest()
{
- _lastItemAuctionInfoRequest = System.currentTimeMillis();
+ _lastItemAuctionInfoRequest = Chronos.currentTimeMillis();
}
/**
@@ -12774,7 +12775,7 @@ public class PlayerInstance extends Playable
*/
public boolean isItemAuctionPolling()
{
- return (System.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
+ return (Chronos.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
}
@Override
@@ -13157,7 +13158,7 @@ public class PlayerInstance extends Playable
public void updateNotMoveUntil()
{
- _notMoveUntil = System.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
+ _notMoveUntil = Chronos.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
}
@Override
@@ -14151,7 +14152,7 @@ public class PlayerInstance extends Playable
public boolean isInTraingCamp()
{
final TrainingHolder trainingHolder = getTraingCampInfo();
- return (trainingHolder != null) && (trainingHolder.getEndTime() > System.currentTimeMillis());
+ return (trainingHolder != null) && (trainingHolder.getEndTime() > Chronos.currentTimeMillis());
}
public AttendanceInfoHolder getAttendanceInfo()
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
index 7d586645f8..a667254408 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
@@ -22,6 +22,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.AcquireSkillType;
@@ -35,9 +36,9 @@ import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.Clan.SubPledge;
+import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.siege.Castle;
import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -338,13 +339,13 @@ public class VillageMasterInstance extends NpcInstance
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
return;
}
- clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setDissolvingExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
// The clan leader should take the XP penalty of a full death.
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 843165d245..18d77105c7 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.attackable;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
/**
@@ -40,7 +41,7 @@ public class CommandChannelTimer implements Runnable
return;
}
- if ((System.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
+ if ((Chronos.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
{
_attackable.setCommandChannelTimer(null);
_attackable.setFirstCommandChannelAttacked(null);
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
index e2130407ac..290e49a99f 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.player;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -92,12 +93,12 @@ public class IllegalPlayerActionTask implements Runnable
}
case KICKBAN:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
case JAIL:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/buylist/Product.java
index 0782846eba..3fc18a73e3 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/buylist/Product.java
@@ -25,6 +25,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.type.EtcItemType;
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
@@ -134,7 +135,7 @@ public class Product
public void restartRestockTask(long nextRestockTime)
{
- final long remainTime = nextRestockTime - System.currentTimeMillis();
+ final long remainTime = nextRestockTime - Chronos.currentTimeMillis();
if (remainTime > 0)
{
BuyListTaskManager.getInstance().update(this, remainTime);
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
index 1ccabadff3..1355481e68 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
import org.l2jmobius.gameserver.enums.QuestSound;
@@ -278,7 +279,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
});
}
}
- _battleStartTime = System.currentTimeMillis();
+ _battleStartTime = Chronos.currentTimeMillis();
getTimers().addRepeatingTimer("update", 1000, null, null);
}
@@ -505,7 +506,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
private void updateLifeTime(CeremonyOfChaosMember member)
{
- member.setLifeTime(((int) (System.currentTimeMillis() - _battleStartTime) / 1000));
+ member.setLifeTime(((int) (Chronos.currentTimeMillis() - _battleStartTime) / 1000));
}
public List getWinners()
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/clan/Clan.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/clan/Clan.java
index 7df3de05ce..d76dcec76f 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/clan/Clan.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/clan/Clan.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -498,7 +499,7 @@ public class Clan implements IIdentifiable, INamable
if (player.isClanLeader())
{
SiegeManager.getInstance().removeSiegeSkills(player);
- player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ player.setClanCreateExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
}
// remove Clan skills from Player
@@ -531,7 +532,7 @@ public class Clan implements IIdentifiable, INamable
}
else
{
- removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
+ removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
}
// Notify to scripts
@@ -1091,12 +1092,12 @@ public class Clan implements IIdentifiable, INamable
setAllyId(clanData.getInt("ally_id"));
setAllyName(clanData.getString("ally_name"));
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
- if (_allyPenaltyExpiryTime < System.currentTimeMillis())
+ if (_allyPenaltyExpiryTime < Chronos.currentTimeMillis())
{
setAllyPenaltyExpiryTime(0, 0);
}
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
- if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
+ if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < Chronos.currentTimeMillis()) // 24*60*60*1000 = 86400000
{
setCharPenaltyExpiryTime(0);
}
@@ -2207,7 +2208,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
return false;
}
- if (_charPenaltyExpiryTime > System.currentTimeMillis())
+ if (_charPenaltyExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return false;
@@ -2219,7 +2220,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (target.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (target.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(target.getName());
@@ -2268,7 +2269,7 @@ public class Clan implements IIdentifiable, INamable
return false;
}
final Clan leaderClan = player.getClan();
- if (leaderClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (leaderClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN)
{
@@ -2307,7 +2308,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
{
@@ -2401,12 +2402,12 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
return;
}
- if ((_allyPenaltyExpiryTime > System.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
+ if ((_allyPenaltyExpiryTime > Chronos.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
return;
}
- if (_dissolvingExpiryTime > System.currentTimeMillis())
+ if (_dissolvingExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
return;
@@ -2458,7 +2459,7 @@ public class Clan implements IIdentifiable, INamable
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
{
if (clan.getId() != getId())
@@ -2484,7 +2485,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
return false;
}
- if (System.currentTimeMillis() < _dissolvingExpiryTime)
+ if (Chronos.currentTimeMillis() < _dissolvingExpiryTime)
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
return false;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/clan/ClanWar.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
index 22b82ab179..ebb01d6c06 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -54,9 +55,9 @@ public class ClanWar
{
_attackerClanId = attacker.getId();
_attackedClanId = attacked.getId();
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_state = ClanWarState.BLOOD_DECLARATION;
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
attacker.addWar(attacked.getId(), this);
attacked.addWar(attacker.getId(), this);
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
@@ -79,15 +80,15 @@ public class ClanWar
_attackerKillCount.set(attackerKillCount);
_attackedKillCount.set(attackedKillCount);
_winnerClanId = winnerClan;
- if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > System.currentTimeMillis())
+ if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > Chronos.currentTimeMillis())
{
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
}
if (_endTime > 0)
{
final long endTimePeriod = _endTime + (_state == ClanWarState.TIE ? TIME_TO_DELETION_AFTER_CANCELLATION : TIME_TO_DELETION_AFTER_DEFEAT);
- if (endTimePeriod > System.currentTimeMillis())
+ if (endTimePeriod > Chronos.currentTimeMillis())
{
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(_attackerClanId, _attackedClanId), 10000);
}
@@ -177,8 +178,8 @@ public class ClanWar
winnerClan.broadcastToOnlineMembers(sm);
_winnerClanId = winnerClan.getId();
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - Chronos.currentTimeMillis());
}
public void clanWarTimeout()
@@ -196,8 +197,8 @@ public class ClanWar
attackerClan.broadcastToOnlineMembers(sm);
_state = ClanWarState.TIE;
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - Chronos.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index f150ec3238..b1b3a83fd1 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.StatSet;
import it.sauronsoftware.cron4j.PastPredictor;
@@ -112,7 +113,7 @@ public class EventScheduler
final Predictor predictor = new Predictor(_pattern);
final long nextSchedule = predictor.nextMatchingTime();
- final long timeSchedule = nextSchedule - System.currentTimeMillis();
+ final long timeSchedule = nextSchedule - Chronos.currentTimeMillis();
if (timeSchedule <= (30 * 1000))
{
LOGGER.warning("Wrong reschedule for " + _eventManager.getClass().getSimpleName() + " end up run in " + (timeSchedule / 1000) + " seconds!");
@@ -144,10 +145,10 @@ public class EventScheduler
{
ps.setString(1, _eventManager.getName());
ps.setString(2, _name);
- ps.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(3, new Timestamp(Chronos.currentTimeMillis()));
ps.setString(4, _eventManager.getName());
ps.setString(5, _name);
- ps.setTimestamp(6, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(6, new Timestamp(Chronos.currentTimeMillis()));
ps.execute();
return true;
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/events/EventType.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/events/EventType.java
index aa64ab0744..eebca64a89 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/events/EventType.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/events/EventType.java
@@ -76,7 +76,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
@@ -84,8 +83,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaR
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemAdd;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDestroy;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDrop;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemTransfer;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
@@ -114,7 +115,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
index 77e7205bfa..6139454534 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -85,7 +86,7 @@ public class TrainingHolder implements Serializable
public long getElapsedTime()
{
- return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
+ return TimeUnit.SECONDS.convert(Chronos.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
index 6c9ca907b7..62649739ea 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -39,6 +39,7 @@ import java.util.stream.Stream;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -105,7 +106,7 @@ public class Instance implements IIdentifiable, INamable
// Set basic instance info
_id = id;
_template = template;
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_spawns = new ArrayList<>(template.getSpawns().size());
// Clone and add the spawn templates
@@ -755,7 +756,7 @@ public class Instance implements IIdentifiable, INamable
}
// Set new cleanup task
- _endTime = System.currentTimeMillis() + millis;
+ _endTime = Chronos.currentTimeMillis() + millis;
if (minutes < 1) // Destroy instance
{
destroy();
@@ -858,7 +859,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getElapsedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
/**
@@ -867,7 +868,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getRemainingTime()
{
- return (_endTime == -1) ? -1 : (_endTime - System.currentTimeMillis());
+ return (_endTime == -1) ? -1 : (_endTime - Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
index 973dab1661..84466d8e0a 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.GroupType;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -547,7 +548,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
{
if (data.getTime() > 0)
{
- time = System.currentTimeMillis() + data.getTime();
+ time = Chronos.currentTimeMillis() + data.getTime();
break;
}
@@ -557,7 +558,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
calendar.set(Calendar.SECOND, 0);
// If calendar time is lower than current, add one more day
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
@@ -574,7 +575,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Set exact day. If modified date is before current, add one more week.
calendar.set(Calendar.DAY_OF_WEEK, day);
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.WEEK_OF_MONTH, 1);
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
index 1850d30783..07ce5a3538 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.instancezone.conditions;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -39,6 +40,6 @@ public class ConditionReenter extends Condition
protected boolean test(PlayerInstance player, Npc npc)
{
final int instanceId = getParameters().getInt("instanceId", getInstanceTemplate().getId());
- return System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
+ return Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index dc7bc9fba9..f852953226 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.ItemInfo;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -181,12 +182,12 @@ public class ItemAuction
public long getStartingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public long getFinishingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public void storeMe()
@@ -339,7 +340,7 @@ public class ItemAuction
_highestBid = bid;
}
- if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
+ if ((_endingTime - Chronos.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
{
switch (_auctionEndingExtendState)
{
@@ -426,7 +427,7 @@ public class ItemAuction
}
case FINISHED:
{
- if (_startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
+ if (_startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
{
return false;
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 8d81451dc9..f14581064a 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -243,7 +244,7 @@ public class ItemAuctionInstance
{
case 0:
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
case 1:
@@ -252,10 +253,10 @@ public class ItemAuctionInstance
{
case CREATED:
{
- if (auctions[0].getStartingTime() < (System.currentTimeMillis() + START_TIME_SPACE))
+ if (auctions[0].getStartingTime() < (Chronos.currentTimeMillis() + START_TIME_SPACE))
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
else
{
@@ -266,13 +267,13 @@ public class ItemAuctionInstance
case STARTED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, System.currentTimeMillis() + START_TIME_SPACE));
+ nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, Chronos.currentTimeMillis() + START_TIME_SPACE));
break;
}
case FINISHED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
default:
@@ -287,7 +288,7 @@ public class ItemAuctionInstance
{
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
// just to make sure we won't skip any auction because of little different times
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (ItemAuction auction : auctions)
{
if (auction.getAuctionState() == ItemAuctionState.STARTED)
@@ -311,7 +312,7 @@ public class ItemAuctionInstance
}
if (nextAuction == null)
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
break;
}
@@ -326,17 +327,17 @@ public class ItemAuctionInstance
{
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
}
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
}
}
@@ -422,7 +423,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -432,7 +433,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -442,7 +443,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -452,7 +453,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
}
@@ -577,7 +578,7 @@ public class ItemAuctionInstance
return null;
}
- if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
+ if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
{
LOGGER.info(getClass().getSimpleName() + ": Clearing expired auction: " + auctionId);
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
index 8a4746250e..71b6dde756 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData;
@@ -198,7 +199,7 @@ public class ItemInstance extends WorldObject
_type2 = 0;
_dropTime = 0;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -221,7 +222,7 @@ public class ItemInstance extends WorldObject
super.setName(_item.getName());
_loc = ItemLocation.VOID;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -1521,7 +1522,7 @@ public class ItemInstance extends WorldObject
setSpawned(true);
setXYZ(x, y, z);
- setDropTime(System.currentTimeMillis());
+ setDropTime(Chronos.currentTimeMillis());
setDropperObjectId(dropper != null ? dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
// Add the ItemInstance dropped in the world as a visible object
@@ -1800,7 +1801,7 @@ public class ItemInstance extends WorldObject
public long getRemainingTime()
{
- return _time - System.currentTimeMillis();
+ return _time - Chronos.currentTimeMillis();
}
public void endOfLife()
@@ -2421,7 +2422,7 @@ public class ItemInstance extends WorldObject
if (getVisualLifeTime() > 0)
{
final long endTime = getVisualLifeTime();
- if ((endTime - System.currentTimeMillis()) > 0)
+ if ((endTime - Chronos.currentTimeMillis()) > 0)
{
ItemAppearanceTaskManager.getInstance().add(this, endTime);
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index 4991fab60f..daf3fee27c 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -21,6 +21,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
@@ -84,7 +85,7 @@ public abstract class AbstractOlympiadGame
protected boolean makeCompetitionStart()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
return !_aborted;
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 10af0d183d..a0334635fe 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
@@ -765,7 +766,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", template.getName() + " was defeated");
@@ -786,7 +787,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", castle.getName() + " Castle was successfuly taken");
@@ -800,7 +801,7 @@ public class Hero
PreparedStatement ps = con.prepareStatement("INSERT INTO heroes_diary (charId, time, action, param) values(?,?,?,?)"))
{
ps.setInt(1, charId);
- ps.setLong(2, System.currentTimeMillis());
+ ps.setLong(2, Chronos.currentTimeMillis());
ps.setInt(3, action);
ps.setInt(4, param);
ps.execute();
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index 1c50093d46..29220e4e39 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,6 +27,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
@@ -548,7 +549,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
String winner = "draw";
// Calculate Fight time
- final long _fightTime = (System.currentTimeMillis() - _startTime);
+ final long _fightTime = (Chronos.currentTimeMillis() - _startTime);
double playerOneHp = 0;
if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index 119e447b15..4bb2fc156e 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.handler.PunishmentHandler;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
@@ -133,7 +134,7 @@ public class PunishmentTask implements Runnable
*/
public boolean isExpired()
{
- return (_expirationTime > 0) && (System.currentTimeMillis() > _expirationTime);
+ return (_expirationTime > 0) && (Chronos.currentTimeMillis() > _expirationTime);
}
/**
@@ -149,7 +150,7 @@ public class PunishmentTask implements Runnable
onStart();
if (_expirationTime > 0) // Has expiration?
{
- _task = ThreadPool.schedule(this, (_expirationTime - System.currentTimeMillis()));
+ _task = ThreadPool.schedule(this, (_expirationTime - Chronos.currentTimeMillis()));
}
}
@@ -226,7 +227,7 @@ public class PunishmentTask implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement st = con.prepareStatement(UPDATE_QUERY))
{
- st.setLong(1, System.currentTimeMillis());
+ st.setLong(1, Chronos.currentTimeMillis());
st.setLong(2, _id);
st.execute();
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 7c2d57fdc6..2e36bece7c 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -32,6 +32,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.EventDroplist;
import org.l2jmobius.gameserver.data.ItemTable;
@@ -100,7 +101,7 @@ public class LongTimeEvent extends Quest
}
else if (_eventPeriod.getStartDate().after(new Date()))
{
- final long delay = _eventPeriod.getStartDate().getTime() - System.currentTimeMillis();
+ final long delay = _eventPeriod.getStartDate().getTime() - Chronos.currentTimeMillis();
ThreadPool.schedule(new ScheduleStart(), delay);
LOGGER.info("Event " + _eventName + " will be started at " + _eventPeriod.getStartDate());
}
@@ -323,7 +324,7 @@ public class LongTimeEvent extends Quest
}
// Add spawns.
- final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - System.currentTimeMillis();
+ final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - Chronos.currentTimeMillis();
for (NpcSpawn spawn : _spawnList)
{
addSpawn(spawn.npcId, spawn.loc.getX(), spawn.loc.getY(), spawn.loc.getZ(), spawn.loc.getHeading(), false, millisToEventEnd, false);
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 1218569d81..4264d72834 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.enums.QuestType;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
@@ -785,7 +786,7 @@ public class QuestState
public boolean isNowAvailable()
{
final String val = get("restartTime");
- return (val != null) && (Long.parseLong(val) <= System.currentTimeMillis());
+ return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
public void setSimulated(boolean simulated)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
index cf665da8f8..b4d0d36648 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.SocialClass;
@@ -138,7 +139,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
final int level = rs.getInt("level");
final long expiration = rs.getLong("expiration");
final ResidenceFunction func = new ResidenceFunction(id, level, expiration, this);
- if ((expiration <= System.currentTimeMillis()) && !func.reactivate())
+ if ((expiration <= Chronos.currentTimeMillis()) && !func.reactivate())
{
removeFunction(func);
continue;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
index a292c439e5..d81d7f08af 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanHallGrade;
import org.l2jmobius.gameserver.enums.ClanHallType;
@@ -265,7 +266,7 @@ public class ClanHall extends AbstractResidence
final int failDays = getCostFailDay();
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : _paidUntil;
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - Chronos.currentTimeMillis());
}
else
{
@@ -310,7 +311,7 @@ public class ClanHall extends AbstractResidence
*/
public long getNextPayment()
{
- return (_checkPaymentTask != null) ? System.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
+ return (_checkPaymentTask != null) ? Chronos.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
}
public Location getOwnerLocation()
@@ -382,7 +383,7 @@ public class ClanHall extends AbstractResidence
{
_owner.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, _lease, null, null);
setPaidUntil(Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(7)).toEpochMilli());
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - Chronos.currentTimeMillis());
updateDB();
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
index 2fa683814d..faac3921be 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
@@ -30,6 +30,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
@@ -85,7 +86,7 @@ public class ClanHallAuction
public void addBid(Clan clan, long bid)
{
- addBid(clan, bid, System.currentTimeMillis());
+ addBid(clan, bid, Chronos.currentTimeMillis());
}
public void addBid(Clan clan, long bid, long bidTime)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index c71380874f..841d3b180c 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -20,6 +20,7 @@ import java.time.Instant;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ResidenceFunctionsData;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -63,9 +64,9 @@ public class ResidenceFunction
private void init()
{
final ResidenceFunctionTemplate template = getTemplate();
- if ((template != null) && (_expiration > System.currentTimeMillis()))
+ if ((template != null) && (_expiration > Chronos.currentTimeMillis()))
{
- _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
+ _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - Chronos.currentTimeMillis());
}
}
@@ -170,7 +171,7 @@ public class ResidenceFunction
if (wh.destroyItem("FunctionFee", item, template.getCost().getCount(), null, this) != null)
{
- _expiration = System.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
+ _expiration = Chronos.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
init();
}
return true;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
index 3a425c9b03..af7fd2e85e 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.shuttle;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Location;
/**
@@ -29,7 +30,7 @@ public class ShuttleStop
private final int _id;
private boolean _isOpen = true;
private final List _dimensions = new ArrayList<>(3);
- private long _lastDoorStatusChanges = System.currentTimeMillis();
+ private long _lastDoorStatusChanges = Chronos.currentTimeMillis();
public ShuttleStop(int id)
{
@@ -64,7 +65,7 @@ public class ShuttleStop
}
_isOpen = true;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public void closeDoor()
@@ -75,11 +76,11 @@ public class ShuttleStop
}
_isOpen = false;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public boolean hasDoorChanged()
{
- return (System.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
+ return (Chronos.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Castle.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Castle.java
index 8aa51ae1d1..a85192d134 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Castle.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Castle.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.CastleData;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -160,7 +161,7 @@ public class Castle extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -195,7 +196,7 @@ public class Castle extends AbstractResidence
fee = _tempFee;
}
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Fort.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Fort.java
index 95839a8065..de66de79ed 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Fort.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Fort.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.FortUpdater;
import org.l2jmobius.gameserver.FortUpdater.UpdaterType;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -163,7 +164,7 @@ public class Fort extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -193,7 +194,7 @@ public class Fort extends AbstractResidence
if ((_fortOwner.getWarehouse().getAdena() >= _fee) || !_cwh)
{
final int fee = _endDate == -1 ? _tempFee : _fee;
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
@@ -580,7 +581,7 @@ public class Fort extends AbstractResidence
clan.setFortId(getResidenceId());
setOwnerClan(clan);
final int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
- long initial = System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
+ long initial = Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
while (initial > (Config.FS_UPDATE_FRQ * 60000))
{
initial -= Config.FS_UPDATE_FRQ * 60000;
@@ -786,7 +787,7 @@ public class Fort extends AbstractResidence
if (clan != null)
{
clanId = clan.getId();
- _lastOwnedTime.setTimeInMillis(System.currentTimeMillis());
+ _lastOwnedTime.setTimeInMillis(Chronos.currentTimeMillis());
}
else
{
@@ -920,12 +921,12 @@ public class Fort extends AbstractResidence
public int getOwnedTime()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
}
public int getTimeTillRebelArmy()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - System.currentTimeMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - Chronos.currentTimeMillis()) / 1000);
}
public long getTimeTillNextFortUpdate()
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Siege.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Siege.java
index 25e8b587a3..31f673fbb7 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Siege.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/siege/Siege.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SiegeScheduleData;
import org.l2jmobius.gameserver.enums.SiegeClanType;
@@ -1434,9 +1435,9 @@ public class Siege implements Siegable
}
final Calendar calendar = _castle.getSiegeDate();
- if (calendar.getTimeInMillis() < System.currentTimeMillis())
+ if (calendar.getTimeInMillis() < Chronos.currentTimeMillis())
{
- calendar.setTimeInMillis(System.currentTimeMillis());
+ calendar.setTimeInMillis(Chronos.currentTimeMillis());
}
calendar.set(Calendar.DAY_OF_WEEK, holder.getDay());
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
index c7b80987c7..77396cff6d 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
@@ -32,10 +32,10 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
+import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
import org.l2jmobius.gameserver.model.stats.Stat;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
index c3ac06e1fc..18161a6c75 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
@@ -30,8 +30,8 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
index 5428c6f7dd..497f4e7247 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.zone.type;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -99,7 +100,7 @@ public class NoRestartZone extends ZoneType
return;
}
- if (((System.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
+ if (((Chronos.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
{
player.teleToLocation(TeleportWhereType.TOWN);
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/GameClient.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/GameClient.java
index badd7b05a1..99c66513d8 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/GameClient.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/GameClient.java
@@ -30,6 +30,7 @@ import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.ICrypt;
import org.l2jmobius.commons.network.IIncomingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -341,7 +342,7 @@ public class GameClient extends ChannelInboundHandler
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps2 = con.prepareStatement("UPDATE characters SET deletetime=? WHERE charId=?"))
{
- ps2.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ ps2.setLong(1, Chronos.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
ps2.setInt(2, objectId);
ps2.execute();
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
index bf151234da..cf2986ced6 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -81,7 +82,7 @@ public class AllyDismiss implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000), Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
leaderClan.updateClanInDB();
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
index 3d5c508a4c..7cc2fa0c1f 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class AllyLeave implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
clan.setAllyId(0);
clan.setAllyName(null);
clan.changeAllyCrest(0, true);
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 902c7bf7d5..5f24c8f53f 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
@@ -539,7 +540,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_RECENTLY_BEEN_DISMISSED_FROM_A_CLAN_YOU_ARE_NOT_ALLOWED_TO_JOIN_ANOTHER_CLAN_FOR_24_HOURS);
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
index c63a8bfcf4..854d89da8d 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.AdminTeleportType;
@@ -74,7 +75,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
player.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
index 0116b13a14..520c45b7ce 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
@@ -20,6 +20,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.enums.ItemSkillType;
@@ -126,7 +127,7 @@ public class RequestEnchantItem implements IClientIncomingPacket
}
// fast auto-enchant cheat check
- if ((request.getTimestamp() == 0) || ((System.currentTimeMillis() - request.getTimestamp()) < 2000))
+ if ((request.getTimestamp() == 0) || ((Chronos.currentTimeMillis() - request.getTimestamp()) < 2000))
{
Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " use autoenchant program ", Config.DEFAULT_PUNISH);
player.removeRequest(request.getClass());
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
index b8a07b77e8..bad73f8c28 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -82,7 +83,7 @@ public class RequestExAddEnchantScrollItem implements IClientIncomingPacket
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantScrollItemResult(_scrollObjectId));
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
index db4db5e742..b004d448e0 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -55,7 +56,7 @@ public class RequestExRemoveEnchantSupportItem implements IClientIncomingPacket
request.setSupportItem(PlayerInstance.ID_NONE);
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(ExRemoveEnchantSupportItemResult.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
index 7081788fa8..b7c0e01d93 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -69,7 +70,7 @@ public class RequestExSetPledgeCrestLarge implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
index c9e0cf1be8..7a2a1c706a 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -85,7 +86,7 @@ public class RequestExTryToPutEnchantSupportItem implements IClientIncomingPacke
}
request.setSupportItem(support.getObjectId());
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantSupportItemResult(_supportObjectId));
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
index cdf3996711..4b04a3965e 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -76,7 +77,7 @@ public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
}
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
client.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
index 715be58f93..cd86a6542c 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -69,7 +70,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
{
if (_isJoining == 1)
{
- if (System.currentTimeMillis() < clan.getDissolvingExpiryTime())
+ if (Chronos.currentTimeMillis() < clan.getDissolvingExpiryTime())
{
client.sendPacket(SystemMessageId.YOUR_CLAN_MAY_NOT_REGISTER_TO_PARTICIPATE_IN_A_SIEGE_WHILE_UNDER_A_GRACE_PERIOD_OF_THE_CLAN_S_DISSOLUTION);
return;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
index 1e78964e1b..e31721fdce 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.BoatManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.instance.BoatInstance;
@@ -61,7 +62,7 @@ public class RequestMoveToLocationInVehicle implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
client.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
index 5563872c57..0fd55d3ffe 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
@@ -80,8 +81,8 @@ public class RequestOustPledgeMember implements IClientIncomingPacket
}
// this also updates the database
- clan.removeClanMember(member.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
- clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(member.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setCharPenaltyExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
final SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_HAS_BEEN_EXPELLED);
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
index 0bf1ebf5ec..a61cc79835 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
@@ -22,6 +22,7 @@ import java.sql.SQLException;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -68,7 +69,7 @@ public class RequestPetitionFeedback implements IClientIncomingPacket
statement.setString(2, player.getLastPetitionGmName());
statement.setInt(3, _rate);
statement.setString(4, _message);
- statement.setLong(5, System.currentTimeMillis());
+ statement.setLong(5, Chronos.currentTimeMillis());
statement.execute();
}
catch (SQLException e)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 30e0b1b097..9c606fc9fe 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -34,8 +34,8 @@ import org.l2jmobius.gameserver.model.quest.Event;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.network.GameClient;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
index ed6c0db580..2d92eb4df9 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -74,7 +75,7 @@ public class RequestSetPledgeCrest implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
index 16f6b732ba..f1d9597133 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.enums.UserInfoType;
@@ -101,7 +102,7 @@ public class RequestStartPledgeWar implements IClientIncomingPacket
client.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
- else if (clanDeclaredWar.getDissolvingExpiryTime() > System.currentTimeMillis())
+ else if (clanDeclaredWar.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(new SystemMessage(SystemMessageId.A_CLAN_WAR_CAN_NOT_BE_DECLARED_AGAINST_A_CLAN_THAT_IS_BEING_DISSOLVED));
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
index 8d0f9b92cc..48988b5249 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class RequestWithdrawalPledge implements IClientIncomingPacket
}
final Clan clan = player.getClan();
- clan.removeClanMember(player.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(player.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
index e1f30a1018..c379f83677 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlEvent;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.NextAction;
@@ -258,7 +259,7 @@ public class UseItem implements IClientIncomingPacket
else if (player.isAttackingNow())
{
// Equip or unEquip.
- ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
+ ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
index aef68ac971..96ce901338 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.appearance;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.enums.InventorySlot;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -252,7 +253,7 @@ public class RequestShapeShiftingItem implements IClientIncomingPacket
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getLifeTime() > 0))
{
- targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, System.currentTimeMillis() + appearanceStone.getLifeTime());
+ targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, Chronos.currentTimeMillis() + appearanceStone.getLifeTime());
targetItem.scheduleVisualLifeTime();
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
index 2aa7eeeeac..d6bbe9b766 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,9 +119,9 @@ public class ConfirmMenteeAdd implements IClientIncomingPacket
mentor.sendPacket(SystemMessageId.YOU_MUST_AWAKEN_IN_ORDER_TO_BECOME_A_MENTOR);
return false;
}
- else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > System.currentTimeMillis())
+ else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > Chronos.currentTimeMillis())
{
- long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - System.currentTimeMillis()) / 1000;
+ long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - Chronos.currentTimeMillis()) / 1000;
final int days = (int) (remainingTime / 86400);
remainingTime = remainingTime % 86400;
final int hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
index e06cd9048d..1e8aba6d16 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
@@ -119,7 +120,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
index f6702caa41..9c076a29a5 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.enums.MailType;
@@ -140,7 +141,7 @@ public class RequestBRPresentBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
index c3faad961a..138ed60513 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.training;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.TrainingHolder;
import org.l2jmobius.gameserver.network.GameClient;
@@ -52,7 +53,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
if (holder.isTraining())
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
@@ -60,7 +61,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
player.setImmobilized(false);
player.teleToLocation(player.getLastLocation());
player.sendPacket(ExTrainingZone_Leaving.STATIC_PACKET);
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
index ee1c787150..3f1213f2ee 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.loginserverpackets.game;
import org.l2jmobius.commons.network.BaseSendablePacket;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author mrTJO
@@ -28,7 +29,7 @@ public class TempBan extends BaseSendablePacket
writeC(0x0A);
writeS(accountName);
writeS(ip);
- writeQ(System.currentTimeMillis() + (time * 60000));
+ writeQ(Chronos.currentTimeMillis() + (time * 60000));
// if (reason != null)
// {
// writeC(0x01);
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
index be68d42341..db34e27e47 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.CharSelectInfoPackage;
@@ -188,7 +189,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP
packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP
- packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
+ packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0);
packet.writeD(charInfoPackage.getClassId());
packet.writeD(i == _activeId ? 1 : 0);
@@ -283,7 +284,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
// See if the char must be deleted
final long deletetime = chardata.getLong("deletetime");
- if ((deletetime > 0) && (System.currentTimeMillis() > deletetime))
+ if ((deletetime > 0) && (Chronos.currentTimeMillis() > deletetime))
{
final Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
if (clan != null)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
index 4bdb9d3951..e1c3fc3f54 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
@@ -50,7 +51,7 @@ public class ExInzoneWaiting implements IClientOutgoingPacket
packet.writeD(_instanceTimes.size());
for (Entry entry : _instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
index a40690e845..6f7b5f8735 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MatchingRoomManager;
@@ -73,7 +74,7 @@ public class ExListPartyMatchingWaitingRoom implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
index d455d825fd..5921d44781 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MatchingMemberType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -61,7 +62,7 @@ public class ExPartyRoomMember implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
index 3656ddbc4e..ab85228caf 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MailType;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
@@ -45,7 +46,7 @@ public class ExShowReceivedPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_RECEIVED_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_inbox != null) && !_inbox.isEmpty())
{
packet.writeD(_inbox.size());
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
index 2ae09181a7..db4bccc928 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -40,7 +41,7 @@ public class ExShowSentPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_SENT_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_outbox != null) && !_outbox.isEmpty())
{
packet.writeD(_outbox.size());
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
index 44fe4f9b63..c420fbc1ef 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.items.Henna;
import org.l2jmobius.gameserver.model.stats.BaseStat;
@@ -73,7 +74,7 @@ public class HennaInfo implements IClientOutgoingPacket
int duration = premium.getDuration();
if (duration > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
duration = (int) Math.max(0, _player.getVariables().getLong("HennaDuration4", currentTime) - currentTime) / 1000;
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
index 5ed678042b..caed96260b 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -88,7 +89,7 @@ public class SiegeInfo implements IClientOutgoingPacket
packet.writeS(""); // Ally Name
}
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if (!_castle.isTimeRegistrationOver() && _player.isClanLeader() && (_player.getClanId() == _castle.getOwnerId()))
{
final Calendar cal = Calendar.getInstance();
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
index 5871334785..c6de3ccd8b 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.TimeStamp;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -36,7 +37,7 @@ public class SkillCoolTime implements IClientOutgoingPacket
public SkillCoolTime(PlayerInstance player)
{
- _currentTime = System.currentTimeMillis();
+ _currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : player.getSkillReuseTimeStamps().values())
{
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel()).isNotBroadcastable())
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
index 74955d8a26..2ffa34919b 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets.friend;
import java.util.Calendar;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -39,7 +40,7 @@ public class ExFriendDetailInfo implements IClientOutgoingPacket
_objectId = player.getObjectId();
_name = name;
_friend = World.getInstance().getPlayer(_name);
- _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) System.currentTimeMillis() : (int) (System.currentTimeMillis() - _friend.getLastAccess()) / 1000;
+ _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) Chronos.currentTimeMillis() : (int) (Chronos.currentTimeMillis() - _friend.getLastAccess()) / 1000;
}
@Override
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/scripting/ManagedScript.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
index 00235baa25..9d206480d8 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
@@ -20,6 +20,8 @@ import java.nio.file.Path;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* Abstract class for classes that are meant to be implemented by scripts.
* @author KenM
@@ -35,7 +37,7 @@ public abstract class ManagedScript
public ManagedScript()
{
_scriptFile = getScriptPath();
- setLastLoadTime(System.currentTimeMillis());
+ setLastLoadTime(Chronos.currentTimeMillis());
}
public abstract Path getScriptPath();
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9c8c4bb5dd..b5a2e04233 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -54,7 +55,7 @@ public class AttackStanceTaskManager
}
_working = true;
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
try
{
final Iterator> iterator = _attackStanceTasks.entrySet().iterator();
@@ -105,7 +106,7 @@ public class AttackStanceTaskManager
return;
}
- _attackStanceTasks.put(creature, System.currentTimeMillis());
+ _attackStanceTasks.put(creature, Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
index 8ab6c99d28..d56e0b8a23 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.buylist.Product;
/**
@@ -45,7 +46,7 @@ public class BuyListTaskManager
}
_workingProducts = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : PRODUCTS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 8b4a7db319..f8218055f3 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@@ -44,7 +45,7 @@ public class DecayTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -87,7 +88,7 @@ public class DecayTaskManager
}
// Add to decay schedules.
- DECAY_SCHEDULES.put(creature, System.currentTimeMillis() + (delay * 1000));
+ DECAY_SCHEDULES.put(creature, Chronos.currentTimeMillis() + (delay * 1000));
}
/**
@@ -107,7 +108,7 @@ public class DecayTaskManager
public long getRemainingTime(Creature creature)
{
final Long time = DECAY_SCHEDULES.get(creature);
- return time != null ? time.longValue() - System.currentTimeMillis() : Long.MAX_VALUE;
+ return time != null ? time.longValue() - Chronos.currentTimeMillis() : Long.MAX_VALUE;
}
@Override
@@ -122,7 +123,7 @@ public class DecayTaskManager
ret.append("Tasks dump:");
ret.append(Config.EOL);
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
ret.append("Class/Name: ");
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
index c3834ecbb9..e0f823bef4 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemAppearanceTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
index 27f0273802..de10959db8 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemLifeTimeTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 396633692c..160debb492 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -42,7 +43,7 @@ public class ItemManaTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
@@ -61,7 +62,7 @@ public class ItemManaTaskManager
{
if (!ITEMS.containsKey(item))
{
- ITEMS.put(item, System.currentTimeMillis() + MANA_CONSUMPTION_RATE);
+ ITEMS.put(item, Chronos.currentTimeMillis() + MANA_CONSUMPTION_RATE);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
index eb0dd7a59f..a2f0dc5563 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.model.World;
@@ -48,7 +49,7 @@ public class MessageDeletionTaskManager
Integer msgId;
Message msg;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_MESSAGES.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
index 2f270649fb..82483a498a 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PlayerAutoSaveTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SEARCH: for (Entry entry : PLAYER_TIMES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -63,7 +64,7 @@ public class PlayerAutoSaveTaskManager
public void add(PlayerInstance player)
{
- PLAYER_TIMES.put(player, System.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
+ PLAYER_TIMES.put(player, Chronos.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
}
public void remove(PlayerInstance player)
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
index 6a406a9591..3a812e2fcb 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PvpFlagTaskManager
if (!PLAYERS.isEmpty())
{
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (PlayerInstance player : PLAYERS)
{
if (time > player.getPvpFlagLasts())
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
index 5473f21a8f..b8135996f8 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -43,7 +44,7 @@ public class RandomAnimationTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_ANIMATIONS.entrySet())
{
if (time > entry.getValue().longValue())
@@ -65,7 +66,7 @@ public class RandomAnimationTaskManager
{
if (npc.hasRandomAnimation())
{
- PENDING_ANIMATIONS.putIfAbsent(npc, System.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
+ PENDING_ANIMATIONS.putIfAbsent(npc, Chronos.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
index 8e8e818908..debb0d68e6 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Spawn;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -42,7 +43,7 @@ public class RespawnTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_RESPAWNS.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
index 990efb8b45..d1946b860a 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -36,6 +36,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskBirthday;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskRecom;
@@ -94,7 +95,7 @@ public class TaskManager
public void run()
{
task.onTimeElapsed(this);
- lastActivation = System.currentTimeMillis();
+ lastActivation = Chronos.currentTimeMillis();
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement statement = con.prepareStatement(SQL_STATEMENTS[1]))
{
@@ -242,7 +243,7 @@ public class TaskManager
try
{
final Date desired = DateFormat.getInstance().parse(task.getParams()[0]);
- final long diff = desired.getTime() - System.currentTimeMillis();
+ final long diff = desired.getTime() - Chronos.currentTimeMillis();
if (diff >= 0)
{
task.scheduled = ThreadPool.schedule(task, diff);
@@ -293,7 +294,7 @@ public class TaskManager
return false;
}
- delay = min.getTimeInMillis() - System.currentTimeMillis();
+ delay = min.getTimeInMillis() - Chronos.currentTimeMillis();
if (check.after(min) || (delay < 0))
{
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ui/SystemPanel.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ui/SystemPanel.java
index 8c01c1f8fe..a19a873bfe 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ui/SystemPanel.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ui/SystemPanel.java
@@ -31,6 +31,7 @@ import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.util.Locator;
@@ -42,7 +43,7 @@ public class SystemPanel extends JPanel
{
protected static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
- protected static final long START_TIME = System.currentTimeMillis();
+ protected static final long START_TIME = Chronos.currentTimeMillis();
public SystemPanel()
{
@@ -136,7 +137,7 @@ public class SystemPanel extends JPanel
lblConnected.setText("Connected: " + playerCount);
lblMaxConnected.setText("Max connected: " + World.MAX_CONNECTED_COUNT);
lblOfflineShops.setText("Offline trade: " + World.OFFLINE_TRADE_COUNT);
- lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - START_TIME));
+ lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(Chronos.currentTimeMillis() - START_TIME));
}
}, 1000, 1000);
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
index ec95816f82..cc8059f91a 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.PlayerCondOverride;
@@ -151,7 +152,7 @@ public class FloodProtectorAction
*/
private void banAccount()
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
if (LOGGER.isLoggable(Level.WARNING))
{
log(" banned for flooding ", _config.PUNISHMENT_TIME <= 0 ? "forever" : "for " + (_config.PUNISHMENT_TIME / 60000) + " mins");
@@ -171,7 +172,7 @@ public class FloodProtectorAction
final int charId = _client.getPlayer().getObjectId();
if (charId > 0)
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
}
if (LOGGER.isLoggable(Level.WARNING))
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
index e5912dd51b..d6580161c7 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World;
@@ -143,7 +144,7 @@ public class OfflineTradeUtil
if (player.getOfflineStartTime() == 0)
{
- player.setOfflineStartTime(System.currentTimeMillis());
+ player.setOfflineStartTime(Chronos.currentTimeMillis());
}
// Store trade on exit, if realtime saving is enabled.
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/FloodProtectedListener.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/FloodProtectedListener.java
index ba2fc6536a..e2bbcc1aa3 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/FloodProtectedListener.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/FloodProtectedListener.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author -Wooden-
@@ -63,9 +64,9 @@ public abstract class FloodProtectedListener extends Thread
if (fConnection != null)
{
fConnection.connectionNumber += 1;
- if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((System.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((System.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
+ if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
{
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
connection.close();
fConnection.connectionNumber -= 1;
if (!fConnection.isFlooding)
@@ -80,11 +81,11 @@ public abstract class FloodProtectedListener extends Thread
fConnection.isFlooding = false;
LOGGER.info(connection.getInetAddress().getHostAddress() + " is not considered as flooding anymore.");
}
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
}
else
{
- fConnection = new ForeignConnection(System.currentTimeMillis());
+ fConnection = new ForeignConnection(Chronos.currentTimeMillis());
_floodProtection.put(connection.getInetAddress().getHostAddress(), fConnection);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/LoginController.java
index 189b90e2ee..9d382c646b 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/LoginController.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/LoginController.java
@@ -41,6 +41,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.GameServerTable.GameServerInfo;
@@ -176,7 +177,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(USER_INFO_SELECT))
{
- ps.setString(1, Long.toString(System.currentTimeMillis()));
+ ps.setString(1, Long.toString(Chronos.currentTimeMillis()));
ps.setString(2, login);
try (ResultSet rset = ps.executeQuery())
{
@@ -208,7 +209,7 @@ public class LoginController
{
ps.setString(1, login);
ps.setString(2, hashBase64);
- ps.setLong(3, System.currentTimeMillis());
+ ps.setLong(3, Chronos.currentTimeMillis());
ps.setInt(4, 0);
ps.setString(5, addr.getHostAddress());
ps.execute();
@@ -273,7 +274,7 @@ public class LoginController
*/
public void addBanForAddress(InetAddress address, long duration)
{
- _bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
+ _bannedIps.putIfAbsent(address, Chronos.currentTimeMillis() + duration);
}
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
@@ -294,7 +295,7 @@ public class LoginController
}
if (bi != null)
{
- if ((bi > 0) && (bi < System.currentTimeMillis()))
+ if ((bi > 0) && (bi < Chronos.currentTimeMillis()))
{
_bannedIps.remove(address);
LOGGER.info("Removed expired ip address ban " + address.getHostAddress() + ".");
@@ -541,7 +542,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(ACCOUNT_INFO_UPDATE))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.setString(2, address.getHostAddress());
ps.setString(3, info.getLogin());
ps.execute();
@@ -613,7 +614,7 @@ public class LoginController
{
continue;
}
- if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < System.currentTimeMillis())
+ if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < Chronos.currentTimeMillis())
{
client.close(LoginFailReason.REASON_ACCESS_FAILED);
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/network/LoginClient.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/network/LoginClient.java
index 04455664e2..93194a11c0 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/network/LoginClient.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/network/LoginClient.java
@@ -27,6 +27,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.IIncomingPacket;
import org.l2jmobius.commons.network.IOutgoingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.LoginController;
@@ -82,14 +83,14 @@ public class LoginClient extends ChannelInboundHandler
_addr = address.getAddress();
_channel = ctx.channel();
_sessionId = Rnd.nextInt();
- _connectionStartTime = System.currentTimeMillis();
+ _connectionStartTime = Chronos.currentTimeMillis();
sendPacket(new Init(_scrambledPair.getScrambledModulus(), _blowfishKey.getEncoded(), _sessionId));
}
@Override
public void channelInactive(ChannelHandlerContext ctx)
{
- if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < System.currentTimeMillis()))
+ if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < Chronos.currentTimeMillis()))
{
LoginController.getInstance().removeAuthedLoginClient(getAccount());
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
index 801bc957ae..875759b72a 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
@@ -24,6 +24,8 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* IPv4 filter.
* @author Forsaiken
@@ -59,7 +61,7 @@ public class IPv4Filter implements Runnable
Flood()
{
- lastAccess = System.currentTimeMillis();
+ lastAccess = Chronos.currentTimeMillis();
trys = 0;
}
}
@@ -74,7 +76,7 @@ public class IPv4Filter implements Runnable
}
final int h = hash(addr.getAddress());
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
Flood f;
synchronized (_ipFloodMap)
{
@@ -120,7 +122,7 @@ public class IPv4Filter implements Runnable
{
while (true)
{
- final long reference = System.currentTimeMillis() - (1000 * 300);
+ final long reference = Chronos.currentTimeMillis() - (1000 * 300);
synchronized (_ipFloodMap)
{
final Iterator> it = _ipFloodMap.entrySet().iterator();
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 e66362d6c0..86b46f1919 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
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.model.Location;
@@ -137,7 +138,7 @@ public class Parade extends AbstractNpcAI
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
- LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
+ LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
}
void load()
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
index c91b42bb26..7757d82c61 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -304,7 +305,7 @@ public class TalentShow extends AbstractNpcAI
hourDiff *= 3600000;
minDiff *= 60000;
diff = hourDiff + minDiff;
- LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
+ LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
startQuestTimer("Start", diff, null, null); // first start
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
index 940193f4fc..32c8b9f9f1 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
@@ -16,6 +16,7 @@
*/
package ai.areas.GainakUnderground.Lailly;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -64,7 +65,7 @@ public class Lailly extends AbstractNpcAI
case "okay":
{
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
- if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis()))
+ if ((instance != null) && (instance.getEndTime() > Chronos.currentTimeMillis()))
{
switch (instance.getTemplateId())
{
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 a00d59028e..037b29d579 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
@@ -29,6 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -516,7 +517,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
final GlobalVariablesManager vars = GlobalVariablesManager.getInstance();
final long var = vars.getLong("FourSepulchers" + npcId, 0) + (TIME_ATTACK * 60 * 1000);
- if (var > System.currentTimeMillis())
+ if (var > Chronos.currentTimeMillis())
{
showHtmlFile(player, npcId + "-NE.html", npc, null);
return;
@@ -581,7 +582,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
ThreadPool.schedule(() -> ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers(), TIME_ATTACK * 60 * 1000);
// Save attack time
- vars.set("FourSepulchers" + npcId, System.currentTimeMillis());
+ vars.set("FourSepulchers" + npcId, Chronos.currentTimeMillis());
// Init progress
STORED_PROGRESS.put(sepulcherId, 1); // start from 1
// Start
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
index 4badef030d..68a46309c8 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
@@ -19,6 +19,7 @@ package ai.areas.KeucereusAllianceBase;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
@@ -111,7 +112,7 @@ public class LindviorScene extends AbstractNpcAI
final GregorianCalendar date = new GregorianCalendar();
date.set(Calendar.MINUTE, RESET_MIN);
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
- if (System.currentTimeMillis() >= date.getTimeInMillis())
+ if (Chronos.currentTimeMillis() >= date.getTimeInMillis())
{
date.add(Calendar.DAY_OF_WEEK, 1);
}
@@ -129,7 +130,7 @@ public class LindviorScene extends AbstractNpcAI
{
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
}
- return date.getTimeInMillis() - System.currentTimeMillis();
+ return date.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
index 80dffe38b2..de8ea0aea9 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
@@ -19,6 +19,7 @@ package ai.areas.Rune.RuneCastle.Venom;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -111,7 +112,7 @@ public class Venom extends AbstractNpcAI
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
index a7d7250e8b..c42186c0d0 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -229,7 +230,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
int buffsNow = 0;
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
- if (var < System.currentTimeMillis())
+ if (var < Chronos.currentTimeMillis())
{
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
@@ -254,7 +255,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
reenter.set(Calendar.MINUTE, 0);
reenter.set(Calendar.HOUR_OF_DAY, 13);
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
- if (reenter.getTimeInMillis() <= System.currentTimeMillis())
+ if (reenter.getTimeInMillis() <= Chronos.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 7);
}
@@ -272,7 +273,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
}
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
private void spawnGroupOfMinion(MonsterInstance npc, int[] mobIds)
@@ -317,7 +318,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
zone.clearSkills();
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
else if (event.equalsIgnoreCase("transform"))
{
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
index e004e80b3d..8044c58bf3 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -345,7 +346,7 @@ public class Anakim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ANAKIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_anakim", time, null, null);
@@ -373,7 +374,7 @@ public class Anakim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(ANAKIM, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -550,7 +551,7 @@ public class Anakim extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_anakimStatus == WAITING) && (npc.getId() == ANAKIM_CUBIC))
@@ -578,7 +579,7 @@ public class Anakim extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid())// Anakim and minions
{
// Anti BUGGERS
@@ -614,7 +615,7 @@ public class Anakim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ANAKIM, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(ANAKIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ANAKIM, info);
startQuestTimer("unlock_anakim", respawnTime, null, null);
@@ -686,7 +687,7 @@ public class Anakim extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
index 4a77fb6bfd..fe808aef25 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.MountType;
@@ -169,14 +170,14 @@ public class Antharas extends AbstractNpcAI
_antharas = (GrandBossInstance) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
_antharas.setCurrentHpMp(curr_hp, curr_mp);
addBoss(_antharas);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
break;
}
case DEAD:
{
- final long remain = respawnTime - System.currentTimeMillis();
+ final long remain = respawnTime - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -272,7 +273,7 @@ public class Antharas extends AbstractNpcAI
_antharas.setRandomWalking(false);
_antharas.teleToLocation(181323, 114850, -7623, 32542);
setStatus(IN_FIGHT);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
zone.broadcastPacket(new PlaySound("BS02_A"));
startQuestTimer("CAMERA_1", 23, _antharas, null);
break;
@@ -367,7 +368,7 @@ public class Antharas extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 900000) < Chronos.currentTimeMillis()))
{
setStatus(ALIVE);
for (Creature creature : zone.getCharactersInside())
@@ -619,7 +620,7 @@ public class Antharas extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BOMBER)
{
if (npc.calculateDistance3D(attacker) < 230)
@@ -765,7 +766,7 @@ public class Antharas extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
+ GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
}
private final void refreshAiParams(PlayerInstance attacker, int damage)
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Baium/Baium.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Baium/Baium.java
index 58985ad33b..0cd17178d9 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Baium/Baium.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Baium/Baium.java
@@ -17,6 +17,7 @@
package ai.bosses.Baium;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.CategoryType;
@@ -136,7 +137,7 @@ public class Baium extends AbstractNpcAI
final int heading = info.getInt("heading");
_baium = (GrandBossInstance) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
_baium.setCurrentHpMp(curr_hp, curr_mp);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
addBoss(_baium);
for (Location loc : ARCHANGEL_LOC)
@@ -149,7 +150,7 @@ public class Baium extends AbstractNpcAI
}
case DEAD:
{
- final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -209,7 +210,7 @@ public class Baium extends AbstractNpcAI
_baium.disableCoreAI(true);
_baium.setRandomWalking(false);
addBoss(_baium);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
@@ -375,7 +376,7 @@ public class Baium extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
{
notifyEvent("CLEAR_ZONE", null, null);
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
@@ -383,7 +384,7 @@ public class Baium extends AbstractNpcAI
}
else if (npc != null)
{
- if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
+ if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
{
npc.setTarget(npc);
npc.doCast(HEAL_OF_BAIUM.getSkill());
@@ -484,7 +485,7 @@ public class Baium extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BAIUM)
{
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
@@ -663,7 +664,7 @@ public class Baium extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
+ GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
}
private void manageSkills(Npc npc)
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
index aa8528926d..dfce75d90b 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -108,7 +109,7 @@ public class Beleth extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("BELETH_UNLOCK", time, null, null);
@@ -349,7 +350,7 @@ public class Beleth extends AbstractNpcAI
c.setImmobilized(false);
}
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, null, null);
startQuestTimer("SPAWN25", 60000, null, null);
break;
@@ -507,7 +508,7 @@ public class Beleth extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((_lastAttack + 900000) < System.currentTimeMillis())
+ if ((_lastAttack + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -708,7 +709,7 @@ public class Beleth extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(REAL_BELETH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
deleteAll();
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Core/Core.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Core/Core.java
index 969bb08788..69dc20dc5d 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Core/Core.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Core/Core.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -89,7 +90,7 @@ public class Core extends AbstractNpcAI
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
@@ -206,7 +207,7 @@ public class Core extends AbstractNpcAI
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
index 3ed92d8f08..b499a47575 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.MountType;
@@ -295,7 +296,7 @@ public class IceQueensCastleBattle extends AbstractInstance
{
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
- controller.getVariables().set("TIMER_END", System.currentTimeMillis() + 360000);
+ controller.getVariables().set("TIMER_END", Chronos.currentTimeMillis() + 360000);
}
break;
}
@@ -688,7 +689,7 @@ public class IceQueensCastleBattle extends AbstractInstance
}
case "SHOW_GLAKIAS_TIMER":
{
- final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - System.currentTimeMillis()) / 1000);
+ final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - Chronos.currentTimeMillis()) / 1000);
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
break;
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
index acbc2c3094..6023594423 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
@@ -23,6 +23,7 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -143,11 +144,11 @@ public class ScarletVanHalisha extends AbstractNpcAI
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
}
@@ -248,7 +249,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
case FRINTEZZA_DAEMON_MORPH:
case FRINTEZZA_DAEMON_FIELD:
{
- _lastRangedSkillTime = System.currentTimeMillis();
+ _lastRangedSkillTime = Chronos.currentTimeMillis();
skillRange = 550;
break;
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Helios/Helios.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Helios/Helios.java
index af4d5b4e8e..7e5c37bf69 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Helios/Helios.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Helios/Helios.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +151,7 @@ public class Helios extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(HELIOS3);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_helios", time, null, null);
@@ -496,7 +497,7 @@ public class Helios extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(HELIOS3, DEAD);
final long respawnTime = (Config.HELIOS_SPAWN_INTERVAL + getRandom(-Config.HELIOS_SPAWN_RANDOM, Config.HELIOS_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(HELIOS3);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(HELIOS3, info);
startQuestTimer("unlock_helios", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
index 81fd9ae6e8..9c32d36ecf 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.Movie;
@@ -121,7 +122,7 @@ public class Kelbim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(KELBIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_kelbim", time, null, null);
@@ -156,7 +157,7 @@ public class Kelbim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(KELBIM, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -193,7 +194,7 @@ public class Kelbim extends AbstractNpcAI
{
_kelbimBoss = (GrandBossInstance) addSpawn(KELBIM, -56340, 60801, -269, 54262, false, 0);
GrandBossManager.getInstance().addBoss(_kelbimBoss);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
startQuestTimer("stage_all_random_area_attack", Rnd.get(2, 3) * 60000, null, null);
break;
@@ -369,7 +370,7 @@ public class Kelbim extends AbstractNpcAI
{
if (npc.getId() == KELBIM)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
switch (_bossStage)
{
@@ -434,7 +435,7 @@ public class Kelbim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(KELBIM, DEAD);
final long respawnTime = (Config.KELBIM_SPAWN_INTERVAL + getRandom(-Config.KELBIM_SPAWN_RANDOM, Config.KELBIM_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(KELBIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(KELBIM, info);
startQuestTimer("unlock_kelbim", respawnTime, null, null);
startQuestTimer("end_kelbim", 1800000, null, null);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
index 62507c9762..510a8060de 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -371,7 +372,7 @@ public class Lilith extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LILITH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lilith", time, null, null);
@@ -399,7 +400,7 @@ public class Lilith extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(LILITH, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -576,7 +577,7 @@ public class Lilith extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_lilithStatus == WAITING) && (npc.getId() == LILITH_CUBIC))
@@ -594,7 +595,7 @@ public class Lilith extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid()) // Lilith and minions
{
// Anti BUGGERS
@@ -630,7 +631,7 @@ public class Lilith extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LILITH, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(LILITH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LILITH, info);
startQuestTimer("unlock_lilith", respawnTime, null, null);
@@ -702,7 +703,7 @@ public class Lilith extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
@Override
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 6b02643bc0..63811284a1 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
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -213,7 +214,7 @@ public class Lindvior extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lindvior", time, null, null);
@@ -863,7 +864,7 @@ public class Lindvior extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
final long respawnTime = (Config.LINDVIOR_SPAWN_INTERVAL + getRandom(-Config.LINDVIOR_SPAWN_RANDOM, Config.LINDVIOR_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
startQuestTimer("unlock_lindvior", respawnTime, null, null);
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
index edd3abc4b8..801d31427b 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -97,7 +98,7 @@ public class Orfen extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for Orfen from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if Orfen is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -328,7 +329,7 @@ public class Orfen extends AbstractNpcAI
startQuestTimer("orfen_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ORFEN, info);
cancelQuestTimer("check_minion_loc", npc, null);
cancelQuestTimer("check_orfen_pos", npc, null);
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 f2869a3fe9..c00a82fb97 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
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -96,7 +97,7 @@ public class QueenAnt extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for queen ant from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if queen ant is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -367,7 +368,7 @@ public class QueenAnt extends AbstractNpcAI
cancelQuestTimer("heal", null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(QUEEN, info);
_nurses.clear();
_larva.deleteMe();
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
index eda49595a1..fd26faf27c 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.QueenShyeed;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -87,7 +88,7 @@ public class QueenShyeed extends AbstractNpcAI
private void spawnShyeed()
{
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
- final long remain = respawn != 0 ? respawn - System.currentTimeMillis() : 0;
+ final long remain = respawn != 0 ? respawn - Chronos.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("respawn", remain, null, null);
@@ -103,7 +104,7 @@ public class QueenShyeed extends AbstractNpcAI
private void startRespawn()
{
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
- GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(System.currentTimeMillis() + respawnTime));
+ GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(Chronos.currentTimeMillis() + respawnTime));
startQuestTimer("respawn", respawnTime, null, null);
// MOB_BUFF_ZONE.setEnabled(false);
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
index 2f487904c0..64923cfa4b 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -137,7 +138,7 @@ public class Ramona extends AbstractNpcAI
addAttackId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3);
addSpawnId(RAMONA_1, RAMONA_2, RAMONA_3);
- final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - System.currentTimeMillis();
+ final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - Chronos.currentTimeMillis();
if (temp > 0)
{
_boss = Status.DEAD;
@@ -167,7 +168,7 @@ public class Ramona extends AbstractNpcAI
npc.setInvul(false);
cancelQuestTimers("SPAWN_MS");
startQuestTimer("CHECK_ACTIVITY_TASK", 5000, null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
}
break;
}
@@ -186,7 +187,7 @@ public class Ramona extends AbstractNpcAI
startQuestTimer("GENERATOR_2", getRandom(900000, 1200000), null, null);
startQuestTimer("GENERATOR_3", getRandom(1500000, 1800000), null, null);
startQuestTimer("GENERATOR_4", getRandom(2100000, 2400000), null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("RAMONA1_SKILL", 6000, _ramona1, null);
break;
}
@@ -300,7 +301,7 @@ public class Ramona extends AbstractNpcAI
}
case "CHECK_ACTIVITY_TASK":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
for (Creature creature : ZONE.getCharactersInside())
{
@@ -396,17 +397,17 @@ public class Ramona extends AbstractNpcAI
}
case RAMONA_1:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
@@ -540,7 +541,7 @@ public class Ramona extends AbstractNpcAI
{
_boss = Status.DEAD;
final long respawnTime = (Config.RAMONA_SPAWN_INTERVAL + getRandom(-Config.RAMONA_SPAWN_RANDOM, Config.RAMONA_SPAWN_RANDOM)) * 3600000;
- GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, Chronos.currentTimeMillis() + respawnTime);
startQuestTimer("RAMONA_UNLOCK", respawnTime, null, null);
startQuestTimer("END_RAMONA", 90000, null, null);
break;
@@ -568,13 +569,13 @@ public class Ramona extends AbstractNpcAI
case RAMONA_1:
{
_boss = Status.IN_FIGHT;
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
index 4d4eb8653a..be58208558 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.Sailren;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -71,7 +72,7 @@ public class Sailren extends AbstractNpcAI
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
- final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
+ final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - Chronos.currentTimeMillis();
if (remain > 0)
{
STATUS = Status.DEAD;
@@ -118,7 +119,7 @@ public class Sailren extends AbstractNpcAI
{
takeItems(player, GAZKH, 1);
STATUS = Status.IN_FIGHT;
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
for (PlayerInstance member : player.getParty().getMembers())
{
if (member.isInsideRadius3D(npc, 1000))
@@ -237,7 +238,7 @@ public class Sailren extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
+ if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < Chronos.currentTimeMillis()))
{
cancelQuestTimer("TIME_OUT", null, null);
notifyEvent("TIME_OUT", null, null);
@@ -257,7 +258,7 @@ public class Sailren extends AbstractNpcAI
{
if (zone.isCharacterInZone(attacker))
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -274,7 +275,7 @@ public class Sailren extends AbstractNpcAI
STATUS = Status.DEAD;
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
final long respawnTime = RESPAWN * 3600000;
- GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set("SailrenRespawn", Chronos.currentTimeMillis() + respawnTime);
cancelQuestTimer("CHECK_ATTACK", null, null);
cancelQuestTimer("TIME_OUT", null, null);
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
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 0c824fd3b2..523f53e898 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
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -326,7 +327,7 @@ public class Trasken extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_trasken", time, null, null);
@@ -604,7 +605,7 @@ public class Trasken extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
startQuestTimer("unlock_trasken", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
index 94d29e346e..c8e0f497af 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.MountType;
@@ -129,7 +130,7 @@ public class Valakas extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for valakas from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (temp > 0)
{
// The time has not yet expired. Mark Valakas as currently locked (dead).
@@ -168,7 +169,7 @@ public class Valakas extends AbstractNpcAI
if (status == FIGHTING)
{
// stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
startQuestTimer("regen_task", 60000, valakas, null, true);
startQuestTimer("skill_task", 2000, valakas, null, true);
@@ -196,7 +197,7 @@ public class Valakas extends AbstractNpcAI
if (event.equalsIgnoreCase("beginning"))
{
// Stores current time
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
// Teleport Valakas to his lair.
npc.teleToLocation(VALAKAS_LAIR);
@@ -220,7 +221,7 @@ public class Valakas extends AbstractNpcAI
else if (event.equalsIgnoreCase("regen_task"))
{
// Inactivity task - 15min
- if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
+ if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < Chronos.currentTimeMillis()))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
@@ -416,7 +417,7 @@ public class Valakas extends AbstractNpcAI
npc.setTarget(attacker);
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
}
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -447,7 +448,7 @@ public class Valakas extends AbstractNpcAI
startQuestTimer("valakas_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
return super.onKill(npc, killer, isSummon);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
index ddc6ff9e74..40bd1cf6c2 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
@@ -46,8 +46,8 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcManorBypass;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.teleporter.TeleportHolder;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index a7e5e42043..75ce73d138 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -26,6 +26,7 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -153,7 +154,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -189,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
@@ -247,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
@@ -296,7 +297,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0]");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
sb.append(" | ");
sb.append(auction.getHighestBid());
sb.append(" | ");
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
index f469c39159..2362aa9446 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -21,6 +21,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.Location;
@@ -73,7 +74,7 @@ public class ProvisionalHalls extends AbstractNpcAI
if (resetTime > 0)
{
cancelQuestTimers(HALL_RESET_VAR + id);
- startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
}
}
}
@@ -126,7 +127,7 @@ public class ProvisionalHalls extends AbstractNpcAI
for (int id : CLAN_HALLS.keySet())
{
- if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < Chronos.currentTimeMillis()))
{
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
@@ -137,7 +138,7 @@ public class ProvisionalHalls extends AbstractNpcAI
clanHall.setOwner(player.getClan());
}
player.sendMessage("Congratulations! You now own a provisional clan hall!");
- startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
return null;
}
}
@@ -177,7 +178,7 @@ public class ProvisionalHalls extends AbstractNpcAI
else if (event.startsWith(HALL_RESET_VAR))
{
final String id = event.replace(HALL_RESET_VAR, "");
- if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
{
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
if (clanId > 0)
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index 18f813b1a2..a3c74220a9 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -19,6 +19,7 @@ package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -111,7 +112,7 @@ public class TrainingCamp extends AbstractNpcAI
player.teleToLocation(TRAINING_LOCATION);
player.setImmobilized(true);
// @Sdw: Here we are supposed to send ExUserInfoEquipSlot with a fake equip of a SLS, feels ugly to me, not doing it.
- player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
+ player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), Chronos.currentTimeMillis(), -1));
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
@@ -203,7 +204,7 @@ public class TrainingCamp extends AbstractNpcAI
final TrainingHolder holder = player.getTraingCampInfo();
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
index 49dfa6b963..6140daa716 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
@@ -16,6 +16,7 @@
*/
package events.FreyaCelebration;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -79,7 +80,7 @@ public class FreyaCelebration extends LongTimeEvent
{
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
if (currentTime > reuseTime)
{
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
index cce5b52533..d97b3c74db 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
@@ -16,6 +16,7 @@
*/
package events.GiftOfVitality;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -94,9 +95,9 @@ public class GiftOfVitality extends LongTimeEvent
case "vitality":
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -110,7 +111,7 @@ public class GiftOfVitality extends LongTimeEvent
{
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
htmltext = "4306-okvitality.htm";
}
break;
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
index 038d7883b0..7fb3b481dd 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
@@ -16,6 +16,7 @@
*/
package events.LoveYourGatekeeper;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -58,9 +59,9 @@ public class LoveYourGatekeeper extends LongTimeEvent
if (player.getAdena() >= PRICE)
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -73,7 +74,7 @@ public class LoveYourGatekeeper extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, PRICE);
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
}
}
else
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
index 0898d8dbc5..088b261fbe 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
@@ -16,6 +16,7 @@
*/
package events.MasterOfEnchanting;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -86,7 +87,7 @@ public class MasterOfEnchanting extends LongTimeEvent
}
else if (event.equalsIgnoreCase("buy_scroll_24"))
{
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
final String value = player.getVariables().getString("MasterOfEnchanting", "");
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
@@ -100,7 +101,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
@@ -134,7 +135,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/SavingSanta/SavingSanta.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
index 4f95514f8c..b6900127dc 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -324,7 +325,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_rewardedPlayers.containsKey(pl.getAccountName()))
{
- final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
+ final long elapsedTimeSinceLastRewarded = Chronos.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
{
continue;
@@ -333,7 +334,7 @@ public class SavingSanta extends LongTimeEvent
else
{
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
- if ((System.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
+ if ((Chronos.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
{
_rewardedPlayers.put(pl.getAccountName(), time);
continue;
@@ -343,8 +344,8 @@ public class SavingSanta extends LongTimeEvent
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
- _rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
- player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
+ _rewardedPlayers.put(pl.getAccountName(), Chronos.currentTimeMillis());
+ player.getVariables().set("LAST_SANTA_REWARD", Chronos.currentTimeMillis());
startQuestTimer("SantaRewarding0", 500, santa, pl);
}
}
@@ -437,7 +438,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
{
startQuestTimer("SantaBlessings", 15000, null, null);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Npc santaHelper1 : _santaHelpers)
{
for (PlayerInstance plb : World.getInstance().getVisibleObjects(santaHelper1, PlayerInstance.class))
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
index 64d4112e1f..729838d853 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Collection;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.CursedWeapon;
@@ -209,7 +210,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
}
- cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
+ cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
cw.reActivate();
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
index 9801093a20..0e4285c8e3 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Calendar;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -66,7 +67,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
{
final Calendar nextChangeDate = Calendar.getInstance();
- nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
+ nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
html.replace("%sodtime%", nextChangeDate.getTime().toString());
}
else
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
index e2c17e3d50..dec3cec950 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,7 +119,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
int hours = 0;
int minutes = 0;
final int id = entry.getKey();
- final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
if (remainingTime > 0)
{
hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
index 5fffc77ae3..8c3faede2d 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -233,7 +234,7 @@ public class AdminPunishment implements IAdminCommandHandler
long expirationTime = Integer.parseInt(exp);
if (expirationTime > 0)
{
- expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
+ expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
}
final PunishmentAffect affect = PunishmentAffect.getByName(af);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
index aa1d6dd435..ae1bb4e0b2 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -60,7 +61,7 @@ public class AdminServerInfo implements IAdminCommandHandler
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
- html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
+ html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
html.replace("%serverUpTime%", getServerUpTime());
html.replace("%onlineAll%", getPlayersCount("ALL"));
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
@@ -76,7 +77,7 @@ public class AdminServerInfo implements IAdminCommandHandler
private String getServerUpTime()
{
- long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
+ long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
final long days = TimeUnit.MILLISECONDS.toDays(time);
time -= TimeUnit.DAYS.toMillis(days);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
index ff3b82a10f..21489c89f6 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IBypassHandler;
@@ -133,7 +134,7 @@ public class FindPvP implements IBypassHandler
player.setSpawnProtection(true);
if (!player.isGM())
{
- player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
player.startPvPFlag();
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
index a81161c50a..adb3c27701 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.dailymissionhandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -61,9 +62,9 @@ public class LoginMonthDailyMissionHandler extends AbstractDailyMissionHandler
final long lastCompleted = entry.getLastCompleted();
if (lastCompleted == 0) // Initial entry.
{
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
}
- else if ((System.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
+ else if ((Chronos.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
index 9fee9dd50e..0322107487 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
@@ -18,6 +18,7 @@ package handlers.dailymissionhandlers;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -63,7 +64,7 @@ public class LoginWeekendDailyMissionHandler extends AbstractDailyMissionHandler
final int currentDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
final long lastCompleted = entry.getLastCompleted();
if (((currentDay == Calendar.SATURDAY) || (currentDay == Calendar.SUNDAY)) // Reward only on weekend.
- && ((lastCompleted == 0) || ((System.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
+ && ((lastCompleted == 0) || ((Chronos.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
index 71928b144a..c2ea6f7a5a 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.punishmenthandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.model.World;
@@ -126,7 +127,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
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 245af11bfa..2abbe8e8e8 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
@@ -17,6 +17,7 @@
package handlers.punishmenthandlers;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
@@ -180,7 +181,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
index 3dd1cdc97d..fd92c92ed9 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Ban implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
index f653561c0d..85b92a163b 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class BanChat implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
index cf3736fc0e..c21718ad0c 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Jail implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
index 43b6df41dc..a57194664d 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
@@ -18,6 +18,7 @@ package handlers.usercommandhandlers;
import java.text.SimpleDateFormat;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -46,7 +47,7 @@ public class ClanPenalty implements IUserCommandHandler
final StringBuilder htmlContent = new StringBuilder(500);
htmlContent.append("");
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append("Unable to join a clan. | ");
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
@@ -54,7 +55,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append(" | Unable to create a clan. | ");
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
@@ -62,7 +63,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
+ if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
{
htmlContent.append(" | Unable to invite a clan member. | ");
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/usercommandhandlers/Time.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
index 530047a4f2..57bd48cd81 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Time implements IUserCommandHandler
player.sendPacket(sm);
if (Config.DISPLAY_SERVER_TIME)
{
- player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
+ player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
}
return true;
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
index a2eab150c7..f727b3518f 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
@@ -18,6 +18,7 @@ package handlers.voicedcommandhandlers;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
@@ -103,7 +104,7 @@ public class ChatAdmin implements IVoicedCommandHandler
return false;
}
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
if (expirationTime > 0)
{
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
index 213e03e20a..5bf36c47d0 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
@@ -19,6 +19,7 @@ package handlers.voicedcommandhandlers;
import java.text.SimpleDateFormat;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Premium implements IVoicedCommandHandler
html.append(" |
Spoil Chance: x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " |
");
html.append("Spoil Amount: x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " |
");
html.append("Expires: " + format.format(endDate) + " |
");
- html.append("Current Date: " + format.format(System.currentTimeMillis()) + "
|
");
+ html.append("Current Date: " + format.format(Chronos.currentTimeMillis()) + "
|
");
html.append("Premium Info & Rules
|
");
html.append("1. Premium accounts CAN NOT BE TRANSFERED. |
");
html.append("2. Premium does not effect party members. |
");
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 4dedee6473..6a07191990 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
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -156,7 +157,7 @@ public class CastleDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -174,7 +175,7 @@ public class CastleDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
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 686b01379b..ea8ca11b83 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
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -169,7 +170,7 @@ public class FortressDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -197,7 +198,7 @@ public class FortressDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
index 298c540332..cba8d2bb56 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
@@ -469,7 +470,7 @@ public class Kamaloka extends AbstractInstance
continue;
}
// if found instance still can't be reentered - exit
- if (System.currentTimeMillis() < entry.getValue().longValue())
+ if (Chronos.currentTimeMillis() < entry.getValue().longValue())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
sm.addPcName(partyMember);
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
index b3de2f227a..31fa72d28c 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
@@ -260,7 +261,7 @@ public class PailakaRuneCastle extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first wave
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
}
@@ -280,7 +281,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
@@ -309,7 +310,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/Chronos.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/Chronos.java
new file mode 100644
index 0000000000..a4d15f77e5
--- /dev/null
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/Chronos.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2021 Pantelis Andrianakis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.l2jmobius.commons.util;
+
+/**
+ * Chronos updates an internal long value with System.currentTimeMillis() approximately every 1 millisecond.
+ * To get the current time in milliseconds use Chronos.currentTimeMillis()
+ * @author Pantelis Andrianakis
+ * @version February 3rd 2021
+ */
+public class Chronos extends Thread
+{
+ private long _currentTimeMillis = System.currentTimeMillis();
+
+ public Chronos()
+ {
+ super.setName("Chronos");
+ super.setPriority(MAX_PRIORITY);
+ super.setDaemon(true);
+ super.start();
+ }
+
+ @Override
+ public void run()
+ {
+ while (true)
+ {
+ _currentTimeMillis = System.currentTimeMillis();
+
+ // Sleep for approximately 1 millisecond.
+ try
+ {
+ Thread.sleep(1);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /**
+ * Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond,the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
+ *
+ * See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).
+ * @return the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+ */
+ public static long currentTimeMillis()
+ {
+ return getInstance()._currentTimeMillis;
+ }
+
+ public static Chronos getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final Chronos INSTANCE = new Chronos();
+ }
+}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/GameServer.java
index 85652fbcbf..6e6044e866 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/GameServer.java
@@ -32,6 +32,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.enums.ServerMode;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.DeadLockDetector;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.BotReportTable;
@@ -180,7 +181,7 @@ public class GameServer
public GameServer() throws Exception
{
- final long serverLoadStart = System.currentTimeMillis();
+ final long serverLoadStart = Chronos.currentTimeMillis();
// GUI
if (!GraphicsEnvironment.isHeadless())
@@ -461,7 +462,7 @@ public class GameServer
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
- LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
+ LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
ClientNetworkManager.getInstance().start();
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/GameTimeController.java
index aa4d359090..48391b466d 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/GameTimeController.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange;
@@ -97,7 +98,7 @@ public class GameTimeController extends Thread
*/
public int getGameTicks()
{
- return (int) ((System.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
+ return (int) ((Chronos.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
}
/**
@@ -155,7 +156,7 @@ public class GameTimeController extends Thread
while (true)
{
- nextTickTime = ((System.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
+ nextTickTime = ((Chronos.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
try
{
@@ -166,7 +167,7 @@ public class GameTimeController extends Thread
LOGGER.log(Level.WARNING, getClass().getSimpleName(), e);
}
- sleepTime = nextTickTime - System.currentTimeMillis();
+ sleepTime = nextTickTime - Chronos.currentTimeMillis();
if (sleepTime > 0)
{
try
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
index 2fcae24603..cfb16ebb07 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -42,7 +43,7 @@ public class ItemsAutoDestroy
public synchronized void addItem(ItemInstance item)
{
- item.setDropTime(System.currentTimeMillis());
+ item.setDropTime(Chronos.currentTimeMillis());
_items.add(item);
}
@@ -53,7 +54,7 @@ public class ItemsAutoDestroy
return;
}
- final long curtime = System.currentTimeMillis();
+ final long curtime = Chronos.currentTimeMillis();
final Iterator itemIterator = _items.iterator();
while (itemIterator.hasNext())
{
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/Shutdown.java
index 5279bac36d..d7328247aa 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/Shutdown.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseBackup;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
@@ -529,19 +530,19 @@ public class Shutdown extends Thread
protected void restartCounter()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
}
protected long getEstimatedTimeAndRestartCounter()
{
- final long toReturn = System.currentTimeMillis() - _startTime;
+ final long toReturn = Chronos.currentTimeMillis() - _startTime;
restartCounter();
return toReturn;
}
protected long getEstimatedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/CreatureAI.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/CreatureAI.java
index 22de59f51a..e03e0463be 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/CreatureAI.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/CreatureAI.java
@@ -33,6 +33,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -308,7 +309,7 @@ public class CreatureAI extends AbstractAI
if (_actor.isAttackingNow())
{
- ThreadPool.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(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index fa5cca3384..26734231aa 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -39,7 +40,7 @@ public class WarehouseCacheManager
public void addCacheTask(PlayerInstance pc)
{
- CACHED_WH.put(pc, System.currentTimeMillis());
+ CACHED_WH.put(pc, Chronos.currentTimeMillis());
}
public void remCacheTask(PlayerInstance pc)
@@ -56,7 +57,7 @@ public class WarehouseCacheManager
@Override
public void run()
{
- final long cTime = System.currentTimeMillis();
+ final long cTime = Chronos.currentTimeMillis();
for (Entry entry : CACHED_WH.entrySet())
{
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/BotReportTable.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/BotReportTable.java
index 2dd2c9abf7..6c7daf4120 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/BotReportTable.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/BotReportTable.java
@@ -39,6 +39,7 @@ import org.xml.sax.helpers.DefaultHandler;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -124,7 +125,7 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() < c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() < c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
}
@@ -290,7 +291,7 @@ public class BotReportTable
return false;
}
- final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
+ final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
@@ -301,7 +302,7 @@ public class BotReportTable
}
}
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
if (rcd == null)
{
rcd = new ReportedCharData();
@@ -418,12 +419,12 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() > c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() > c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
}
- ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
+ ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - Chronos.currentTimeMillis());
}
catch (Exception e)
{
@@ -464,7 +465,7 @@ public class BotReportTable
{
if (map.containsKey(objectId))
{
- return (System.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
+ return (Chronos.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
}
return true;
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/sql/ClanTable.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
index 5fb42b9474..abf7ab1714 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.enums.ClanWarState;
@@ -171,7 +172,7 @@ public class ClanTable
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
return null;
}
- if (System.currentTimeMillis() < player.getClanCreateExpiryTime())
+ if (Chronos.currentTimeMillis() < player.getClanCreateExpiryTime())
{
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
return null;
@@ -346,7 +347,7 @@ public class ClanTable
{
destroyClan(clanId);
}
- }, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
+ }, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
}
public boolean isAllyExists(String allyName)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index a0110c454b..3d8844ae9f 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem;
@@ -183,7 +184,7 @@ public class OfflineTraderTable
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- if (cal.getTimeInMillis() <= System.currentTimeMillis())
+ if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
{
continue;
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
index 1673fb1298..22f94dd7e9 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
import org.l2jmobius.gameserver.model.DailyMissionPlayerEntry;
@@ -101,7 +102,7 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
final DailyMissionPlayerEntry entry = getPlayerEntry(player.getObjectId(), true);
entry.setStatus(DailyMissionStatus.COMPLETED);
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
storePlayerEntry(entry);
return true;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
index 025c3208e6..ecb5b8dc95 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.enums.PlayerAction;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -115,7 +116,7 @@ public class AdminCommandHandler implements IHandler
{
- final long begin = System.currentTimeMillis();
+ final long begin = Chronos.currentTimeMillis();
try
{
if (Config.GMAUDIT)
@@ -133,7 +134,7 @@ public class AdminCommandHandler implements IHandler 5000)
{
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
index fedf7cd9dc..ee7642eca5 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -48,7 +49,7 @@ public class AntiFeedManager
*/
public void setLastDeathTime(int objectId)
{
- _lastDeathTimes.put(objectId, System.currentTimeMillis());
+ _lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
}
/**
@@ -81,7 +82,7 @@ public class AntiFeedManager
return false;
}
- if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
+ if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((Chronos.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
{
return false;
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index 3d8c1f50e4..301806d976 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ManorMode;
@@ -276,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
- ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
+ ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
}
public void changeMode()
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
index 4a91b5c214..64143c7c65 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.model.CursedWeapon;
import org.l2jmobius.gameserver.model.actor.Attackable;
@@ -313,7 +314,7 @@ public class CursedWeaponsManager implements IXmlReader
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING);
sm.addString(cw.getName());
// sm.addItemName(cw.getItemId());
- sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
+ sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
player.sendPacket(sm);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index 72602e0968..babf2e1476 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -193,7 +194,7 @@ public class DBSpawnManager
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
- final long respawnTime = System.currentTimeMillis() + respawnDelay;
+ final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
info.set("currentHP", npc.getMaxHp());
info.set("currentMP", npc.getMaxMp());
info.set("respawnTime", respawnTime);
@@ -235,7 +236,7 @@ public class DBSpawnManager
}
final int npcId = spawn.getId();
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SpawnTable.getInstance().addNewSpawn(spawn, false);
if ((respawnTime == 0) || (time > respawnTime))
{
@@ -257,7 +258,7 @@ public class DBSpawnManager
}
else
{
- final long spawnTime = respawnTime - System.currentTimeMillis();
+ final long spawnTime = respawnTime - Chronos.currentTimeMillis();
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index 60a818cab6..06cce0d3a3 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -21,6 +21,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -104,7 +105,7 @@ public class GraciaSeedsManager
case 2:
{
// Conquest Complete state, if too much time is passed than change to defense state
- final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
+ final long timePast = Chronos.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
if (timePast >= Config.SOD_STAGE_2_LENGTH)
{
// change to Attack state because Defend statet is not implemented
@@ -172,7 +173,7 @@ public class GraciaSeedsManager
public void setSoDState(int value, boolean doSave)
{
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
- _SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
+ _SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
_SoDState = value;
// reset number of Tiat kills
if (_SoDState == 1)
@@ -198,7 +199,7 @@ public class GraciaSeedsManager
}
case 2:
{
- return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
+ return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
}
case 3:
{
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index d595a5befa..052f8984d2 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.util.PrimeFinder;
/**
@@ -85,7 +86,7 @@ public class IdManager
try (Connection con = DatabaseFactory.getConnection();
Statement statement = con.createStatement())
{
- final long cleanupStart = System.currentTimeMillis();
+ final long cleanupStart = Chronos.currentTimeMillis();
int cleanCount = 0;
// Characters
@@ -157,7 +158,7 @@ public class IdManager
statement.executeUpdate("UPDATE characters SET clanid=0, clan_privs=0, wantspeace=0, subpledge=0, lvl_joined_academy=0, apprentice=0, sponsor=0, clan_join_expiry_time=0, clan_create_expiry_time=0 WHERE characters.clanid > 0 AND characters.clanid NOT IN (SELECT clan_id FROM clan_data);");
statement.executeUpdate("UPDATE fort SET owner=0 WHERE owner NOT IN (SELECT clan_id FROM clan_data);");
- LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((System.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
+ LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((Chronos.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
}
catch (Exception e)
{
@@ -173,7 +174,7 @@ public class IdManager
{
try (PreparedStatement statement = con.prepareStatement(line))
{
- statement.setLong(1, System.currentTimeMillis());
+ statement.setLong(1, Chronos.currentTimeMillis());
cleanCount += statement.executeUpdate();
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
index d47e436ace..d1f8cd35e2 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
@@ -40,6 +40,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.data.xml.SpawnData;
@@ -521,7 +522,7 @@ public class InstanceManager implements IXmlReader
{
// Check if instance penalty passed
final long time = rs.getLong("time");
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
// Load params
final int charId = rs.getInt("charId");
@@ -556,7 +557,7 @@ public class InstanceManager implements IXmlReader
final List invalidPenalty = new ArrayList<>(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- if (entry.getValue() <= System.currentTimeMillis())
+ if (entry.getValue() <= Chronos.currentTimeMillis())
{
invalidPenalty.add(entry.getKey());
}
@@ -615,7 +616,7 @@ public class InstanceManager implements IXmlReader
// If reenter time is higher then current, delete it
final long time = playerData.get(id);
- if (time <= System.currentTimeMillis())
+ if (time <= Chronos.currentTimeMillis())
{
deleteInstanceTime(player, id);
return -1;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 739f67e9a9..dfb4734ca5 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -83,7 +84,7 @@ public class ItemsOnGroundManager implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(str))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.execute();
}
catch (Exception e)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
index df45860d40..d429a2f8c9 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Mentee;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -145,7 +146,7 @@ public class MentorManager
{
final PlayerInstance player = World.getInstance().getPlayer(mentorId);
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
- vars.set("Mentor-Penalty-" + mentorId, String.valueOf(System.currentTimeMillis() + penalty));
+ vars.set("Mentor-Penalty-" + mentorId, String.valueOf(Chronos.currentTimeMillis() + penalty));
}
public long getMentorPenalty(int mentorId)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 7768cebd95..ba4e95fe3f 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.Containers;
@@ -79,7 +80,7 @@ public class PremiumManager
final PlayerInstance player = event.getPlayer();
final String accountName = player.getAccountName();
loadPremiumData(accountName);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
final long premiumExpiration = getPremiumExpiration(accountName);
player.setPremiumStatus(premiumExpiration > now);
if (player.hasPremiumStatus())
@@ -153,7 +154,7 @@ public class PremiumManager
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
{
final long addTime = timeUnit.toMillis(timeValue);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
// new premium task at least from now
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
final long newPremiumExpiration = oldPremiumExpiration + addTime;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
index 9617f26e43..08193f9c5b 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
@@ -71,7 +72,7 @@ public class PunishmentManager
final String punishedBy = rset.getString("punishedBy");
if ((type != null) && (affect != null))
{
- if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
+ if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
{
expired++;
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
index 687d1288b9..ab73056bb1 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -424,7 +425,7 @@ public class BlockChecker
// Start up player parameters
setUpPlayers();
// Set the started time
- _startedTime = System.currentTimeMillis() + 300000;
+ _startedTime = Chronos.currentTimeMillis() + 300000;
}
}
@@ -524,7 +525,7 @@ public class BlockChecker
_redPoints += _numOfBoxes / 2;
_bluePoints += _numOfBoxes / 2;
- final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((_startedTime - Chronos.currentTimeMillis()) / 1000);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
_holder.broadCastPacketToTeam(changePoints);
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/CursedWeapon.java
index 07e4d9b6d6..cf80e1b21a 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/CursedWeapon.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
@@ -237,7 +238,7 @@ public class CursedWeapon implements INamable
@Override
public void run()
{
- if (System.currentTimeMillis() >= _endTime)
+ if (Chronos.currentTimeMillis() >= _endTime)
{
endOfLife();
}
@@ -366,7 +367,7 @@ public class CursedWeapon implements INamable
public void reActivate()
{
_isActivated = true;
- if ((_endTime - System.currentTimeMillis()) <= 0)
+ if ((_endTime - Chronos.currentTimeMillis()) <= 0)
{
endOfLife();
}
@@ -384,7 +385,7 @@ public class CursedWeapon implements INamable
dropIt(attackable, player);
// Start the Life Task
- _endTime = System.currentTimeMillis() + (_duration * 60000);
+ _endTime = Chronos.currentTimeMillis() + (_duration * 60000);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
return true;
}
@@ -678,7 +679,7 @@ public class CursedWeapon implements INamable
public long getTimeLeft()
{
- return _endTime - System.currentTimeMillis();
+ return _endTime - Chronos.currentTimeMillis();
}
public void goTo(PlayerInstance player)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/ItemInfo.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/ItemInfo.java
index 9ea4c13763..16f3dfe23e 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/ItemInfo.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/ItemInfo.java
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.model.buylist.Product;
import org.l2jmobius.gameserver.model.ensoul.EnsoulOption;
@@ -151,14 +152,14 @@ public class ItemInfo
_soulCrystalOptions = item.getSpecialAbilities();
_soulCrystalSpecialOptions = item.getAdditionalSpecialAbilities();
_visualId = item.getVisualId();
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(ItemInstance item, int change)
{
this(item);
_change = change;
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(TradeItem item)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Message.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Message.java
index e6b1c31d32..53d2f20768 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Message.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Message.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.enums.MailType;
@@ -104,7 +105,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = text;
- _expiration = (isCod ? System.currentTimeMillis() + (COD_EXPIRATION * 3600000) : System.currentTimeMillis() + (EXPIRATION * 3600000));
+ _expiration = (isCod ? Chronos.currentTimeMillis() + (COD_EXPIRATION * 3600000) : Chronos.currentTimeMillis() + (EXPIRATION * 3600000));
_hasAttachments = false;
_unread = true;
_deletedBySender = false;
@@ -123,7 +124,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_reqAdena = 0;
_hasAttachments = false;
_unread = true;
@@ -143,7 +144,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_hasAttachments = false;
_unread = true;
_deletedBySender = true;
@@ -162,7 +163,7 @@ public class Message
_receiverId = msg.getSenderId();
_subject = "";
_content = "";
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_deletedByReceiver = false;
@@ -182,7 +183,7 @@ public class Message
_receiverId = receiverId;
_subject = "";
_content = item.getName();
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_messageType = mailType;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Petition.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Petition.java
index b19b6f9025..d3f95461ac 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Petition.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Petition.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PetitionState;
import org.l2jmobius.gameserver.enums.PetitionType;
import org.l2jmobius.gameserver.instancemanager.IdManager;
@@ -36,7 +37,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class Petition
{
- private final long _submitTime = System.currentTimeMillis();
+ private final long _submitTime = Chronos.currentTimeMillis();
private final int _id;
private final PetitionType _type;
private PetitionState _state = PetitionState.PENDING;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Spawn.java
index 4a1a2926b3..eb57e4e69b 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -258,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
_scheduledCount++;
// Schedule the next respawn.
- RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
+ RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/TimeStamp.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/TimeStamp.java
index 8c232969e0..9bdb39d293 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/TimeStamp.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/TimeStamp.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -52,7 +53,7 @@ public class TimeStamp
_id2 = skill.getLevel();
_id3 = skill.getSubLevel();
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = -1;
}
@@ -68,7 +69,7 @@ public class TimeStamp
_id2 = item.getObjectId();
_id3 = 0;
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = item.getSharedReuseGroup();
}
@@ -155,7 +156,7 @@ public class TimeStamp
{
return 0;
}
- final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
+ final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
if (remainingTime == 0)
{
_stamp = 0;
@@ -173,7 +174,7 @@ public class TimeStamp
{
return false;
}
- final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
+ final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
if (!hasNotPassed)
{
_stamp = 0;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java
index 0410084704..e39ed646e7 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.AttackableAI;
import org.l2jmobius.gameserver.ai.CreatureAI;
@@ -216,7 +217,7 @@ public class Attackable extends Npc
if (_firstCommandChannelAttacked != null)
{
_commandChannelTimer = new CommandChannelTimer(this);
- _commandChannelLastAttack = System.currentTimeMillis();
+ _commandChannelLastAttack = Chronos.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
@@ -225,7 +226,7 @@ public class Attackable extends Npc
}
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
{
- _commandChannelLastAttack = System.currentTimeMillis(); // update last attack time
+ _commandChannelLastAttack = Chronos.currentTimeMillis(); // update last attack time
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java
index c5fbce130c..32bca5211c 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -41,6 +41,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.EmptyQueue;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -1393,7 +1394,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : _reuseTimeStampsItems.values())
{
if (ts.getSharedReuseGroup() == group)
@@ -1523,7 +1524,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return;
}
- _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? System.currentTimeMillis() + delay : Long.MAX_VALUE);
+ _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? Chronos.currentTimeMillis() + delay : Long.MAX_VALUE);
}
/**
@@ -1571,7 +1572,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return false;
}
- if (stamp < System.currentTimeMillis())
+ if (stamp < Chronos.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java
index 62f1d1049f..d288fe8816 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -203,7 +204,7 @@ public class Npc extends Creature
public void onRandomAnimation(int animationId)
{
// Send a packet SocialAction to all PlayerInstance in the _KnownPlayers of the NpcInstance
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
{
_lastSocialBroadcast = now;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
index 7eacda4aa1..c87a2006a9 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.actor.instance;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
@@ -141,7 +142,7 @@ public class BlockInstance extends MonsterInstance
{
eng.increasePlayerPoints(player, team);
- final int timeLeft = (int) ((eng.getStarterTime() - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((eng.getStarterTime() - Chronos.currentTimeMillis()) / 1000);
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints());
final ExCubeGameExtendedChangePoints secretPoints = new ExCubeGameExtendedChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints(), isRed, player, eng.getPlayerPoints(player, isRed));
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 7be0986165..c1f5b35eba 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -46,6 +46,7 @@ import java.util.stream.Collectors;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -2840,7 +2841,7 @@ public class PlayerInstance extends Playable
public void setOnlineTime(long time)
{
_onlineTime = time;
- _onlineBeginTime = System.currentTimeMillis();
+ _onlineBeginTime = Chronos.currentTimeMillis();
}
/**
@@ -3899,22 +3900,22 @@ public class PlayerInstance extends Playable
public boolean isSpawnProtected()
{
- return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
+ return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
}
public boolean isTeleportProtected()
{
- return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
+ return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
}
public void setSpawnProtection(boolean protect)
{
- _spawnProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
+ _spawnProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
}
public void setTeleportProtection(boolean protect)
{
- _teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
+ _teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
}
/**
@@ -5239,7 +5240,7 @@ public class PlayerInstance extends Playable
{
return;
}
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
if (_pvpFlag == 0)
{
startPvPFlag();
@@ -5272,11 +5273,11 @@ public class PlayerInstance extends Playable
{
if (checkIfPvP(targetPlayer))
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
}
else
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
}
if (_pvpFlag == 0)
{
@@ -6154,7 +6155,7 @@ public class PlayerInstance extends Playable
public long getUptime()
{
- return System.currentTimeMillis() - _uptime;
+ return Chronos.currentTimeMillis() - _uptime;
}
/**
@@ -6398,7 +6399,7 @@ public class PlayerInstance extends Playable
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
{
statement.setInt(1, isOnlineInt());
- statement.setLong(2, System.currentTimeMillis());
+ statement.setLong(2, Chronos.currentTimeMillis());
statement.setInt(3, getObjectId());
statement.execute();
}
@@ -6524,12 +6525,12 @@ public class PlayerInstance extends Playable
}
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
- if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanJoinExpiryTime(0);
}
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
- if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanCreateExpiryTime(0);
}
@@ -6591,7 +6592,7 @@ public class PlayerInstance extends Playable
player.getAppearance().setTitleColor(titleColor);
}
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
- player.setUptime(System.currentTimeMillis());
+ player.setUptime(Chronos.currentTimeMillis());
currentHp = rset.getDouble("curHp");
currentCp = rset.getDouble("curCp");
@@ -7108,7 +7109,7 @@ public class PlayerInstance extends Playable
long totalOnlineTime = _onlineTime;
if (_onlineBeginTime > 0)
{
- totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
+ totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
}
statement.setLong(34, totalOnlineTime);
@@ -7194,7 +7195,7 @@ public class PlayerInstance extends Playable
int buffIndex = 0;
final List storedSkills = new ArrayList<>();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
// Store all effect data along with calulated remaining
// reuse delays for matching skills. 'restore_type'= 0.
@@ -7309,7 +7310,7 @@ public class PlayerInstance extends Playable
ps1.setInt(1, getObjectId());
ps1.execute();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : getItemReuseTimeStamps().values())
{
if ((ts != null) && (currentTime < ts.getStamp()))
@@ -7632,7 +7633,7 @@ public class PlayerInstance extends Playable
statement.setInt(2, _classIndex);
try (ResultSet rset = statement.executeQuery())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
final int remainingTime = rset.getInt("remaining_time");
@@ -7694,7 +7695,7 @@ public class PlayerInstance extends Playable
long systime;
boolean isInInventory;
long remainingTime;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
itemId = rset.getInt("itemId");
@@ -7769,7 +7770,7 @@ public class PlayerInstance extends Playable
{
int slot;
int symbolId;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
slot = rset.getInt("slot");
@@ -7892,7 +7893,7 @@ public class PlayerInstance extends Playable
// Send Server->Client UserInfo packet to this PlayerInstance
broadcastUserInfo(UserInfoType.BASE_STATS, UserInfoType.MAX_HPCPMP, UserInfoType.STATS, UserInfoType.SPEED);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long timeLeft = getVariables().getLong("HennaDuration" + slot, currentTime) - currentTime;
if ((henna.getDuration() < 0) || (timeLeft > 0))
{
@@ -7983,7 +7984,7 @@ public class PlayerInstance extends Playable
// Task for henna duration
if (henna.getDuration() > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
@@ -12445,7 +12446,7 @@ public class PlayerInstance extends Playable
public int getBirthdays()
{
- long time = (System.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
+ long time = (Chronos.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
time /= TimeUnit.DAYS.toMillis(365);
return (int) time;
}
@@ -12686,7 +12687,7 @@ public class PlayerInstance extends Playable
return false;
}
- if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
+ if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@@ -12746,7 +12747,7 @@ public class PlayerInstance extends Playable
*/
public void setFalling()
{
- _fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
+ _fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
}
/**
@@ -12767,7 +12768,7 @@ public class PlayerInstance extends Playable
*/
public void updateLastItemAuctionRequest()
{
- _lastItemAuctionInfoRequest = System.currentTimeMillis();
+ _lastItemAuctionInfoRequest = Chronos.currentTimeMillis();
}
/**
@@ -12776,7 +12777,7 @@ public class PlayerInstance extends Playable
*/
public boolean isItemAuctionPolling()
{
- return (System.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
+ return (Chronos.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
}
@Override
@@ -13160,7 +13161,7 @@ public class PlayerInstance extends Playable
public void updateNotMoveUntil()
{
- _notMoveUntil = System.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
+ _notMoveUntil = Chronos.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
}
@Override
@@ -14200,7 +14201,7 @@ public class PlayerInstance extends Playable
public boolean isInTraingCamp()
{
final TrainingHolder trainingHolder = getTraingCampInfo();
- return (trainingHolder != null) && (trainingHolder.getEndTime() > System.currentTimeMillis());
+ return (trainingHolder != null) && (trainingHolder.getEndTime() > Chronos.currentTimeMillis());
}
public AttendanceInfoHolder getAttendanceInfo()
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
index 7d586645f8..a667254408 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
@@ -22,6 +22,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.AcquireSkillType;
@@ -35,9 +36,9 @@ import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.Clan.SubPledge;
+import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.siege.Castle;
import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -338,13 +339,13 @@ public class VillageMasterInstance extends NpcInstance
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
return;
}
- clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setDissolvingExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
// The clan leader should take the XP penalty of a full death.
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 843165d245..18d77105c7 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.attackable;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
/**
@@ -40,7 +41,7 @@ public class CommandChannelTimer implements Runnable
return;
}
- if ((System.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
+ if ((Chronos.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
{
_attackable.setCommandChannelTimer(null);
_attackable.setFirstCommandChannelAttacked(null);
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
index e2130407ac..290e49a99f 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.player;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -92,12 +93,12 @@ public class IllegalPlayerActionTask implements Runnable
}
case KICKBAN:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
case JAIL:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/buylist/Product.java
index 0782846eba..3fc18a73e3 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/buylist/Product.java
@@ -25,6 +25,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.type.EtcItemType;
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
@@ -134,7 +135,7 @@ public class Product
public void restartRestockTask(long nextRestockTime)
{
- final long remainTime = nextRestockTime - System.currentTimeMillis();
+ final long remainTime = nextRestockTime - Chronos.currentTimeMillis();
if (remainTime > 0)
{
BuyListTaskManager.getInstance().update(this, remainTime);
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
index 1ccabadff3..1355481e68 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
import org.l2jmobius.gameserver.enums.QuestSound;
@@ -278,7 +279,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
});
}
}
- _battleStartTime = System.currentTimeMillis();
+ _battleStartTime = Chronos.currentTimeMillis();
getTimers().addRepeatingTimer("update", 1000, null, null);
}
@@ -505,7 +506,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
private void updateLifeTime(CeremonyOfChaosMember member)
{
- member.setLifeTime(((int) (System.currentTimeMillis() - _battleStartTime) / 1000));
+ member.setLifeTime(((int) (Chronos.currentTimeMillis() - _battleStartTime) / 1000));
}
public List getWinners()
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/clan/Clan.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/clan/Clan.java
index 7df3de05ce..d76dcec76f 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/clan/Clan.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/clan/Clan.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -498,7 +499,7 @@ public class Clan implements IIdentifiable, INamable
if (player.isClanLeader())
{
SiegeManager.getInstance().removeSiegeSkills(player);
- player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ player.setClanCreateExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
}
// remove Clan skills from Player
@@ -531,7 +532,7 @@ public class Clan implements IIdentifiable, INamable
}
else
{
- removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
+ removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
}
// Notify to scripts
@@ -1091,12 +1092,12 @@ public class Clan implements IIdentifiable, INamable
setAllyId(clanData.getInt("ally_id"));
setAllyName(clanData.getString("ally_name"));
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
- if (_allyPenaltyExpiryTime < System.currentTimeMillis())
+ if (_allyPenaltyExpiryTime < Chronos.currentTimeMillis())
{
setAllyPenaltyExpiryTime(0, 0);
}
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
- if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
+ if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < Chronos.currentTimeMillis()) // 24*60*60*1000 = 86400000
{
setCharPenaltyExpiryTime(0);
}
@@ -2207,7 +2208,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
return false;
}
- if (_charPenaltyExpiryTime > System.currentTimeMillis())
+ if (_charPenaltyExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return false;
@@ -2219,7 +2220,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (target.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (target.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(target.getName());
@@ -2268,7 +2269,7 @@ public class Clan implements IIdentifiable, INamable
return false;
}
final Clan leaderClan = player.getClan();
- if (leaderClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (leaderClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN)
{
@@ -2307,7 +2308,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
{
@@ -2401,12 +2402,12 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
return;
}
- if ((_allyPenaltyExpiryTime > System.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
+ if ((_allyPenaltyExpiryTime > Chronos.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
return;
}
- if (_dissolvingExpiryTime > System.currentTimeMillis())
+ if (_dissolvingExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
return;
@@ -2458,7 +2459,7 @@ public class Clan implements IIdentifiable, INamable
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
{
if (clan.getId() != getId())
@@ -2484,7 +2485,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
return false;
}
- if (System.currentTimeMillis() < _dissolvingExpiryTime)
+ if (Chronos.currentTimeMillis() < _dissolvingExpiryTime)
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
return false;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/clan/ClanWar.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
index 22b82ab179..ebb01d6c06 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -54,9 +55,9 @@ public class ClanWar
{
_attackerClanId = attacker.getId();
_attackedClanId = attacked.getId();
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_state = ClanWarState.BLOOD_DECLARATION;
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
attacker.addWar(attacked.getId(), this);
attacked.addWar(attacker.getId(), this);
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
@@ -79,15 +80,15 @@ public class ClanWar
_attackerKillCount.set(attackerKillCount);
_attackedKillCount.set(attackedKillCount);
_winnerClanId = winnerClan;
- if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > System.currentTimeMillis())
+ if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > Chronos.currentTimeMillis())
{
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
}
if (_endTime > 0)
{
final long endTimePeriod = _endTime + (_state == ClanWarState.TIE ? TIME_TO_DELETION_AFTER_CANCELLATION : TIME_TO_DELETION_AFTER_DEFEAT);
- if (endTimePeriod > System.currentTimeMillis())
+ if (endTimePeriod > Chronos.currentTimeMillis())
{
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(_attackerClanId, _attackedClanId), 10000);
}
@@ -177,8 +178,8 @@ public class ClanWar
winnerClan.broadcastToOnlineMembers(sm);
_winnerClanId = winnerClan.getId();
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - Chronos.currentTimeMillis());
}
public void clanWarTimeout()
@@ -196,8 +197,8 @@ public class ClanWar
attackerClan.broadcastToOnlineMembers(sm);
_state = ClanWarState.TIE;
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - Chronos.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index f150ec3238..b1b3a83fd1 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.StatSet;
import it.sauronsoftware.cron4j.PastPredictor;
@@ -112,7 +113,7 @@ public class EventScheduler
final Predictor predictor = new Predictor(_pattern);
final long nextSchedule = predictor.nextMatchingTime();
- final long timeSchedule = nextSchedule - System.currentTimeMillis();
+ final long timeSchedule = nextSchedule - Chronos.currentTimeMillis();
if (timeSchedule <= (30 * 1000))
{
LOGGER.warning("Wrong reschedule for " + _eventManager.getClass().getSimpleName() + " end up run in " + (timeSchedule / 1000) + " seconds!");
@@ -144,10 +145,10 @@ public class EventScheduler
{
ps.setString(1, _eventManager.getName());
ps.setString(2, _name);
- ps.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(3, new Timestamp(Chronos.currentTimeMillis()));
ps.setString(4, _eventManager.getName());
ps.setString(5, _name);
- ps.setTimestamp(6, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(6, new Timestamp(Chronos.currentTimeMillis()));
ps.execute();
return true;
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/events/EventType.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/events/EventType.java
index aa64ab0744..eebca64a89 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/events/EventType.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/events/EventType.java
@@ -76,7 +76,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
@@ -84,8 +83,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaR
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemAdd;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDestroy;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDrop;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemTransfer;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
@@ -114,7 +115,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
index 77e7205bfa..6139454534 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -85,7 +86,7 @@ public class TrainingHolder implements Serializable
public long getElapsedTime()
{
- return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
+ return TimeUnit.SECONDS.convert(Chronos.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
index 6c9ca907b7..62649739ea 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -39,6 +39,7 @@ import java.util.stream.Stream;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -105,7 +106,7 @@ public class Instance implements IIdentifiable, INamable
// Set basic instance info
_id = id;
_template = template;
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_spawns = new ArrayList<>(template.getSpawns().size());
// Clone and add the spawn templates
@@ -755,7 +756,7 @@ public class Instance implements IIdentifiable, INamable
}
// Set new cleanup task
- _endTime = System.currentTimeMillis() + millis;
+ _endTime = Chronos.currentTimeMillis() + millis;
if (minutes < 1) // Destroy instance
{
destroy();
@@ -858,7 +859,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getElapsedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
/**
@@ -867,7 +868,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getRemainingTime()
{
- return (_endTime == -1) ? -1 : (_endTime - System.currentTimeMillis());
+ return (_endTime == -1) ? -1 : (_endTime - Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
index 973dab1661..84466d8e0a 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.GroupType;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -547,7 +548,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
{
if (data.getTime() > 0)
{
- time = System.currentTimeMillis() + data.getTime();
+ time = Chronos.currentTimeMillis() + data.getTime();
break;
}
@@ -557,7 +558,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
calendar.set(Calendar.SECOND, 0);
// If calendar time is lower than current, add one more day
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
@@ -574,7 +575,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Set exact day. If modified date is before current, add one more week.
calendar.set(Calendar.DAY_OF_WEEK, day);
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.WEEK_OF_MONTH, 1);
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
index 1850d30783..07ce5a3538 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.instancezone.conditions;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -39,6 +40,6 @@ public class ConditionReenter extends Condition
protected boolean test(PlayerInstance player, Npc npc)
{
final int instanceId = getParameters().getInt("instanceId", getInstanceTemplate().getId());
- return System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
+ return Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index dc7bc9fba9..f852953226 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.ItemInfo;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -181,12 +182,12 @@ public class ItemAuction
public long getStartingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public long getFinishingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public void storeMe()
@@ -339,7 +340,7 @@ public class ItemAuction
_highestBid = bid;
}
- if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
+ if ((_endingTime - Chronos.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
{
switch (_auctionEndingExtendState)
{
@@ -426,7 +427,7 @@ public class ItemAuction
}
case FINISHED:
{
- if (_startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
+ if (_startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
{
return false;
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 8d81451dc9..f14581064a 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -243,7 +244,7 @@ public class ItemAuctionInstance
{
case 0:
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
case 1:
@@ -252,10 +253,10 @@ public class ItemAuctionInstance
{
case CREATED:
{
- if (auctions[0].getStartingTime() < (System.currentTimeMillis() + START_TIME_SPACE))
+ if (auctions[0].getStartingTime() < (Chronos.currentTimeMillis() + START_TIME_SPACE))
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
else
{
@@ -266,13 +267,13 @@ public class ItemAuctionInstance
case STARTED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, System.currentTimeMillis() + START_TIME_SPACE));
+ nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, Chronos.currentTimeMillis() + START_TIME_SPACE));
break;
}
case FINISHED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
default:
@@ -287,7 +288,7 @@ public class ItemAuctionInstance
{
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
// just to make sure we won't skip any auction because of little different times
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (ItemAuction auction : auctions)
{
if (auction.getAuctionState() == ItemAuctionState.STARTED)
@@ -311,7 +312,7 @@ public class ItemAuctionInstance
}
if (nextAuction == null)
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
break;
}
@@ -326,17 +327,17 @@ public class ItemAuctionInstance
{
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
}
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
}
}
@@ -422,7 +423,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -432,7 +433,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -442,7 +443,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -452,7 +453,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
}
@@ -577,7 +578,7 @@ public class ItemAuctionInstance
return null;
}
- if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
+ if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
{
LOGGER.info(getClass().getSimpleName() + ": Clearing expired auction: " + auctionId);
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
index 8a4746250e..71b6dde756 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData;
@@ -198,7 +199,7 @@ public class ItemInstance extends WorldObject
_type2 = 0;
_dropTime = 0;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -221,7 +222,7 @@ public class ItemInstance extends WorldObject
super.setName(_item.getName());
_loc = ItemLocation.VOID;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -1521,7 +1522,7 @@ public class ItemInstance extends WorldObject
setSpawned(true);
setXYZ(x, y, z);
- setDropTime(System.currentTimeMillis());
+ setDropTime(Chronos.currentTimeMillis());
setDropperObjectId(dropper != null ? dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
// Add the ItemInstance dropped in the world as a visible object
@@ -1800,7 +1801,7 @@ public class ItemInstance extends WorldObject
public long getRemainingTime()
{
- return _time - System.currentTimeMillis();
+ return _time - Chronos.currentTimeMillis();
}
public void endOfLife()
@@ -2421,7 +2422,7 @@ public class ItemInstance extends WorldObject
if (getVisualLifeTime() > 0)
{
final long endTime = getVisualLifeTime();
- if ((endTime - System.currentTimeMillis()) > 0)
+ if ((endTime - Chronos.currentTimeMillis()) > 0)
{
ItemAppearanceTaskManager.getInstance().add(this, endTime);
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index 4991fab60f..daf3fee27c 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -21,6 +21,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
@@ -84,7 +85,7 @@ public abstract class AbstractOlympiadGame
protected boolean makeCompetitionStart()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
return !_aborted;
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 10af0d183d..a0334635fe 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
@@ -765,7 +766,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", template.getName() + " was defeated");
@@ -786,7 +787,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", castle.getName() + " Castle was successfuly taken");
@@ -800,7 +801,7 @@ public class Hero
PreparedStatement ps = con.prepareStatement("INSERT INTO heroes_diary (charId, time, action, param) values(?,?,?,?)"))
{
ps.setInt(1, charId);
- ps.setLong(2, System.currentTimeMillis());
+ ps.setLong(2, Chronos.currentTimeMillis());
ps.setInt(3, action);
ps.setInt(4, param);
ps.execute();
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index 1c50093d46..29220e4e39 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,6 +27,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
@@ -548,7 +549,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
String winner = "draw";
// Calculate Fight time
- final long _fightTime = (System.currentTimeMillis() - _startTime);
+ final long _fightTime = (Chronos.currentTimeMillis() - _startTime);
double playerOneHp = 0;
if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index 119e447b15..4bb2fc156e 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.handler.PunishmentHandler;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
@@ -133,7 +134,7 @@ public class PunishmentTask implements Runnable
*/
public boolean isExpired()
{
- return (_expirationTime > 0) && (System.currentTimeMillis() > _expirationTime);
+ return (_expirationTime > 0) && (Chronos.currentTimeMillis() > _expirationTime);
}
/**
@@ -149,7 +150,7 @@ public class PunishmentTask implements Runnable
onStart();
if (_expirationTime > 0) // Has expiration?
{
- _task = ThreadPool.schedule(this, (_expirationTime - System.currentTimeMillis()));
+ _task = ThreadPool.schedule(this, (_expirationTime - Chronos.currentTimeMillis()));
}
}
@@ -226,7 +227,7 @@ public class PunishmentTask implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement st = con.prepareStatement(UPDATE_QUERY))
{
- st.setLong(1, System.currentTimeMillis());
+ st.setLong(1, Chronos.currentTimeMillis());
st.setLong(2, _id);
st.execute();
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 7c2d57fdc6..2e36bece7c 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -32,6 +32,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.EventDroplist;
import org.l2jmobius.gameserver.data.ItemTable;
@@ -100,7 +101,7 @@ public class LongTimeEvent extends Quest
}
else if (_eventPeriod.getStartDate().after(new Date()))
{
- final long delay = _eventPeriod.getStartDate().getTime() - System.currentTimeMillis();
+ final long delay = _eventPeriod.getStartDate().getTime() - Chronos.currentTimeMillis();
ThreadPool.schedule(new ScheduleStart(), delay);
LOGGER.info("Event " + _eventName + " will be started at " + _eventPeriod.getStartDate());
}
@@ -323,7 +324,7 @@ public class LongTimeEvent extends Quest
}
// Add spawns.
- final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - System.currentTimeMillis();
+ final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - Chronos.currentTimeMillis();
for (NpcSpawn spawn : _spawnList)
{
addSpawn(spawn.npcId, spawn.loc.getX(), spawn.loc.getY(), spawn.loc.getZ(), spawn.loc.getHeading(), false, millisToEventEnd, false);
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 1218569d81..4264d72834 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.enums.QuestType;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
@@ -785,7 +786,7 @@ public class QuestState
public boolean isNowAvailable()
{
final String val = get("restartTime");
- return (val != null) && (Long.parseLong(val) <= System.currentTimeMillis());
+ return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
public void setSimulated(boolean simulated)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
index cf665da8f8..b4d0d36648 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.SocialClass;
@@ -138,7 +139,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
final int level = rs.getInt("level");
final long expiration = rs.getLong("expiration");
final ResidenceFunction func = new ResidenceFunction(id, level, expiration, this);
- if ((expiration <= System.currentTimeMillis()) && !func.reactivate())
+ if ((expiration <= Chronos.currentTimeMillis()) && !func.reactivate())
{
removeFunction(func);
continue;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
index a292c439e5..d81d7f08af 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanHallGrade;
import org.l2jmobius.gameserver.enums.ClanHallType;
@@ -265,7 +266,7 @@ public class ClanHall extends AbstractResidence
final int failDays = getCostFailDay();
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : _paidUntil;
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - Chronos.currentTimeMillis());
}
else
{
@@ -310,7 +311,7 @@ public class ClanHall extends AbstractResidence
*/
public long getNextPayment()
{
- return (_checkPaymentTask != null) ? System.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
+ return (_checkPaymentTask != null) ? Chronos.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
}
public Location getOwnerLocation()
@@ -382,7 +383,7 @@ public class ClanHall extends AbstractResidence
{
_owner.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, _lease, null, null);
setPaidUntil(Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(7)).toEpochMilli());
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - Chronos.currentTimeMillis());
updateDB();
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
index 2fa683814d..faac3921be 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
@@ -30,6 +30,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
@@ -85,7 +86,7 @@ public class ClanHallAuction
public void addBid(Clan clan, long bid)
{
- addBid(clan, bid, System.currentTimeMillis());
+ addBid(clan, bid, Chronos.currentTimeMillis());
}
public void addBid(Clan clan, long bid, long bidTime)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index c71380874f..841d3b180c 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -20,6 +20,7 @@ import java.time.Instant;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ResidenceFunctionsData;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -63,9 +64,9 @@ public class ResidenceFunction
private void init()
{
final ResidenceFunctionTemplate template = getTemplate();
- if ((template != null) && (_expiration > System.currentTimeMillis()))
+ if ((template != null) && (_expiration > Chronos.currentTimeMillis()))
{
- _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
+ _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - Chronos.currentTimeMillis());
}
}
@@ -170,7 +171,7 @@ public class ResidenceFunction
if (wh.destroyItem("FunctionFee", item, template.getCost().getCount(), null, this) != null)
{
- _expiration = System.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
+ _expiration = Chronos.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
init();
}
return true;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
index 3a425c9b03..af7fd2e85e 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.shuttle;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Location;
/**
@@ -29,7 +30,7 @@ public class ShuttleStop
private final int _id;
private boolean _isOpen = true;
private final List _dimensions = new ArrayList<>(3);
- private long _lastDoorStatusChanges = System.currentTimeMillis();
+ private long _lastDoorStatusChanges = Chronos.currentTimeMillis();
public ShuttleStop(int id)
{
@@ -64,7 +65,7 @@ public class ShuttleStop
}
_isOpen = true;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public void closeDoor()
@@ -75,11 +76,11 @@ public class ShuttleStop
}
_isOpen = false;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public boolean hasDoorChanged()
{
- return (System.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
+ return (Chronos.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Castle.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Castle.java
index 8aa51ae1d1..a85192d134 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Castle.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Castle.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.CastleData;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -160,7 +161,7 @@ public class Castle extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -195,7 +196,7 @@ public class Castle extends AbstractResidence
fee = _tempFee;
}
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Fort.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Fort.java
index 95839a8065..de66de79ed 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Fort.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Fort.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.FortUpdater;
import org.l2jmobius.gameserver.FortUpdater.UpdaterType;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -163,7 +164,7 @@ public class Fort extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -193,7 +194,7 @@ public class Fort extends AbstractResidence
if ((_fortOwner.getWarehouse().getAdena() >= _fee) || !_cwh)
{
final int fee = _endDate == -1 ? _tempFee : _fee;
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
@@ -580,7 +581,7 @@ public class Fort extends AbstractResidence
clan.setFortId(getResidenceId());
setOwnerClan(clan);
final int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
- long initial = System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
+ long initial = Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
while (initial > (Config.FS_UPDATE_FRQ * 60000))
{
initial -= Config.FS_UPDATE_FRQ * 60000;
@@ -786,7 +787,7 @@ public class Fort extends AbstractResidence
if (clan != null)
{
clanId = clan.getId();
- _lastOwnedTime.setTimeInMillis(System.currentTimeMillis());
+ _lastOwnedTime.setTimeInMillis(Chronos.currentTimeMillis());
}
else
{
@@ -920,12 +921,12 @@ public class Fort extends AbstractResidence
public int getOwnedTime()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
}
public int getTimeTillRebelArmy()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - System.currentTimeMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - Chronos.currentTimeMillis()) / 1000);
}
public long getTimeTillNextFortUpdate()
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Siege.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Siege.java
index 25e8b587a3..31f673fbb7 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Siege.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/siege/Siege.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SiegeScheduleData;
import org.l2jmobius.gameserver.enums.SiegeClanType;
@@ -1434,9 +1435,9 @@ public class Siege implements Siegable
}
final Calendar calendar = _castle.getSiegeDate();
- if (calendar.getTimeInMillis() < System.currentTimeMillis())
+ if (calendar.getTimeInMillis() < Chronos.currentTimeMillis())
{
- calendar.setTimeInMillis(System.currentTimeMillis());
+ calendar.setTimeInMillis(Chronos.currentTimeMillis());
}
calendar.set(Calendar.DAY_OF_WEEK, holder.getDay());
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
index c7b80987c7..77396cff6d 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
@@ -32,10 +32,10 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
+import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
import org.l2jmobius.gameserver.model.stats.Stat;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
index c3ac06e1fc..18161a6c75 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
@@ -30,8 +30,8 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
index 5428c6f7dd..497f4e7247 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.zone.type;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -99,7 +100,7 @@ public class NoRestartZone extends ZoneType
return;
}
- if (((System.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
+ if (((Chronos.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
{
player.teleToLocation(TeleportWhereType.TOWN);
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/GameClient.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/GameClient.java
index badd7b05a1..99c66513d8 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/GameClient.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/GameClient.java
@@ -30,6 +30,7 @@ import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.ICrypt;
import org.l2jmobius.commons.network.IIncomingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -341,7 +342,7 @@ public class GameClient extends ChannelInboundHandler
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps2 = con.prepareStatement("UPDATE characters SET deletetime=? WHERE charId=?"))
{
- ps2.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ ps2.setLong(1, Chronos.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
ps2.setInt(2, objectId);
ps2.execute();
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
index bf151234da..cf2986ced6 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -81,7 +82,7 @@ public class AllyDismiss implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000), Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
leaderClan.updateClanInDB();
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
index 3d5c508a4c..7cc2fa0c1f 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class AllyLeave implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
clan.setAllyId(0);
clan.setAllyName(null);
clan.changeAllyCrest(0, true);
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 902c7bf7d5..5f24c8f53f 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
@@ -539,7 +540,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_RECENTLY_BEEN_DISMISSED_FROM_A_CLAN_YOU_ARE_NOT_ALLOWED_TO_JOIN_ANOTHER_CLAN_FOR_24_HOURS);
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
index c63a8bfcf4..854d89da8d 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.AdminTeleportType;
@@ -74,7 +75,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
player.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
index 0116b13a14..520c45b7ce 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
@@ -20,6 +20,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.enums.ItemSkillType;
@@ -126,7 +127,7 @@ public class RequestEnchantItem implements IClientIncomingPacket
}
// fast auto-enchant cheat check
- if ((request.getTimestamp() == 0) || ((System.currentTimeMillis() - request.getTimestamp()) < 2000))
+ if ((request.getTimestamp() == 0) || ((Chronos.currentTimeMillis() - request.getTimestamp()) < 2000))
{
Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " use autoenchant program ", Config.DEFAULT_PUNISH);
player.removeRequest(request.getClass());
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
index b8a07b77e8..bad73f8c28 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -82,7 +83,7 @@ public class RequestExAddEnchantScrollItem implements IClientIncomingPacket
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantScrollItemResult(_scrollObjectId));
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
index db4db5e742..b004d448e0 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -55,7 +56,7 @@ public class RequestExRemoveEnchantSupportItem implements IClientIncomingPacket
request.setSupportItem(PlayerInstance.ID_NONE);
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(ExRemoveEnchantSupportItemResult.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
index 7081788fa8..b7c0e01d93 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -69,7 +70,7 @@ public class RequestExSetPledgeCrestLarge implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
index c9e0cf1be8..7a2a1c706a 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -85,7 +86,7 @@ public class RequestExTryToPutEnchantSupportItem implements IClientIncomingPacke
}
request.setSupportItem(support.getObjectId());
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantSupportItemResult(_supportObjectId));
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
index cdf3996711..4b04a3965e 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -76,7 +77,7 @@ public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
}
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
client.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
index 715be58f93..cd86a6542c 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -69,7 +70,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
{
if (_isJoining == 1)
{
- if (System.currentTimeMillis() < clan.getDissolvingExpiryTime())
+ if (Chronos.currentTimeMillis() < clan.getDissolvingExpiryTime())
{
client.sendPacket(SystemMessageId.YOUR_CLAN_MAY_NOT_REGISTER_TO_PARTICIPATE_IN_A_SIEGE_WHILE_UNDER_A_GRACE_PERIOD_OF_THE_CLAN_S_DISSOLUTION);
return;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
index 1e78964e1b..e31721fdce 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.BoatManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.instance.BoatInstance;
@@ -61,7 +62,7 @@ public class RequestMoveToLocationInVehicle implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
client.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
index 5563872c57..0fd55d3ffe 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
@@ -80,8 +81,8 @@ public class RequestOustPledgeMember implements IClientIncomingPacket
}
// this also updates the database
- clan.removeClanMember(member.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
- clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(member.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setCharPenaltyExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
final SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_HAS_BEEN_EXPELLED);
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
index 0bf1ebf5ec..a61cc79835 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
@@ -22,6 +22,7 @@ import java.sql.SQLException;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -68,7 +69,7 @@ public class RequestPetitionFeedback implements IClientIncomingPacket
statement.setString(2, player.getLastPetitionGmName());
statement.setInt(3, _rate);
statement.setString(4, _message);
- statement.setLong(5, System.currentTimeMillis());
+ statement.setLong(5, Chronos.currentTimeMillis());
statement.execute();
}
catch (SQLException e)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
index 12ab962a2b..b63d0490df 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.ClanEntryManager;
import org.l2jmobius.gameserver.instancemanager.FortManager;
@@ -62,12 +63,12 @@ public class RequestPledgeSignInForOpenJoiningMethod implements IClientIncomingP
final Clan clan = pledgeRecruitInfo.getClan();
if ((clan != null) && (player.getClan() == null))
{
- if (clan.getCharPenaltyExpiryTime() > System.currentTimeMillis())
+ if (clan.getCharPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return;
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 30e0b1b097..9c606fc9fe 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -34,8 +34,8 @@ import org.l2jmobius.gameserver.model.quest.Event;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.network.GameClient;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
index ed6c0db580..2d92eb4df9 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -74,7 +75,7 @@ public class RequestSetPledgeCrest implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
index 16f6b732ba..f1d9597133 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.enums.UserInfoType;
@@ -101,7 +102,7 @@ public class RequestStartPledgeWar implements IClientIncomingPacket
client.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
- else if (clanDeclaredWar.getDissolvingExpiryTime() > System.currentTimeMillis())
+ else if (clanDeclaredWar.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(new SystemMessage(SystemMessageId.A_CLAN_WAR_CAN_NOT_BE_DECLARED_AGAINST_A_CLAN_THAT_IS_BEING_DISSOLVED));
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
index 8d0f9b92cc..48988b5249 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class RequestWithdrawalPledge implements IClientIncomingPacket
}
final Clan clan = player.getClan();
- clan.removeClanMember(player.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(player.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
index e1f30a1018..c379f83677 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlEvent;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.NextAction;
@@ -258,7 +259,7 @@ public class UseItem implements IClientIncomingPacket
else if (player.isAttackingNow())
{
// Equip or unEquip.
- ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
+ ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
index aef68ac971..96ce901338 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.appearance;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.enums.InventorySlot;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -252,7 +253,7 @@ public class RequestShapeShiftingItem implements IClientIncomingPacket
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getLifeTime() > 0))
{
- targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, System.currentTimeMillis() + appearanceStone.getLifeTime());
+ targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, Chronos.currentTimeMillis() + appearanceStone.getLifeTime());
targetItem.scheduleVisualLifeTime();
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
index 2aa7eeeeac..d6bbe9b766 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,9 +119,9 @@ public class ConfirmMenteeAdd implements IClientIncomingPacket
mentor.sendPacket(SystemMessageId.YOU_MUST_AWAKEN_IN_ORDER_TO_BECOME_A_MENTOR);
return false;
}
- else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > System.currentTimeMillis())
+ else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > Chronos.currentTimeMillis())
{
- long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - System.currentTimeMillis()) / 1000;
+ long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - Chronos.currentTimeMillis()) / 1000;
final int days = (int) (remainingTime / 86400);
remainingTime = remainingTime % 86400;
final int hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
index e06cd9048d..1e8aba6d16 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
@@ -119,7 +120,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
index f6702caa41..9c076a29a5 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.enums.MailType;
@@ -140,7 +141,7 @@ public class RequestBRPresentBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
index c3faad961a..138ed60513 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.training;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.TrainingHolder;
import org.l2jmobius.gameserver.network.GameClient;
@@ -52,7 +53,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
if (holder.isTraining())
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
@@ -60,7 +61,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
player.setImmobilized(false);
player.teleToLocation(player.getLastLocation());
player.sendPacket(ExTrainingZone_Leaving.STATIC_PACKET);
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
index ee1c787150..3f1213f2ee 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.loginserverpackets.game;
import org.l2jmobius.commons.network.BaseSendablePacket;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author mrTJO
@@ -28,7 +29,7 @@ public class TempBan extends BaseSendablePacket
writeC(0x0A);
writeS(accountName);
writeS(ip);
- writeQ(System.currentTimeMillis() + (time * 60000));
+ writeQ(Chronos.currentTimeMillis() + (time * 60000));
// if (reason != null)
// {
// writeC(0x01);
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
index be68d42341..db34e27e47 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.CharSelectInfoPackage;
@@ -188,7 +189,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP
packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP
- packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
+ packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0);
packet.writeD(charInfoPackage.getClassId());
packet.writeD(i == _activeId ? 1 : 0);
@@ -283,7 +284,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
// See if the char must be deleted
final long deletetime = chardata.getLong("deletetime");
- if ((deletetime > 0) && (System.currentTimeMillis() > deletetime))
+ if ((deletetime > 0) && (Chronos.currentTimeMillis() > deletetime))
{
final Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
if (clan != null)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
index 4bdb9d3951..e1c3fc3f54 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
@@ -50,7 +51,7 @@ public class ExInzoneWaiting implements IClientOutgoingPacket
packet.writeD(_instanceTimes.size());
for (Entry entry : _instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
index a40690e845..6f7b5f8735 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MatchingRoomManager;
@@ -73,7 +74,7 @@ public class ExListPartyMatchingWaitingRoom implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
index d455d825fd..5921d44781 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MatchingMemberType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -61,7 +62,7 @@ public class ExPartyRoomMember implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
index 3656ddbc4e..ab85228caf 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MailType;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
@@ -45,7 +46,7 @@ public class ExShowReceivedPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_RECEIVED_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_inbox != null) && !_inbox.isEmpty())
{
packet.writeD(_inbox.size());
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
index 2ae09181a7..db4bccc928 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -40,7 +41,7 @@ public class ExShowSentPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_SENT_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_outbox != null) && !_outbox.isEmpty())
{
packet.writeD(_outbox.size());
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
index db2091ad54..4403da53fe 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.items.Henna;
import org.l2jmobius.gameserver.model.stats.BaseStat;
@@ -73,7 +74,7 @@ public class HennaInfo implements IClientOutgoingPacket
int duration = premium.getDuration();
if (duration > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
duration = (int) Math.max(0, _player.getVariables().getLong("HennaDuration4", currentTime) - currentTime) / 1000;
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
index 5ed678042b..caed96260b 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -88,7 +89,7 @@ public class SiegeInfo implements IClientOutgoingPacket
packet.writeS(""); // Ally Name
}
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if (!_castle.isTimeRegistrationOver() && _player.isClanLeader() && (_player.getClanId() == _castle.getOwnerId()))
{
final Calendar cal = Calendar.getInstance();
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
index 5871334785..c6de3ccd8b 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.TimeStamp;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -36,7 +37,7 @@ public class SkillCoolTime implements IClientOutgoingPacket
public SkillCoolTime(PlayerInstance player)
{
- _currentTime = System.currentTimeMillis();
+ _currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : player.getSkillReuseTimeStamps().values())
{
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel()).isNotBroadcastable())
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
index 74955d8a26..2ffa34919b 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets.friend;
import java.util.Calendar;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -39,7 +40,7 @@ public class ExFriendDetailInfo implements IClientOutgoingPacket
_objectId = player.getObjectId();
_name = name;
_friend = World.getInstance().getPlayer(_name);
- _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) System.currentTimeMillis() : (int) (System.currentTimeMillis() - _friend.getLastAccess()) / 1000;
+ _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) Chronos.currentTimeMillis() : (int) (Chronos.currentTimeMillis() - _friend.getLastAccess()) / 1000;
}
@Override
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/scripting/ManagedScript.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
index 00235baa25..9d206480d8 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
@@ -20,6 +20,8 @@ import java.nio.file.Path;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* Abstract class for classes that are meant to be implemented by scripts.
* @author KenM
@@ -35,7 +37,7 @@ public abstract class ManagedScript
public ManagedScript()
{
_scriptFile = getScriptPath();
- setLastLoadTime(System.currentTimeMillis());
+ setLastLoadTime(Chronos.currentTimeMillis());
}
public abstract Path getScriptPath();
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9c8c4bb5dd..b5a2e04233 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -54,7 +55,7 @@ public class AttackStanceTaskManager
}
_working = true;
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
try
{
final Iterator> iterator = _attackStanceTasks.entrySet().iterator();
@@ -105,7 +106,7 @@ public class AttackStanceTaskManager
return;
}
- _attackStanceTasks.put(creature, System.currentTimeMillis());
+ _attackStanceTasks.put(creature, Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
index 8ab6c99d28..d56e0b8a23 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.buylist.Product;
/**
@@ -45,7 +46,7 @@ public class BuyListTaskManager
}
_workingProducts = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : PRODUCTS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 8b4a7db319..f8218055f3 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@@ -44,7 +45,7 @@ public class DecayTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -87,7 +88,7 @@ public class DecayTaskManager
}
// Add to decay schedules.
- DECAY_SCHEDULES.put(creature, System.currentTimeMillis() + (delay * 1000));
+ DECAY_SCHEDULES.put(creature, Chronos.currentTimeMillis() + (delay * 1000));
}
/**
@@ -107,7 +108,7 @@ public class DecayTaskManager
public long getRemainingTime(Creature creature)
{
final Long time = DECAY_SCHEDULES.get(creature);
- return time != null ? time.longValue() - System.currentTimeMillis() : Long.MAX_VALUE;
+ return time != null ? time.longValue() - Chronos.currentTimeMillis() : Long.MAX_VALUE;
}
@Override
@@ -122,7 +123,7 @@ public class DecayTaskManager
ret.append("Tasks dump:");
ret.append(Config.EOL);
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
ret.append("Class/Name: ");
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
index c3834ecbb9..e0f823bef4 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemAppearanceTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
index 27f0273802..de10959db8 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemLifeTimeTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 396633692c..160debb492 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -42,7 +43,7 @@ public class ItemManaTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
@@ -61,7 +62,7 @@ public class ItemManaTaskManager
{
if (!ITEMS.containsKey(item))
{
- ITEMS.put(item, System.currentTimeMillis() + MANA_CONSUMPTION_RATE);
+ ITEMS.put(item, Chronos.currentTimeMillis() + MANA_CONSUMPTION_RATE);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
index eb0dd7a59f..a2f0dc5563 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.model.World;
@@ -48,7 +49,7 @@ public class MessageDeletionTaskManager
Integer msgId;
Message msg;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_MESSAGES.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
index 2f270649fb..82483a498a 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PlayerAutoSaveTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SEARCH: for (Entry entry : PLAYER_TIMES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -63,7 +64,7 @@ public class PlayerAutoSaveTaskManager
public void add(PlayerInstance player)
{
- PLAYER_TIMES.put(player, System.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
+ PLAYER_TIMES.put(player, Chronos.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
}
public void remove(PlayerInstance player)
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
index 6a406a9591..3a812e2fcb 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PvpFlagTaskManager
if (!PLAYERS.isEmpty())
{
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (PlayerInstance player : PLAYERS)
{
if (time > player.getPvpFlagLasts())
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
index 5473f21a8f..b8135996f8 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -43,7 +44,7 @@ public class RandomAnimationTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_ANIMATIONS.entrySet())
{
if (time > entry.getValue().longValue())
@@ -65,7 +66,7 @@ public class RandomAnimationTaskManager
{
if (npc.hasRandomAnimation())
{
- PENDING_ANIMATIONS.putIfAbsent(npc, System.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
+ PENDING_ANIMATIONS.putIfAbsent(npc, Chronos.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
index 8e8e818908..debb0d68e6 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Spawn;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -42,7 +43,7 @@ public class RespawnTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_RESPAWNS.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
index 990efb8b45..d1946b860a 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -36,6 +36,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskBirthday;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskRecom;
@@ -94,7 +95,7 @@ public class TaskManager
public void run()
{
task.onTimeElapsed(this);
- lastActivation = System.currentTimeMillis();
+ lastActivation = Chronos.currentTimeMillis();
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement statement = con.prepareStatement(SQL_STATEMENTS[1]))
{
@@ -242,7 +243,7 @@ public class TaskManager
try
{
final Date desired = DateFormat.getInstance().parse(task.getParams()[0]);
- final long diff = desired.getTime() - System.currentTimeMillis();
+ final long diff = desired.getTime() - Chronos.currentTimeMillis();
if (diff >= 0)
{
task.scheduled = ThreadPool.schedule(task, diff);
@@ -293,7 +294,7 @@ public class TaskManager
return false;
}
- delay = min.getTimeInMillis() - System.currentTimeMillis();
+ delay = min.getTimeInMillis() - Chronos.currentTimeMillis();
if (check.after(min) || (delay < 0))
{
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ui/SystemPanel.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ui/SystemPanel.java
index 8c01c1f8fe..a19a873bfe 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ui/SystemPanel.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ui/SystemPanel.java
@@ -31,6 +31,7 @@ import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.util.Locator;
@@ -42,7 +43,7 @@ public class SystemPanel extends JPanel
{
protected static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
- protected static final long START_TIME = System.currentTimeMillis();
+ protected static final long START_TIME = Chronos.currentTimeMillis();
public SystemPanel()
{
@@ -136,7 +137,7 @@ public class SystemPanel extends JPanel
lblConnected.setText("Connected: " + playerCount);
lblMaxConnected.setText("Max connected: " + World.MAX_CONNECTED_COUNT);
lblOfflineShops.setText("Offline trade: " + World.OFFLINE_TRADE_COUNT);
- lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - START_TIME));
+ lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(Chronos.currentTimeMillis() - START_TIME));
}
}, 1000, 1000);
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
index ec95816f82..cc8059f91a 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.PlayerCondOverride;
@@ -151,7 +152,7 @@ public class FloodProtectorAction
*/
private void banAccount()
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
if (LOGGER.isLoggable(Level.WARNING))
{
log(" banned for flooding ", _config.PUNISHMENT_TIME <= 0 ? "forever" : "for " + (_config.PUNISHMENT_TIME / 60000) + " mins");
@@ -171,7 +172,7 @@ public class FloodProtectorAction
final int charId = _client.getPlayer().getObjectId();
if (charId > 0)
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
}
if (LOGGER.isLoggable(Level.WARNING))
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
index e5912dd51b..d6580161c7 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World;
@@ -143,7 +144,7 @@ public class OfflineTradeUtil
if (player.getOfflineStartTime() == 0)
{
- player.setOfflineStartTime(System.currentTimeMillis());
+ player.setOfflineStartTime(Chronos.currentTimeMillis());
}
// Store trade on exit, if realtime saving is enabled.
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/FloodProtectedListener.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/FloodProtectedListener.java
index ba2fc6536a..e2bbcc1aa3 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/FloodProtectedListener.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/FloodProtectedListener.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author -Wooden-
@@ -63,9 +64,9 @@ public abstract class FloodProtectedListener extends Thread
if (fConnection != null)
{
fConnection.connectionNumber += 1;
- if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((System.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((System.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
+ if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
{
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
connection.close();
fConnection.connectionNumber -= 1;
if (!fConnection.isFlooding)
@@ -80,11 +81,11 @@ public abstract class FloodProtectedListener extends Thread
fConnection.isFlooding = false;
LOGGER.info(connection.getInetAddress().getHostAddress() + " is not considered as flooding anymore.");
}
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
}
else
{
- fConnection = new ForeignConnection(System.currentTimeMillis());
+ fConnection = new ForeignConnection(Chronos.currentTimeMillis());
_floodProtection.put(connection.getInetAddress().getHostAddress(), fConnection);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/LoginController.java
index 189b90e2ee..9d382c646b 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/LoginController.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/LoginController.java
@@ -41,6 +41,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.GameServerTable.GameServerInfo;
@@ -176,7 +177,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(USER_INFO_SELECT))
{
- ps.setString(1, Long.toString(System.currentTimeMillis()));
+ ps.setString(1, Long.toString(Chronos.currentTimeMillis()));
ps.setString(2, login);
try (ResultSet rset = ps.executeQuery())
{
@@ -208,7 +209,7 @@ public class LoginController
{
ps.setString(1, login);
ps.setString(2, hashBase64);
- ps.setLong(3, System.currentTimeMillis());
+ ps.setLong(3, Chronos.currentTimeMillis());
ps.setInt(4, 0);
ps.setString(5, addr.getHostAddress());
ps.execute();
@@ -273,7 +274,7 @@ public class LoginController
*/
public void addBanForAddress(InetAddress address, long duration)
{
- _bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
+ _bannedIps.putIfAbsent(address, Chronos.currentTimeMillis() + duration);
}
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
@@ -294,7 +295,7 @@ public class LoginController
}
if (bi != null)
{
- if ((bi > 0) && (bi < System.currentTimeMillis()))
+ if ((bi > 0) && (bi < Chronos.currentTimeMillis()))
{
_bannedIps.remove(address);
LOGGER.info("Removed expired ip address ban " + address.getHostAddress() + ".");
@@ -541,7 +542,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(ACCOUNT_INFO_UPDATE))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.setString(2, address.getHostAddress());
ps.setString(3, info.getLogin());
ps.execute();
@@ -613,7 +614,7 @@ public class LoginController
{
continue;
}
- if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < System.currentTimeMillis())
+ if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < Chronos.currentTimeMillis())
{
client.close(LoginFailReason.REASON_ACCESS_FAILED);
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/network/LoginClient.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/network/LoginClient.java
index 04455664e2..93194a11c0 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/network/LoginClient.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/network/LoginClient.java
@@ -27,6 +27,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.IIncomingPacket;
import org.l2jmobius.commons.network.IOutgoingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.LoginController;
@@ -82,14 +83,14 @@ public class LoginClient extends ChannelInboundHandler
_addr = address.getAddress();
_channel = ctx.channel();
_sessionId = Rnd.nextInt();
- _connectionStartTime = System.currentTimeMillis();
+ _connectionStartTime = Chronos.currentTimeMillis();
sendPacket(new Init(_scrambledPair.getScrambledModulus(), _blowfishKey.getEncoded(), _sessionId));
}
@Override
public void channelInactive(ChannelHandlerContext ctx)
{
- if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < System.currentTimeMillis()))
+ if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < Chronos.currentTimeMillis()))
{
LoginController.getInstance().removeAuthedLoginClient(getAccount());
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
index 801bc957ae..875759b72a 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
@@ -24,6 +24,8 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* IPv4 filter.
* @author Forsaiken
@@ -59,7 +61,7 @@ public class IPv4Filter implements Runnable
Flood()
{
- lastAccess = System.currentTimeMillis();
+ lastAccess = Chronos.currentTimeMillis();
trys = 0;
}
}
@@ -74,7 +76,7 @@ public class IPv4Filter implements Runnable
}
final int h = hash(addr.getAddress());
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
Flood f;
synchronized (_ipFloodMap)
{
@@ -120,7 +122,7 @@ public class IPv4Filter implements Runnable
{
while (true)
{
- final long reference = System.currentTimeMillis() - (1000 * 300);
+ final long reference = Chronos.currentTimeMillis() - (1000 * 300);
synchronized (_ipFloodMap)
{
final Iterator> it = _ipFloodMap.entrySet().iterator();
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 e66362d6c0..86b46f1919 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
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.model.Location;
@@ -137,7 +138,7 @@ public class Parade extends AbstractNpcAI
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
- LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
+ LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
}
void load()
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
index c91b42bb26..7757d82c61 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -304,7 +305,7 @@ public class TalentShow extends AbstractNpcAI
hourDiff *= 3600000;
minDiff *= 60000;
diff = hourDiff + minDiff;
- LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
+ LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
startQuestTimer("Start", diff, null, null); // first start
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
index 940193f4fc..32c8b9f9f1 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
@@ -16,6 +16,7 @@
*/
package ai.areas.GainakUnderground.Lailly;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -64,7 +65,7 @@ public class Lailly extends AbstractNpcAI
case "okay":
{
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
- if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis()))
+ if ((instance != null) && (instance.getEndTime() > Chronos.currentTimeMillis()))
{
switch (instance.getTemplateId())
{
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 a00d59028e..037b29d579 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
@@ -29,6 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -516,7 +517,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
final GlobalVariablesManager vars = GlobalVariablesManager.getInstance();
final long var = vars.getLong("FourSepulchers" + npcId, 0) + (TIME_ATTACK * 60 * 1000);
- if (var > System.currentTimeMillis())
+ if (var > Chronos.currentTimeMillis())
{
showHtmlFile(player, npcId + "-NE.html", npc, null);
return;
@@ -581,7 +582,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
ThreadPool.schedule(() -> ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers(), TIME_ATTACK * 60 * 1000);
// Save attack time
- vars.set("FourSepulchers" + npcId, System.currentTimeMillis());
+ vars.set("FourSepulchers" + npcId, Chronos.currentTimeMillis());
// Init progress
STORED_PROGRESS.put(sepulcherId, 1); // start from 1
// Start
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
index 244867b7c6..ded5cf9a43 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
@@ -19,6 +19,7 @@ package ai.areas.KeucereusAllianceBase;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
@@ -109,7 +110,7 @@ public class LindviorScene extends AbstractNpcAI
final GregorianCalendar date = new GregorianCalendar();
date.set(Calendar.MINUTE, RESET_MIN);
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
- if (System.currentTimeMillis() >= date.getTimeInMillis())
+ if (Chronos.currentTimeMillis() >= date.getTimeInMillis())
{
date.add(Calendar.DAY_OF_WEEK, 1);
}
@@ -135,7 +136,7 @@ public class LindviorScene extends AbstractNpcAI
{
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
}
- return date.getTimeInMillis() - System.currentTimeMillis();
+ return date.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
index 80dffe38b2..de8ea0aea9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
@@ -19,6 +19,7 @@ package ai.areas.Rune.RuneCastle.Venom;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -111,7 +112,7 @@ public class Venom extends AbstractNpcAI
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
index a7d7250e8b..c42186c0d0 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -229,7 +230,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
int buffsNow = 0;
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
- if (var < System.currentTimeMillis())
+ if (var < Chronos.currentTimeMillis())
{
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
@@ -254,7 +255,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
reenter.set(Calendar.MINUTE, 0);
reenter.set(Calendar.HOUR_OF_DAY, 13);
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
- if (reenter.getTimeInMillis() <= System.currentTimeMillis())
+ if (reenter.getTimeInMillis() <= Chronos.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 7);
}
@@ -272,7 +273,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
}
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
private void spawnGroupOfMinion(MonsterInstance npc, int[] mobIds)
@@ -317,7 +318,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
zone.clearSkills();
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
else if (event.equalsIgnoreCase("transform"))
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
index e004e80b3d..8044c58bf3 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -345,7 +346,7 @@ public class Anakim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ANAKIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_anakim", time, null, null);
@@ -373,7 +374,7 @@ public class Anakim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(ANAKIM, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -550,7 +551,7 @@ public class Anakim extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_anakimStatus == WAITING) && (npc.getId() == ANAKIM_CUBIC))
@@ -578,7 +579,7 @@ public class Anakim extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid())// Anakim and minions
{
// Anti BUGGERS
@@ -614,7 +615,7 @@ public class Anakim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ANAKIM, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(ANAKIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ANAKIM, info);
startQuestTimer("unlock_anakim", respawnTime, null, null);
@@ -686,7 +687,7 @@ public class Anakim extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
index 4a77fb6bfd..fe808aef25 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.MountType;
@@ -169,14 +170,14 @@ public class Antharas extends AbstractNpcAI
_antharas = (GrandBossInstance) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
_antharas.setCurrentHpMp(curr_hp, curr_mp);
addBoss(_antharas);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
break;
}
case DEAD:
{
- final long remain = respawnTime - System.currentTimeMillis();
+ final long remain = respawnTime - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -272,7 +273,7 @@ public class Antharas extends AbstractNpcAI
_antharas.setRandomWalking(false);
_antharas.teleToLocation(181323, 114850, -7623, 32542);
setStatus(IN_FIGHT);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
zone.broadcastPacket(new PlaySound("BS02_A"));
startQuestTimer("CAMERA_1", 23, _antharas, null);
break;
@@ -367,7 +368,7 @@ public class Antharas extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 900000) < Chronos.currentTimeMillis()))
{
setStatus(ALIVE);
for (Creature creature : zone.getCharactersInside())
@@ -619,7 +620,7 @@ public class Antharas extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BOMBER)
{
if (npc.calculateDistance3D(attacker) < 230)
@@ -765,7 +766,7 @@ public class Antharas extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
+ GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
}
private final void refreshAiParams(PlayerInstance attacker, int damage)
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Baium/Baium.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Baium/Baium.java
index faca4576a8..44b37b992a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Baium/Baium.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Baium/Baium.java
@@ -17,6 +17,7 @@
package ai.bosses.Baium;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.CategoryType;
@@ -136,7 +137,7 @@ public class Baium extends AbstractNpcAI
final int heading = info.getInt("heading");
_baium = (GrandBossInstance) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
_baium.setCurrentHpMp(curr_hp, curr_mp);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
addBoss(_baium);
for (Location loc : ARCHANGEL_LOC)
@@ -149,7 +150,7 @@ public class Baium extends AbstractNpcAI
}
case DEAD:
{
- final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -209,7 +210,7 @@ public class Baium extends AbstractNpcAI
_baium.disableCoreAI(true);
_baium.setRandomWalking(false);
addBoss(_baium);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
@@ -375,7 +376,7 @@ public class Baium extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
{
notifyEvent("CLEAR_ZONE", null, null);
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
@@ -383,7 +384,7 @@ public class Baium extends AbstractNpcAI
}
else if (npc != null)
{
- if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
+ if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
{
npc.setTarget(npc);
npc.doCast(HEAL_OF_BAIUM.getSkill());
@@ -484,7 +485,7 @@ public class Baium extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BAIUM)
{
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
@@ -663,7 +664,7 @@ public class Baium extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
+ GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
}
private void manageSkills(Npc npc)
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
index aa8528926d..dfce75d90b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -108,7 +109,7 @@ public class Beleth extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("BELETH_UNLOCK", time, null, null);
@@ -349,7 +350,7 @@ public class Beleth extends AbstractNpcAI
c.setImmobilized(false);
}
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, null, null);
startQuestTimer("SPAWN25", 60000, null, null);
break;
@@ -507,7 +508,7 @@ public class Beleth extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((_lastAttack + 900000) < System.currentTimeMillis())
+ if ((_lastAttack + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -708,7 +709,7 @@ public class Beleth extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(REAL_BELETH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
deleteAll();
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Core/Core.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Core/Core.java
index 969bb08788..69dc20dc5d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Core/Core.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Core/Core.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -89,7 +90,7 @@ public class Core extends AbstractNpcAI
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
@@ -206,7 +207,7 @@ public class Core extends AbstractNpcAI
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
index 3ed92d8f08..b499a47575 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.MountType;
@@ -295,7 +296,7 @@ public class IceQueensCastleBattle extends AbstractInstance
{
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
- controller.getVariables().set("TIMER_END", System.currentTimeMillis() + 360000);
+ controller.getVariables().set("TIMER_END", Chronos.currentTimeMillis() + 360000);
}
break;
}
@@ -688,7 +689,7 @@ public class IceQueensCastleBattle extends AbstractInstance
}
case "SHOW_GLAKIAS_TIMER":
{
- final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - System.currentTimeMillis()) / 1000);
+ final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - Chronos.currentTimeMillis()) / 1000);
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
break;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
index acbc2c3094..6023594423 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
@@ -23,6 +23,7 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -143,11 +144,11 @@ public class ScarletVanHalisha extends AbstractNpcAI
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
}
@@ -248,7 +249,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
case FRINTEZZA_DAEMON_MORPH:
case FRINTEZZA_DAEMON_FIELD:
{
- _lastRangedSkillTime = System.currentTimeMillis();
+ _lastRangedSkillTime = Chronos.currentTimeMillis();
skillRange = 550;
break;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Helios/Helios.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Helios/Helios.java
index af4d5b4e8e..7e5c37bf69 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Helios/Helios.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Helios/Helios.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +151,7 @@ public class Helios extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(HELIOS3);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_helios", time, null, null);
@@ -496,7 +497,7 @@ public class Helios extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(HELIOS3, DEAD);
final long respawnTime = (Config.HELIOS_SPAWN_INTERVAL + getRandom(-Config.HELIOS_SPAWN_RANDOM, Config.HELIOS_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(HELIOS3);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(HELIOS3, info);
startQuestTimer("unlock_helios", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
index 81fd9ae6e8..9c32d36ecf 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.Movie;
@@ -121,7 +122,7 @@ public class Kelbim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(KELBIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_kelbim", time, null, null);
@@ -156,7 +157,7 @@ public class Kelbim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(KELBIM, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -193,7 +194,7 @@ public class Kelbim extends AbstractNpcAI
{
_kelbimBoss = (GrandBossInstance) addSpawn(KELBIM, -56340, 60801, -269, 54262, false, 0);
GrandBossManager.getInstance().addBoss(_kelbimBoss);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
startQuestTimer("stage_all_random_area_attack", Rnd.get(2, 3) * 60000, null, null);
break;
@@ -369,7 +370,7 @@ public class Kelbim extends AbstractNpcAI
{
if (npc.getId() == KELBIM)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
switch (_bossStage)
{
@@ -434,7 +435,7 @@ public class Kelbim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(KELBIM, DEAD);
final long respawnTime = (Config.KELBIM_SPAWN_INTERVAL + getRandom(-Config.KELBIM_SPAWN_RANDOM, Config.KELBIM_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(KELBIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(KELBIM, info);
startQuestTimer("unlock_kelbim", respawnTime, null, null);
startQuestTimer("end_kelbim", 1800000, null, null);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
index 62507c9762..510a8060de 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -371,7 +372,7 @@ public class Lilith extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LILITH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lilith", time, null, null);
@@ -399,7 +400,7 @@ public class Lilith extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(LILITH, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -576,7 +577,7 @@ public class Lilith extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_lilithStatus == WAITING) && (npc.getId() == LILITH_CUBIC))
@@ -594,7 +595,7 @@ public class Lilith extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid()) // Lilith and minions
{
// Anti BUGGERS
@@ -630,7 +631,7 @@ public class Lilith extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LILITH, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(LILITH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LILITH, info);
startQuestTimer("unlock_lilith", respawnTime, null, null);
@@ -702,7 +703,7 @@ public class Lilith extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
@Override
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 6b02643bc0..63811284a1 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
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -213,7 +214,7 @@ public class Lindvior extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lindvior", time, null, null);
@@ -863,7 +864,7 @@ public class Lindvior extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
final long respawnTime = (Config.LINDVIOR_SPAWN_INTERVAL + getRandom(-Config.LINDVIOR_SPAWN_RANDOM, Config.LINDVIOR_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
startQuestTimer("unlock_lindvior", respawnTime, null, null);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
index edd3abc4b8..801d31427b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -97,7 +98,7 @@ public class Orfen extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for Orfen from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if Orfen is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -328,7 +329,7 @@ public class Orfen extends AbstractNpcAI
startQuestTimer("orfen_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ORFEN, info);
cancelQuestTimer("check_minion_loc", npc, null);
cancelQuestTimer("check_orfen_pos", npc, null);
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 f2869a3fe9..c00a82fb97 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
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -96,7 +97,7 @@ public class QueenAnt extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for queen ant from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if queen ant is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -367,7 +368,7 @@ public class QueenAnt extends AbstractNpcAI
cancelQuestTimer("heal", null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(QUEEN, info);
_nurses.clear();
_larva.deleteMe();
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
index eda49595a1..fd26faf27c 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.QueenShyeed;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -87,7 +88,7 @@ public class QueenShyeed extends AbstractNpcAI
private void spawnShyeed()
{
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
- final long remain = respawn != 0 ? respawn - System.currentTimeMillis() : 0;
+ final long remain = respawn != 0 ? respawn - Chronos.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("respawn", remain, null, null);
@@ -103,7 +104,7 @@ public class QueenShyeed extends AbstractNpcAI
private void startRespawn()
{
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
- GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(System.currentTimeMillis() + respawnTime));
+ GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(Chronos.currentTimeMillis() + respawnTime));
startQuestTimer("respawn", respawnTime, null, null);
// MOB_BUFF_ZONE.setEnabled(false);
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
index 2f487904c0..64923cfa4b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -137,7 +138,7 @@ public class Ramona extends AbstractNpcAI
addAttackId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3);
addSpawnId(RAMONA_1, RAMONA_2, RAMONA_3);
- final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - System.currentTimeMillis();
+ final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - Chronos.currentTimeMillis();
if (temp > 0)
{
_boss = Status.DEAD;
@@ -167,7 +168,7 @@ public class Ramona extends AbstractNpcAI
npc.setInvul(false);
cancelQuestTimers("SPAWN_MS");
startQuestTimer("CHECK_ACTIVITY_TASK", 5000, null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
}
break;
}
@@ -186,7 +187,7 @@ public class Ramona extends AbstractNpcAI
startQuestTimer("GENERATOR_2", getRandom(900000, 1200000), null, null);
startQuestTimer("GENERATOR_3", getRandom(1500000, 1800000), null, null);
startQuestTimer("GENERATOR_4", getRandom(2100000, 2400000), null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("RAMONA1_SKILL", 6000, _ramona1, null);
break;
}
@@ -300,7 +301,7 @@ public class Ramona extends AbstractNpcAI
}
case "CHECK_ACTIVITY_TASK":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
for (Creature creature : ZONE.getCharactersInside())
{
@@ -396,17 +397,17 @@ public class Ramona extends AbstractNpcAI
}
case RAMONA_1:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
@@ -540,7 +541,7 @@ public class Ramona extends AbstractNpcAI
{
_boss = Status.DEAD;
final long respawnTime = (Config.RAMONA_SPAWN_INTERVAL + getRandom(-Config.RAMONA_SPAWN_RANDOM, Config.RAMONA_SPAWN_RANDOM)) * 3600000;
- GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, Chronos.currentTimeMillis() + respawnTime);
startQuestTimer("RAMONA_UNLOCK", respawnTime, null, null);
startQuestTimer("END_RAMONA", 90000, null, null);
break;
@@ -568,13 +569,13 @@ public class Ramona extends AbstractNpcAI
case RAMONA_1:
{
_boss = Status.IN_FIGHT;
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
index 4d4eb8653a..be58208558 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.Sailren;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -71,7 +72,7 @@ public class Sailren extends AbstractNpcAI
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
- final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
+ final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - Chronos.currentTimeMillis();
if (remain > 0)
{
STATUS = Status.DEAD;
@@ -118,7 +119,7 @@ public class Sailren extends AbstractNpcAI
{
takeItems(player, GAZKH, 1);
STATUS = Status.IN_FIGHT;
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
for (PlayerInstance member : player.getParty().getMembers())
{
if (member.isInsideRadius3D(npc, 1000))
@@ -237,7 +238,7 @@ public class Sailren extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
+ if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < Chronos.currentTimeMillis()))
{
cancelQuestTimer("TIME_OUT", null, null);
notifyEvent("TIME_OUT", null, null);
@@ -257,7 +258,7 @@ public class Sailren extends AbstractNpcAI
{
if (zone.isCharacterInZone(attacker))
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -274,7 +275,7 @@ public class Sailren extends AbstractNpcAI
STATUS = Status.DEAD;
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
final long respawnTime = RESPAWN * 3600000;
- GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set("SailrenRespawn", Chronos.currentTimeMillis() + respawnTime);
cancelQuestTimer("CHECK_ATTACK", null, null);
cancelQuestTimer("TIME_OUT", null, null);
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
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 0c824fd3b2..523f53e898 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
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -326,7 +327,7 @@ public class Trasken extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_trasken", time, null, null);
@@ -604,7 +605,7 @@ public class Trasken extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
startQuestTimer("unlock_trasken", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
index 94d29e346e..c8e0f497af 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.MountType;
@@ -129,7 +130,7 @@ public class Valakas extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for valakas from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (temp > 0)
{
// The time has not yet expired. Mark Valakas as currently locked (dead).
@@ -168,7 +169,7 @@ public class Valakas extends AbstractNpcAI
if (status == FIGHTING)
{
// stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
startQuestTimer("regen_task", 60000, valakas, null, true);
startQuestTimer("skill_task", 2000, valakas, null, true);
@@ -196,7 +197,7 @@ public class Valakas extends AbstractNpcAI
if (event.equalsIgnoreCase("beginning"))
{
// Stores current time
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
// Teleport Valakas to his lair.
npc.teleToLocation(VALAKAS_LAIR);
@@ -220,7 +221,7 @@ public class Valakas extends AbstractNpcAI
else if (event.equalsIgnoreCase("regen_task"))
{
// Inactivity task - 15min
- if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
+ if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < Chronos.currentTimeMillis()))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
@@ -416,7 +417,7 @@ public class Valakas extends AbstractNpcAI
npc.setTarget(attacker);
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
}
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -447,7 +448,7 @@ public class Valakas extends AbstractNpcAI
startQuestTimer("valakas_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
return super.onKill(npc, killer, isSummon);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
index ddc6ff9e74..40bd1cf6c2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
@@ -46,8 +46,8 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcManorBypass;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.teleporter.TeleportHolder;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index ff4c416b6b..a8b916705e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -26,6 +26,7 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -153,7 +154,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -189,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
@@ -247,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
@@ -296,7 +297,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0]");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
sb.append(" | ");
sb.append(auction.getHighestBid());
sb.append(" | ");
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
index f469c39159..2362aa9446 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -21,6 +21,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.Location;
@@ -73,7 +74,7 @@ public class ProvisionalHalls extends AbstractNpcAI
if (resetTime > 0)
{
cancelQuestTimers(HALL_RESET_VAR + id);
- startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
}
}
}
@@ -126,7 +127,7 @@ public class ProvisionalHalls extends AbstractNpcAI
for (int id : CLAN_HALLS.keySet())
{
- if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < Chronos.currentTimeMillis()))
{
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
@@ -137,7 +138,7 @@ public class ProvisionalHalls extends AbstractNpcAI
clanHall.setOwner(player.getClan());
}
player.sendMessage("Congratulations! You now own a provisional clan hall!");
- startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
return null;
}
}
@@ -177,7 +178,7 @@ public class ProvisionalHalls extends AbstractNpcAI
else if (event.startsWith(HALL_RESET_VAR))
{
final String id = event.replace(HALL_RESET_VAR, "");
- if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
{
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
if (clanId > 0)
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index 18f813b1a2..a3c74220a9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -19,6 +19,7 @@ package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -111,7 +112,7 @@ public class TrainingCamp extends AbstractNpcAI
player.teleToLocation(TRAINING_LOCATION);
player.setImmobilized(true);
// @Sdw: Here we are supposed to send ExUserInfoEquipSlot with a fake equip of a SLS, feels ugly to me, not doing it.
- player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
+ player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), Chronos.currentTimeMillis(), -1));
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
@@ -203,7 +204,7 @@ public class TrainingCamp extends AbstractNpcAI
final TrainingHolder holder = player.getTraingCampInfo();
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
index 49dfa6b963..6140daa716 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
@@ -16,6 +16,7 @@
*/
package events.FreyaCelebration;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -79,7 +80,7 @@ public class FreyaCelebration extends LongTimeEvent
{
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
if (currentTime > reuseTime)
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
index cce5b52533..d97b3c74db 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
@@ -16,6 +16,7 @@
*/
package events.GiftOfVitality;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -94,9 +95,9 @@ public class GiftOfVitality extends LongTimeEvent
case "vitality":
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -110,7 +111,7 @@ public class GiftOfVitality extends LongTimeEvent
{
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
htmltext = "4306-okvitality.htm";
}
break;
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/HappyHours/HappyHours.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/HappyHours/HappyHours.java
index b86300b754..652c30bac5 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/HappyHours/HappyHours.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/HappyHours/HappyHours.java
@@ -16,6 +16,7 @@
*/
package events.HappyHours;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -39,7 +40,7 @@ public class HappyHours extends LongTimeEvent
// Other
private static final int MIN_LEVEL = 20;
private static final int REWARD_INTERVAL = 60 * 60 * 1000; // 1 hour
- private static long _lastRewardTime = System.currentTimeMillis();
+ private static long _lastRewardTime = Chronos.currentTimeMillis();
private HappyHours()
{
@@ -76,9 +77,9 @@ public class HappyHours extends LongTimeEvent
{
if (isEventPeriod())
{
- if ((System.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
+ if ((Chronos.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
{
- _lastRewardTime = System.currentTimeMillis();
+ _lastRewardTime = Chronos.currentTimeMillis();
final ExShowScreenMessage screenMsg = new ExShowScreenMessage("You obtained 20 Sibi's coins.", ExShowScreenMessage.TOP_CENTER, 7000, 0, true, true);
final SystemMessage systemMsg = new SystemMessage(SystemMessageId.YOU_OBTAINED_S1_SIBIS_COINS);
systemMsg.addInt(20);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
index 038d7883b0..7fb3b481dd 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
@@ -16,6 +16,7 @@
*/
package events.LoveYourGatekeeper;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -58,9 +59,9 @@ public class LoveYourGatekeeper extends LongTimeEvent
if (player.getAdena() >= PRICE)
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -73,7 +74,7 @@ public class LoveYourGatekeeper extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, PRICE);
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
}
}
else
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
index 0898d8dbc5..088b261fbe 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
@@ -16,6 +16,7 @@
*/
package events.MasterOfEnchanting;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -86,7 +87,7 @@ public class MasterOfEnchanting extends LongTimeEvent
}
else if (event.equalsIgnoreCase("buy_scroll_24"))
{
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
final String value = player.getVariables().getString("MasterOfEnchanting", "");
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
@@ -100,7 +101,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
@@ -134,7 +135,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/SavingSanta/SavingSanta.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
index 4f95514f8c..b6900127dc 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -324,7 +325,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_rewardedPlayers.containsKey(pl.getAccountName()))
{
- final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
+ final long elapsedTimeSinceLastRewarded = Chronos.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
{
continue;
@@ -333,7 +334,7 @@ public class SavingSanta extends LongTimeEvent
else
{
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
- if ((System.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
+ if ((Chronos.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
{
_rewardedPlayers.put(pl.getAccountName(), time);
continue;
@@ -343,8 +344,8 @@ public class SavingSanta extends LongTimeEvent
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
- _rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
- player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
+ _rewardedPlayers.put(pl.getAccountName(), Chronos.currentTimeMillis());
+ player.getVariables().set("LAST_SANTA_REWARD", Chronos.currentTimeMillis());
startQuestTimer("SantaRewarding0", 500, santa, pl);
}
}
@@ -437,7 +438,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
{
startQuestTimer("SantaBlessings", 15000, null, null);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Npc santaHelper1 : _santaHelpers)
{
for (PlayerInstance plb : World.getInstance().getVisibleObjects(santaHelper1, PlayerInstance.class))
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
index 64d4112e1f..729838d853 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Collection;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.CursedWeapon;
@@ -209,7 +210,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
}
- cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
+ cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
cw.reActivate();
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
index 9801093a20..0e4285c8e3 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Calendar;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -66,7 +67,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
{
final Calendar nextChangeDate = Calendar.getInstance();
- nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
+ nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
html.replace("%sodtime%", nextChangeDate.getTime().toString());
}
else
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
index e2c17e3d50..dec3cec950 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,7 +119,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
int hours = 0;
int minutes = 0;
final int id = entry.getKey();
- final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
if (remainingTime > 0)
{
hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
index 5fffc77ae3..8c3faede2d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -233,7 +234,7 @@ public class AdminPunishment implements IAdminCommandHandler
long expirationTime = Integer.parseInt(exp);
if (expirationTime > 0)
{
- expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
+ expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
}
final PunishmentAffect affect = PunishmentAffect.getByName(af);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
index aa1d6dd435..ae1bb4e0b2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -60,7 +61,7 @@ public class AdminServerInfo implements IAdminCommandHandler
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
- html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
+ html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
html.replace("%serverUpTime%", getServerUpTime());
html.replace("%onlineAll%", getPlayersCount("ALL"));
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
@@ -76,7 +77,7 @@ public class AdminServerInfo implements IAdminCommandHandler
private String getServerUpTime()
{
- long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
+ long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
final long days = TimeUnit.MILLISECONDS.toDays(time);
time -= TimeUnit.DAYS.toMillis(days);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
index ff3b82a10f..21489c89f6 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IBypassHandler;
@@ -133,7 +134,7 @@ public class FindPvP implements IBypassHandler
player.setSpawnProtection(true);
if (!player.isGM())
{
- player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
player.startPvPFlag();
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
index a81161c50a..adb3c27701 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.dailymissionhandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -61,9 +62,9 @@ public class LoginMonthDailyMissionHandler extends AbstractDailyMissionHandler
final long lastCompleted = entry.getLastCompleted();
if (lastCompleted == 0) // Initial entry.
{
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
}
- else if ((System.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
+ else if ((Chronos.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
index 9fee9dd50e..0322107487 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
@@ -18,6 +18,7 @@ package handlers.dailymissionhandlers;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -63,7 +64,7 @@ public class LoginWeekendDailyMissionHandler extends AbstractDailyMissionHandler
final int currentDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
final long lastCompleted = entry.getLastCompleted();
if (((currentDay == Calendar.SATURDAY) || (currentDay == Calendar.SUNDAY)) // Reward only on weekend.
- && ((lastCompleted == 0) || ((System.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
+ && ((lastCompleted == 0) || ((Chronos.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
index 71928b144a..c2ea6f7a5a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.punishmenthandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.model.World;
@@ -126,7 +127,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
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 245af11bfa..2abbe8e8e8 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
@@ -17,6 +17,7 @@
package handlers.punishmenthandlers;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
@@ -180,7 +181,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
index 3dd1cdc97d..fd92c92ed9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Ban implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
index f653561c0d..85b92a163b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class BanChat implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
index cf3736fc0e..c21718ad0c 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Jail implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
index 43b6df41dc..a57194664d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
@@ -18,6 +18,7 @@ package handlers.usercommandhandlers;
import java.text.SimpleDateFormat;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -46,7 +47,7 @@ public class ClanPenalty implements IUserCommandHandler
final StringBuilder htmlContent = new StringBuilder(500);
htmlContent.append("");
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append("Unable to join a clan. | ");
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
@@ -54,7 +55,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append(" | Unable to create a clan. | ");
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
@@ -62,7 +63,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
+ if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
{
htmlContent.append(" | Unable to invite a clan member. | ");
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/usercommandhandlers/Time.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
index 530047a4f2..57bd48cd81 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Time implements IUserCommandHandler
player.sendPacket(sm);
if (Config.DISPLAY_SERVER_TIME)
{
- player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
+ player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
}
return true;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
index a2eab150c7..f727b3518f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
@@ -18,6 +18,7 @@ package handlers.voicedcommandhandlers;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
@@ -103,7 +104,7 @@ public class ChatAdmin implements IVoicedCommandHandler
return false;
}
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
if (expirationTime > 0)
{
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
index 213e03e20a..5bf36c47d0 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
@@ -19,6 +19,7 @@ package handlers.voicedcommandhandlers;
import java.text.SimpleDateFormat;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Premium implements IVoicedCommandHandler
html.append(" |
Spoil Chance: x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " |
");
html.append("Spoil Amount: x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " |
");
html.append("Expires: " + format.format(endDate) + " |
");
- html.append("Current Date: " + format.format(System.currentTimeMillis()) + "
|
");
+ html.append("Current Date: " + format.format(Chronos.currentTimeMillis()) + "
|
");
html.append("Premium Info & Rules
|
");
html.append("1. Premium accounts CAN NOT BE TRANSFERED. |
");
html.append("2. Premium does not effect party members. |
");
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 4dedee6473..6a07191990 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
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -156,7 +157,7 @@ public class CastleDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -174,7 +175,7 @@ public class CastleDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
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 686b01379b..ea8ca11b83 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
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -169,7 +170,7 @@ public class FortressDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -197,7 +198,7 @@ public class FortressDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
index 298c540332..cba8d2bb56 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
@@ -469,7 +470,7 @@ public class Kamaloka extends AbstractInstance
continue;
}
// if found instance still can't be reentered - exit
- if (System.currentTimeMillis() < entry.getValue().longValue())
+ if (Chronos.currentTimeMillis() < entry.getValue().longValue())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
sm.addPcName(partyMember);
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
index b3de2f227a..31fa72d28c 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
@@ -260,7 +261,7 @@ public class PailakaRuneCastle extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first wave
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
}
@@ -280,7 +281,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
@@ -309,7 +310,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/Chronos.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/Chronos.java
new file mode 100644
index 0000000000..a4d15f77e5
--- /dev/null
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/Chronos.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2021 Pantelis Andrianakis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.l2jmobius.commons.util;
+
+/**
+ * Chronos updates an internal long value with System.currentTimeMillis() approximately every 1 millisecond.
+ * To get the current time in milliseconds use Chronos.currentTimeMillis()
+ * @author Pantelis Andrianakis
+ * @version February 3rd 2021
+ */
+public class Chronos extends Thread
+{
+ private long _currentTimeMillis = System.currentTimeMillis();
+
+ public Chronos()
+ {
+ super.setName("Chronos");
+ super.setPriority(MAX_PRIORITY);
+ super.setDaemon(true);
+ super.start();
+ }
+
+ @Override
+ public void run()
+ {
+ while (true)
+ {
+ _currentTimeMillis = System.currentTimeMillis();
+
+ // Sleep for approximately 1 millisecond.
+ try
+ {
+ Thread.sleep(1);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /**
+ * Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond,the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
+ *
+ * See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).
+ * @return the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+ */
+ public static long currentTimeMillis()
+ {
+ return getInstance()._currentTimeMillis;
+ }
+
+ public static Chronos getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final Chronos INSTANCE = new Chronos();
+ }
+}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/GameServer.java
index 7187525e28..9e4183a551 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/GameServer.java
@@ -32,6 +32,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.enums.ServerMode;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.DeadLockDetector;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.BotReportTable;
@@ -180,7 +181,7 @@ public class GameServer
public GameServer() throws Exception
{
- final long serverLoadStart = System.currentTimeMillis();
+ final long serverLoadStart = Chronos.currentTimeMillis();
// GUI
if (!GraphicsEnvironment.isHeadless())
@@ -461,7 +462,7 @@ public class GameServer
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
- LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
+ LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
ClientNetworkManager.getInstance().start();
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/GameTimeController.java
index aa4d359090..48391b466d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/GameTimeController.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange;
@@ -97,7 +98,7 @@ public class GameTimeController extends Thread
*/
public int getGameTicks()
{
- return (int) ((System.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
+ return (int) ((Chronos.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
}
/**
@@ -155,7 +156,7 @@ public class GameTimeController extends Thread
while (true)
{
- nextTickTime = ((System.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
+ nextTickTime = ((Chronos.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
try
{
@@ -166,7 +167,7 @@ public class GameTimeController extends Thread
LOGGER.log(Level.WARNING, getClass().getSimpleName(), e);
}
- sleepTime = nextTickTime - System.currentTimeMillis();
+ sleepTime = nextTickTime - Chronos.currentTimeMillis();
if (sleepTime > 0)
{
try
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
index 2fcae24603..cfb16ebb07 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -42,7 +43,7 @@ public class ItemsAutoDestroy
public synchronized void addItem(ItemInstance item)
{
- item.setDropTime(System.currentTimeMillis());
+ item.setDropTime(Chronos.currentTimeMillis());
_items.add(item);
}
@@ -53,7 +54,7 @@ public class ItemsAutoDestroy
return;
}
- final long curtime = System.currentTimeMillis();
+ final long curtime = Chronos.currentTimeMillis();
final Iterator itemIterator = _items.iterator();
while (itemIterator.hasNext())
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/Shutdown.java
index 5279bac36d..d7328247aa 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/Shutdown.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseBackup;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
@@ -529,19 +530,19 @@ public class Shutdown extends Thread
protected void restartCounter()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
}
protected long getEstimatedTimeAndRestartCounter()
{
- final long toReturn = System.currentTimeMillis() - _startTime;
+ final long toReturn = Chronos.currentTimeMillis() - _startTime;
restartCounter();
return toReturn;
}
protected long getEstimatedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/CreatureAI.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/CreatureAI.java
index 22de59f51a..e03e0463be 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/CreatureAI.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/CreatureAI.java
@@ -33,6 +33,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -308,7 +309,7 @@ public class CreatureAI extends AbstractAI
if (_actor.isAttackingNow())
{
- ThreadPool.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(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index fa5cca3384..26734231aa 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -39,7 +40,7 @@ public class WarehouseCacheManager
public void addCacheTask(PlayerInstance pc)
{
- CACHED_WH.put(pc, System.currentTimeMillis());
+ CACHED_WH.put(pc, Chronos.currentTimeMillis());
}
public void remCacheTask(PlayerInstance pc)
@@ -56,7 +57,7 @@ public class WarehouseCacheManager
@Override
public void run()
{
- final long cTime = System.currentTimeMillis();
+ final long cTime = Chronos.currentTimeMillis();
for (Entry entry : CACHED_WH.entrySet())
{
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/BotReportTable.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/BotReportTable.java
index 0e2f9777b7..46e025bd3d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/BotReportTable.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/BotReportTable.java
@@ -39,6 +39,7 @@ import org.xml.sax.helpers.DefaultHandler;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -124,7 +125,7 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() < c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() < c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
}
@@ -290,7 +291,7 @@ public class BotReportTable
return false;
}
- final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
+ final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
@@ -301,7 +302,7 @@ public class BotReportTable
}
}
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
if (rcd == null)
{
rcd = new ReportedCharData();
@@ -418,12 +419,12 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() > c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() > c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
}
- ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
+ ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - Chronos.currentTimeMillis());
}
catch (Exception e)
{
@@ -464,7 +465,7 @@ public class BotReportTable
{
if (map.containsKey(objectId))
{
- return (System.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
+ return (Chronos.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
}
return true;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/sql/ClanTable.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
index 4e4da8df06..10f7e0b311 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.enums.ClanWarState;
@@ -171,7 +172,7 @@ public class ClanTable
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
return null;
}
- if (System.currentTimeMillis() < player.getClanCreateExpiryTime())
+ if (Chronos.currentTimeMillis() < player.getClanCreateExpiryTime())
{
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
return null;
@@ -346,7 +347,7 @@ public class ClanTable
{
destroyClan(clanId);
}
- }, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
+ }, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
}
public boolean isAllyExists(String allyName)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index 49b0381c91..c3ab796fbf 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World;
@@ -185,7 +186,7 @@ public class OfflineTraderTable
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- if (cal.getTimeInMillis() <= System.currentTimeMillis())
+ if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
{
continue;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
index b3199b0dd4..5d40e78e51 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
import org.l2jmobius.gameserver.model.DailyMissionPlayerEntry;
@@ -107,7 +108,7 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
final DailyMissionPlayerEntry entry = getPlayerEntry(player.getObjectId(), true);
entry.setStatus(DailyMissionStatus.COMPLETED);
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
entry.setRecentlyCompleted(true);
storePlayerEntry(entry);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
index 025c3208e6..ecb5b8dc95 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.enums.PlayerAction;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -115,7 +116,7 @@ public class AdminCommandHandler implements IHandler
{
- final long begin = System.currentTimeMillis();
+ final long begin = Chronos.currentTimeMillis();
try
{
if (Config.GMAUDIT)
@@ -133,7 +134,7 @@ public class AdminCommandHandler implements IHandler 5000)
{
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
index fedf7cd9dc..ee7642eca5 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -48,7 +49,7 @@ public class AntiFeedManager
*/
public void setLastDeathTime(int objectId)
{
- _lastDeathTimes.put(objectId, System.currentTimeMillis());
+ _lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
}
/**
@@ -81,7 +82,7 @@ public class AntiFeedManager
return false;
}
- if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
+ if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((Chronos.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
{
return false;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index 3d8c1f50e4..301806d976 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ManorMode;
@@ -276,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
- ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
+ ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
}
public void changeMode()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
index 4a91b5c214..64143c7c65 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.model.CursedWeapon;
import org.l2jmobius.gameserver.model.actor.Attackable;
@@ -313,7 +314,7 @@ public class CursedWeaponsManager implements IXmlReader
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING);
sm.addString(cw.getName());
// sm.addItemName(cw.getItemId());
- sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
+ sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
player.sendPacket(sm);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index 72602e0968..babf2e1476 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -193,7 +194,7 @@ public class DBSpawnManager
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
- final long respawnTime = System.currentTimeMillis() + respawnDelay;
+ final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
info.set("currentHP", npc.getMaxHp());
info.set("currentMP", npc.getMaxMp());
info.set("respawnTime", respawnTime);
@@ -235,7 +236,7 @@ public class DBSpawnManager
}
final int npcId = spawn.getId();
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SpawnTable.getInstance().addNewSpawn(spawn, false);
if ((respawnTime == 0) || (time > respawnTime))
{
@@ -257,7 +258,7 @@ public class DBSpawnManager
}
else
{
- final long spawnTime = respawnTime - System.currentTimeMillis();
+ final long spawnTime = respawnTime - Chronos.currentTimeMillis();
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index 60a818cab6..06cce0d3a3 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -21,6 +21,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -104,7 +105,7 @@ public class GraciaSeedsManager
case 2:
{
// Conquest Complete state, if too much time is passed than change to defense state
- final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
+ final long timePast = Chronos.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
if (timePast >= Config.SOD_STAGE_2_LENGTH)
{
// change to Attack state because Defend statet is not implemented
@@ -172,7 +173,7 @@ public class GraciaSeedsManager
public void setSoDState(int value, boolean doSave)
{
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
- _SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
+ _SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
_SoDState = value;
// reset number of Tiat kills
if (_SoDState == 1)
@@ -198,7 +199,7 @@ public class GraciaSeedsManager
}
case 2:
{
- return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
+ return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
}
case 3:
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index d595a5befa..052f8984d2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.util.PrimeFinder;
/**
@@ -85,7 +86,7 @@ public class IdManager
try (Connection con = DatabaseFactory.getConnection();
Statement statement = con.createStatement())
{
- final long cleanupStart = System.currentTimeMillis();
+ final long cleanupStart = Chronos.currentTimeMillis();
int cleanCount = 0;
// Characters
@@ -157,7 +158,7 @@ public class IdManager
statement.executeUpdate("UPDATE characters SET clanid=0, clan_privs=0, wantspeace=0, subpledge=0, lvl_joined_academy=0, apprentice=0, sponsor=0, clan_join_expiry_time=0, clan_create_expiry_time=0 WHERE characters.clanid > 0 AND characters.clanid NOT IN (SELECT clan_id FROM clan_data);");
statement.executeUpdate("UPDATE fort SET owner=0 WHERE owner NOT IN (SELECT clan_id FROM clan_data);");
- LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((System.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
+ LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((Chronos.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
}
catch (Exception e)
{
@@ -173,7 +174,7 @@ public class IdManager
{
try (PreparedStatement statement = con.prepareStatement(line))
{
- statement.setLong(1, System.currentTimeMillis());
+ statement.setLong(1, Chronos.currentTimeMillis());
cleanCount += statement.executeUpdate();
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
index d47e436ace..d1f8cd35e2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
@@ -40,6 +40,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.data.xml.SpawnData;
@@ -521,7 +522,7 @@ public class InstanceManager implements IXmlReader
{
// Check if instance penalty passed
final long time = rs.getLong("time");
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
// Load params
final int charId = rs.getInt("charId");
@@ -556,7 +557,7 @@ public class InstanceManager implements IXmlReader
final List invalidPenalty = new ArrayList<>(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- if (entry.getValue() <= System.currentTimeMillis())
+ if (entry.getValue() <= Chronos.currentTimeMillis())
{
invalidPenalty.add(entry.getKey());
}
@@ -615,7 +616,7 @@ public class InstanceManager implements IXmlReader
// If reenter time is higher then current, delete it
final long time = playerData.get(id);
- if (time <= System.currentTimeMillis())
+ if (time <= Chronos.currentTimeMillis())
{
deleteInstanceTime(player, id);
return -1;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 739f67e9a9..dfb4734ca5 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -83,7 +84,7 @@ public class ItemsOnGroundManager implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(str))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.execute();
}
catch (Exception e)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
index df45860d40..d429a2f8c9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Mentee;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -145,7 +146,7 @@ public class MentorManager
{
final PlayerInstance player = World.getInstance().getPlayer(mentorId);
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
- vars.set("Mentor-Penalty-" + mentorId, String.valueOf(System.currentTimeMillis() + penalty));
+ vars.set("Mentor-Penalty-" + mentorId, String.valueOf(Chronos.currentTimeMillis() + penalty));
}
public long getMentorPenalty(int mentorId)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
index 7768cebd95..ba4e95fe3f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.Containers;
@@ -79,7 +80,7 @@ public class PremiumManager
final PlayerInstance player = event.getPlayer();
final String accountName = player.getAccountName();
loadPremiumData(accountName);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
final long premiumExpiration = getPremiumExpiration(accountName);
player.setPremiumStatus(premiumExpiration > now);
if (player.hasPremiumStatus())
@@ -153,7 +154,7 @@ public class PremiumManager
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
{
final long addTime = timeUnit.toMillis(timeValue);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
// new premium task at least from now
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
final long newPremiumExpiration = oldPremiumExpiration + addTime;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
index 9617f26e43..08193f9c5b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
@@ -71,7 +72,7 @@ public class PunishmentManager
final String punishedBy = rset.getString("punishedBy");
if ((type != null) && (affect != null))
{
- if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
+ if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
{
expired++;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
index 687d1288b9..ab73056bb1 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -424,7 +425,7 @@ public class BlockChecker
// Start up player parameters
setUpPlayers();
// Set the started time
- _startedTime = System.currentTimeMillis() + 300000;
+ _startedTime = Chronos.currentTimeMillis() + 300000;
}
}
@@ -524,7 +525,7 @@ public class BlockChecker
_redPoints += _numOfBoxes / 2;
_bluePoints += _numOfBoxes / 2;
- final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((_startedTime - Chronos.currentTimeMillis()) / 1000);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
_holder.broadCastPacketToTeam(changePoints);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/CursedWeapon.java
index 07e4d9b6d6..cf80e1b21a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/CursedWeapon.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
@@ -237,7 +238,7 @@ public class CursedWeapon implements INamable
@Override
public void run()
{
- if (System.currentTimeMillis() >= _endTime)
+ if (Chronos.currentTimeMillis() >= _endTime)
{
endOfLife();
}
@@ -366,7 +367,7 @@ public class CursedWeapon implements INamable
public void reActivate()
{
_isActivated = true;
- if ((_endTime - System.currentTimeMillis()) <= 0)
+ if ((_endTime - Chronos.currentTimeMillis()) <= 0)
{
endOfLife();
}
@@ -384,7 +385,7 @@ public class CursedWeapon implements INamable
dropIt(attackable, player);
// Start the Life Task
- _endTime = System.currentTimeMillis() + (_duration * 60000);
+ _endTime = Chronos.currentTimeMillis() + (_duration * 60000);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
return true;
}
@@ -678,7 +679,7 @@ public class CursedWeapon implements INamable
public long getTimeLeft()
{
- return _endTime - System.currentTimeMillis();
+ return _endTime - Chronos.currentTimeMillis();
}
public void goTo(PlayerInstance player)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/ItemInfo.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/ItemInfo.java
index 9ea4c13763..16f3dfe23e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/ItemInfo.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/ItemInfo.java
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.model.buylist.Product;
import org.l2jmobius.gameserver.model.ensoul.EnsoulOption;
@@ -151,14 +152,14 @@ public class ItemInfo
_soulCrystalOptions = item.getSpecialAbilities();
_soulCrystalSpecialOptions = item.getAdditionalSpecialAbilities();
_visualId = item.getVisualId();
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(ItemInstance item, int change)
{
this(item);
_change = change;
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(TradeItem item)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Message.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Message.java
index e6b1c31d32..53d2f20768 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Message.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Message.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.enums.MailType;
@@ -104,7 +105,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = text;
- _expiration = (isCod ? System.currentTimeMillis() + (COD_EXPIRATION * 3600000) : System.currentTimeMillis() + (EXPIRATION * 3600000));
+ _expiration = (isCod ? Chronos.currentTimeMillis() + (COD_EXPIRATION * 3600000) : Chronos.currentTimeMillis() + (EXPIRATION * 3600000));
_hasAttachments = false;
_unread = true;
_deletedBySender = false;
@@ -123,7 +124,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_reqAdena = 0;
_hasAttachments = false;
_unread = true;
@@ -143,7 +144,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_hasAttachments = false;
_unread = true;
_deletedBySender = true;
@@ -162,7 +163,7 @@ public class Message
_receiverId = msg.getSenderId();
_subject = "";
_content = "";
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_deletedByReceiver = false;
@@ -182,7 +183,7 @@ public class Message
_receiverId = receiverId;
_subject = "";
_content = item.getName();
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_messageType = mailType;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Petition.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Petition.java
index b19b6f9025..d3f95461ac 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Petition.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Petition.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PetitionState;
import org.l2jmobius.gameserver.enums.PetitionType;
import org.l2jmobius.gameserver.instancemanager.IdManager;
@@ -36,7 +37,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class Petition
{
- private final long _submitTime = System.currentTimeMillis();
+ private final long _submitTime = Chronos.currentTimeMillis();
private final int _id;
private final PetitionType _type;
private PetitionState _state = PetitionState.PENDING;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Spawn.java
index 4a1a2926b3..eb57e4e69b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -258,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
_scheduledCount++;
// Schedule the next respawn.
- RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
+ RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/TimeStamp.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/TimeStamp.java
index 8c232969e0..9bdb39d293 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/TimeStamp.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/TimeStamp.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -52,7 +53,7 @@ public class TimeStamp
_id2 = skill.getLevel();
_id3 = skill.getSubLevel();
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = -1;
}
@@ -68,7 +69,7 @@ public class TimeStamp
_id2 = item.getObjectId();
_id3 = 0;
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = item.getSharedReuseGroup();
}
@@ -155,7 +156,7 @@ public class TimeStamp
{
return 0;
}
- final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
+ final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
if (remainingTime == 0)
{
_stamp = 0;
@@ -173,7 +174,7 @@ public class TimeStamp
{
return false;
}
- final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
+ final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
if (!hasNotPassed)
{
_stamp = 0;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java
index 0410084704..e39ed646e7 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.AttackableAI;
import org.l2jmobius.gameserver.ai.CreatureAI;
@@ -216,7 +217,7 @@ public class Attackable extends Npc
if (_firstCommandChannelAttacked != null)
{
_commandChannelTimer = new CommandChannelTimer(this);
- _commandChannelLastAttack = System.currentTimeMillis();
+ _commandChannelLastAttack = Chronos.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
@@ -225,7 +226,7 @@ public class Attackable extends Npc
}
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
{
- _commandChannelLastAttack = System.currentTimeMillis(); // update last attack time
+ _commandChannelLastAttack = Chronos.currentTimeMillis(); // update last attack time
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java
index c5fbce130c..32bca5211c 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -41,6 +41,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.EmptyQueue;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -1393,7 +1394,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : _reuseTimeStampsItems.values())
{
if (ts.getSharedReuseGroup() == group)
@@ -1523,7 +1524,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return;
}
- _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? System.currentTimeMillis() + delay : Long.MAX_VALUE);
+ _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? Chronos.currentTimeMillis() + delay : Long.MAX_VALUE);
}
/**
@@ -1571,7 +1572,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return false;
}
- if (stamp < System.currentTimeMillis())
+ if (stamp < Chronos.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java
index 62f1d1049f..d288fe8816 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -203,7 +204,7 @@ public class Npc extends Creature
public void onRandomAnimation(int animationId)
{
// Send a packet SocialAction to all PlayerInstance in the _KnownPlayers of the NpcInstance
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
{
_lastSocialBroadcast = now;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
index 7eacda4aa1..c87a2006a9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.actor.instance;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
@@ -141,7 +142,7 @@ public class BlockInstance extends MonsterInstance
{
eng.increasePlayerPoints(player, team);
- final int timeLeft = (int) ((eng.getStarterTime() - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((eng.getStarterTime() - Chronos.currentTimeMillis()) / 1000);
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints());
final ExCubeGameExtendedChangePoints secretPoints = new ExCubeGameExtendedChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints(), isRed, player, eng.getPlayerPoints(player, isRed));
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 31eae4c958..7a3e082df3 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -45,6 +45,7 @@ import java.util.stream.Collectors;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -2836,7 +2837,7 @@ public class PlayerInstance extends Playable
public void setOnlineTime(long time)
{
_onlineTime = time;
- _onlineBeginTime = System.currentTimeMillis();
+ _onlineBeginTime = Chronos.currentTimeMillis();
}
/**
@@ -3895,22 +3896,22 @@ public class PlayerInstance extends Playable
public boolean isSpawnProtected()
{
- return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
+ return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
}
public boolean isTeleportProtected()
{
- return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
+ return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
}
public void setSpawnProtection(boolean protect)
{
- _spawnProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
+ _spawnProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
}
public void setTeleportProtection(boolean protect)
{
- _teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
+ _teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
}
/**
@@ -5235,7 +5236,7 @@ public class PlayerInstance extends Playable
{
return;
}
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
if (_pvpFlag == 0)
{
startPvPFlag();
@@ -5268,11 +5269,11 @@ public class PlayerInstance extends Playable
{
if (checkIfPvP(targetPlayer))
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
}
else
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
}
if (_pvpFlag == 0)
{
@@ -6149,7 +6150,7 @@ public class PlayerInstance extends Playable
public long getUptime()
{
- return System.currentTimeMillis() - _uptime;
+ return Chronos.currentTimeMillis() - _uptime;
}
/**
@@ -6393,7 +6394,7 @@ public class PlayerInstance extends Playable
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
{
statement.setInt(1, isOnlineInt());
- statement.setLong(2, System.currentTimeMillis());
+ statement.setLong(2, Chronos.currentTimeMillis());
statement.setInt(3, getObjectId());
statement.execute();
}
@@ -6519,12 +6520,12 @@ public class PlayerInstance extends Playable
}
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
- if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanJoinExpiryTime(0);
}
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
- if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanCreateExpiryTime(0);
}
@@ -6586,7 +6587,7 @@ public class PlayerInstance extends Playable
player.getAppearance().setTitleColor(titleColor);
}
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
- player.setUptime(System.currentTimeMillis());
+ player.setUptime(Chronos.currentTimeMillis());
currentHp = rset.getDouble("curHp");
currentCp = rset.getDouble("curCp");
@@ -7103,7 +7104,7 @@ public class PlayerInstance extends Playable
long totalOnlineTime = _onlineTime;
if (_onlineBeginTime > 0)
{
- totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
+ totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
}
statement.setLong(34, totalOnlineTime);
@@ -7189,7 +7190,7 @@ public class PlayerInstance extends Playable
int buffIndex = 0;
final List storedSkills = new ArrayList<>();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
// Store all effect data along with calulated remaining
// reuse delays for matching skills. 'restore_type'= 0.
@@ -7304,7 +7305,7 @@ public class PlayerInstance extends Playable
ps1.setInt(1, getObjectId());
ps1.execute();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : getItemReuseTimeStamps().values())
{
if ((ts != null) && (currentTime < ts.getStamp()))
@@ -7627,7 +7628,7 @@ public class PlayerInstance extends Playable
statement.setInt(2, _classIndex);
try (ResultSet rset = statement.executeQuery())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
final int remainingTime = rset.getInt("remaining_time");
@@ -7689,7 +7690,7 @@ public class PlayerInstance extends Playable
long systime;
boolean isInInventory;
long remainingTime;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
itemId = rset.getInt("itemId");
@@ -7764,7 +7765,7 @@ public class PlayerInstance extends Playable
{
int slot;
int symbolId;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
slot = rset.getInt("slot");
@@ -7887,7 +7888,7 @@ public class PlayerInstance extends Playable
// Send Server->Client UserInfo packet to this PlayerInstance
broadcastUserInfo(UserInfoType.BASE_STATS, UserInfoType.MAX_HPCPMP, UserInfoType.STATS, UserInfoType.SPEED);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long timeLeft = getVariables().getLong("HennaDuration" + slot, currentTime) - currentTime;
if ((henna.getDuration() < 0) || (timeLeft > 0))
{
@@ -7978,7 +7979,7 @@ public class PlayerInstance extends Playable
// Task for henna duration
if (henna.getDuration() > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
@@ -12426,7 +12427,7 @@ public class PlayerInstance extends Playable
public int getBirthdays()
{
- long time = (System.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
+ long time = (Chronos.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
time /= TimeUnit.DAYS.toMillis(365);
return (int) time;
}
@@ -12666,7 +12667,7 @@ public class PlayerInstance extends Playable
return false;
}
- if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
+ if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@@ -12726,7 +12727,7 @@ public class PlayerInstance extends Playable
*/
public void setFalling()
{
- _fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
+ _fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
}
/**
@@ -12747,7 +12748,7 @@ public class PlayerInstance extends Playable
*/
public void updateLastItemAuctionRequest()
{
- _lastItemAuctionInfoRequest = System.currentTimeMillis();
+ _lastItemAuctionInfoRequest = Chronos.currentTimeMillis();
}
/**
@@ -12756,7 +12757,7 @@ public class PlayerInstance extends Playable
*/
public boolean isItemAuctionPolling()
{
- return (System.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
+ return (Chronos.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
}
@Override
@@ -13140,7 +13141,7 @@ public class PlayerInstance extends Playable
public void updateNotMoveUntil()
{
- _notMoveUntil = System.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
+ _notMoveUntil = Chronos.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
}
@Override
@@ -14217,7 +14218,7 @@ public class PlayerInstance extends Playable
public boolean isInTraingCamp()
{
final TrainingHolder trainingHolder = getTraingCampInfo();
- return (trainingHolder != null) && (trainingHolder.getEndTime() > System.currentTimeMillis());
+ return (trainingHolder != null) && (trainingHolder.getEndTime() > Chronos.currentTimeMillis());
}
public AttendanceInfoHolder getAttendanceInfo()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
index 7d586645f8..a667254408 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
@@ -22,6 +22,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.AcquireSkillType;
@@ -35,9 +36,9 @@ import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.Clan.SubPledge;
+import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.siege.Castle;
import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -338,13 +339,13 @@ public class VillageMasterInstance extends NpcInstance
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
return;
}
- clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setDissolvingExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
// The clan leader should take the XP penalty of a full death.
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 843165d245..18d77105c7 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.attackable;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
/**
@@ -40,7 +41,7 @@ public class CommandChannelTimer implements Runnable
return;
}
- if ((System.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
+ if ((Chronos.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
{
_attackable.setCommandChannelTimer(null);
_attackable.setFirstCommandChannelAttacked(null);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
index e2130407ac..290e49a99f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.player;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -92,12 +93,12 @@ public class IllegalPlayerActionTask implements Runnable
}
case KICKBAN:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
case JAIL:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/buylist/Product.java
index 0782846eba..3fc18a73e3 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/buylist/Product.java
@@ -25,6 +25,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.type.EtcItemType;
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
@@ -134,7 +135,7 @@ public class Product
public void restartRestockTask(long nextRestockTime)
{
- final long remainTime = nextRestockTime - System.currentTimeMillis();
+ final long remainTime = nextRestockTime - Chronos.currentTimeMillis();
if (remainTime > 0)
{
BuyListTaskManager.getInstance().update(this, remainTime);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
index 1ccabadff3..1355481e68 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
import org.l2jmobius.gameserver.enums.QuestSound;
@@ -278,7 +279,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
});
}
}
- _battleStartTime = System.currentTimeMillis();
+ _battleStartTime = Chronos.currentTimeMillis();
getTimers().addRepeatingTimer("update", 1000, null, null);
}
@@ -505,7 +506,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
private void updateLifeTime(CeremonyOfChaosMember member)
{
- member.setLifeTime(((int) (System.currentTimeMillis() - _battleStartTime) / 1000));
+ member.setLifeTime(((int) (Chronos.currentTimeMillis() - _battleStartTime) / 1000));
}
public List getWinners()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/clan/Clan.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/clan/Clan.java
index 7df3de05ce..d76dcec76f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/clan/Clan.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/clan/Clan.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -498,7 +499,7 @@ public class Clan implements IIdentifiable, INamable
if (player.isClanLeader())
{
SiegeManager.getInstance().removeSiegeSkills(player);
- player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ player.setClanCreateExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
}
// remove Clan skills from Player
@@ -531,7 +532,7 @@ public class Clan implements IIdentifiable, INamable
}
else
{
- removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
+ removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
}
// Notify to scripts
@@ -1091,12 +1092,12 @@ public class Clan implements IIdentifiable, INamable
setAllyId(clanData.getInt("ally_id"));
setAllyName(clanData.getString("ally_name"));
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
- if (_allyPenaltyExpiryTime < System.currentTimeMillis())
+ if (_allyPenaltyExpiryTime < Chronos.currentTimeMillis())
{
setAllyPenaltyExpiryTime(0, 0);
}
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
- if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
+ if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < Chronos.currentTimeMillis()) // 24*60*60*1000 = 86400000
{
setCharPenaltyExpiryTime(0);
}
@@ -2207,7 +2208,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
return false;
}
- if (_charPenaltyExpiryTime > System.currentTimeMillis())
+ if (_charPenaltyExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return false;
@@ -2219,7 +2220,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (target.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (target.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(target.getName());
@@ -2268,7 +2269,7 @@ public class Clan implements IIdentifiable, INamable
return false;
}
final Clan leaderClan = player.getClan();
- if (leaderClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (leaderClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN)
{
@@ -2307,7 +2308,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
{
@@ -2401,12 +2402,12 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
return;
}
- if ((_allyPenaltyExpiryTime > System.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
+ if ((_allyPenaltyExpiryTime > Chronos.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
return;
}
- if (_dissolvingExpiryTime > System.currentTimeMillis())
+ if (_dissolvingExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
return;
@@ -2458,7 +2459,7 @@ public class Clan implements IIdentifiable, INamable
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
{
if (clan.getId() != getId())
@@ -2484,7 +2485,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
return false;
}
- if (System.currentTimeMillis() < _dissolvingExpiryTime)
+ if (Chronos.currentTimeMillis() < _dissolvingExpiryTime)
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
return false;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/clan/ClanWar.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
index 22b82ab179..ebb01d6c06 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -54,9 +55,9 @@ public class ClanWar
{
_attackerClanId = attacker.getId();
_attackedClanId = attacked.getId();
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_state = ClanWarState.BLOOD_DECLARATION;
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
attacker.addWar(attacked.getId(), this);
attacked.addWar(attacker.getId(), this);
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
@@ -79,15 +80,15 @@ public class ClanWar
_attackerKillCount.set(attackerKillCount);
_attackedKillCount.set(attackedKillCount);
_winnerClanId = winnerClan;
- if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > System.currentTimeMillis())
+ if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > Chronos.currentTimeMillis())
{
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
}
if (_endTime > 0)
{
final long endTimePeriod = _endTime + (_state == ClanWarState.TIE ? TIME_TO_DELETION_AFTER_CANCELLATION : TIME_TO_DELETION_AFTER_DEFEAT);
- if (endTimePeriod > System.currentTimeMillis())
+ if (endTimePeriod > Chronos.currentTimeMillis())
{
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(_attackerClanId, _attackedClanId), 10000);
}
@@ -177,8 +178,8 @@ public class ClanWar
winnerClan.broadcastToOnlineMembers(sm);
_winnerClanId = winnerClan.getId();
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - Chronos.currentTimeMillis());
}
public void clanWarTimeout()
@@ -196,8 +197,8 @@ public class ClanWar
attackerClan.broadcastToOnlineMembers(sm);
_state = ClanWarState.TIE;
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - Chronos.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index f150ec3238..b1b3a83fd1 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.StatSet;
import it.sauronsoftware.cron4j.PastPredictor;
@@ -112,7 +113,7 @@ public class EventScheduler
final Predictor predictor = new Predictor(_pattern);
final long nextSchedule = predictor.nextMatchingTime();
- final long timeSchedule = nextSchedule - System.currentTimeMillis();
+ final long timeSchedule = nextSchedule - Chronos.currentTimeMillis();
if (timeSchedule <= (30 * 1000))
{
LOGGER.warning("Wrong reschedule for " + _eventManager.getClass().getSimpleName() + " end up run in " + (timeSchedule / 1000) + " seconds!");
@@ -144,10 +145,10 @@ public class EventScheduler
{
ps.setString(1, _eventManager.getName());
ps.setString(2, _name);
- ps.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(3, new Timestamp(Chronos.currentTimeMillis()));
ps.setString(4, _eventManager.getName());
ps.setString(5, _name);
- ps.setTimestamp(6, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(6, new Timestamp(Chronos.currentTimeMillis()));
ps.execute();
return true;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/events/EventType.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/events/EventType.java
index aa64ab0744..eebca64a89 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/events/EventType.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/events/EventType.java
@@ -76,7 +76,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
@@ -84,8 +83,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaR
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemAdd;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDestroy;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDrop;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemTransfer;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
@@ -114,7 +115,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
index 77e7205bfa..6139454534 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -85,7 +86,7 @@ public class TrainingHolder implements Serializable
public long getElapsedTime()
{
- return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
+ return TimeUnit.SECONDS.convert(Chronos.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
index 6c9ca907b7..62649739ea 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -39,6 +39,7 @@ import java.util.stream.Stream;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -105,7 +106,7 @@ public class Instance implements IIdentifiable, INamable
// Set basic instance info
_id = id;
_template = template;
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_spawns = new ArrayList<>(template.getSpawns().size());
// Clone and add the spawn templates
@@ -755,7 +756,7 @@ public class Instance implements IIdentifiable, INamable
}
// Set new cleanup task
- _endTime = System.currentTimeMillis() + millis;
+ _endTime = Chronos.currentTimeMillis() + millis;
if (minutes < 1) // Destroy instance
{
destroy();
@@ -858,7 +859,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getElapsedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
/**
@@ -867,7 +868,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getRemainingTime()
{
- return (_endTime == -1) ? -1 : (_endTime - System.currentTimeMillis());
+ return (_endTime == -1) ? -1 : (_endTime - Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
index 973dab1661..84466d8e0a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.GroupType;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -547,7 +548,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
{
if (data.getTime() > 0)
{
- time = System.currentTimeMillis() + data.getTime();
+ time = Chronos.currentTimeMillis() + data.getTime();
break;
}
@@ -557,7 +558,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
calendar.set(Calendar.SECOND, 0);
// If calendar time is lower than current, add one more day
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
@@ -574,7 +575,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Set exact day. If modified date is before current, add one more week.
calendar.set(Calendar.DAY_OF_WEEK, day);
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.WEEK_OF_MONTH, 1);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
index 1850d30783..07ce5a3538 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.instancezone.conditions;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -39,6 +40,6 @@ public class ConditionReenter extends Condition
protected boolean test(PlayerInstance player, Npc npc)
{
final int instanceId = getParameters().getInt("instanceId", getInstanceTemplate().getId());
- return System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
+ return Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index fbe1e21414..a1b1f40b26 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.ItemInfo;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -181,12 +182,12 @@ public class ItemAuction
public long getStartingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public long getFinishingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public void storeMe()
@@ -339,7 +340,7 @@ public class ItemAuction
_highestBid = bid;
}
- if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
+ if ((_endingTime - Chronos.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
{
switch (_auctionEndingExtendState)
{
@@ -426,7 +427,7 @@ public class ItemAuction
}
case FINISHED:
{
- if (_startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
+ if (_startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
{
return false;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 8d81451dc9..f14581064a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -243,7 +244,7 @@ public class ItemAuctionInstance
{
case 0:
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
case 1:
@@ -252,10 +253,10 @@ public class ItemAuctionInstance
{
case CREATED:
{
- if (auctions[0].getStartingTime() < (System.currentTimeMillis() + START_TIME_SPACE))
+ if (auctions[0].getStartingTime() < (Chronos.currentTimeMillis() + START_TIME_SPACE))
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
else
{
@@ -266,13 +267,13 @@ public class ItemAuctionInstance
case STARTED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, System.currentTimeMillis() + START_TIME_SPACE));
+ nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, Chronos.currentTimeMillis() + START_TIME_SPACE));
break;
}
case FINISHED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
default:
@@ -287,7 +288,7 @@ public class ItemAuctionInstance
{
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
// just to make sure we won't skip any auction because of little different times
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (ItemAuction auction : auctions)
{
if (auction.getAuctionState() == ItemAuctionState.STARTED)
@@ -311,7 +312,7 @@ public class ItemAuctionInstance
}
if (nextAuction == null)
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
break;
}
@@ -326,17 +327,17 @@ public class ItemAuctionInstance
{
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
}
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
}
}
@@ -422,7 +423,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -432,7 +433,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -442,7 +443,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -452,7 +453,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
}
@@ -577,7 +578,7 @@ public class ItemAuctionInstance
return null;
}
- if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
+ if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
{
LOGGER.info(getClass().getSimpleName() + ": Clearing expired auction: " + auctionId);
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
index 7418c5a6e6..334bab47ea 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData;
@@ -198,7 +199,7 @@ public class ItemInstance extends WorldObject
_type2 = 0;
_dropTime = 0;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -221,7 +222,7 @@ public class ItemInstance extends WorldObject
super.setName(_item.getName());
_loc = ItemLocation.VOID;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -1521,7 +1522,7 @@ public class ItemInstance extends WorldObject
setSpawned(true);
setXYZ(x, y, z);
- setDropTime(System.currentTimeMillis());
+ setDropTime(Chronos.currentTimeMillis());
setDropperObjectId(dropper != null ? dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
// Add the ItemInstance dropped in the world as a visible object
@@ -1800,7 +1801,7 @@ public class ItemInstance extends WorldObject
public long getRemainingTime()
{
- return _time - System.currentTimeMillis();
+ return _time - Chronos.currentTimeMillis();
}
public void endOfLife()
@@ -2455,7 +2456,7 @@ public class ItemInstance extends WorldObject
if (getVisualLifeTime() > 0)
{
final long endTime = getVisualLifeTime();
- if ((endTime - System.currentTimeMillis()) > 0)
+ if ((endTime - Chronos.currentTimeMillis()) > 0)
{
ItemAppearanceTaskManager.getInstance().add(this, endTime);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index e6e471cce5..09adeca7a9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -21,6 +21,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
@@ -84,7 +85,7 @@ public abstract class AbstractOlympiadGame
protected boolean makeCompetitionStart()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
return !_aborted;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 10af0d183d..a0334635fe 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
@@ -765,7 +766,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", template.getName() + " was defeated");
@@ -786,7 +787,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", castle.getName() + " Castle was successfuly taken");
@@ -800,7 +801,7 @@ public class Hero
PreparedStatement ps = con.prepareStatement("INSERT INTO heroes_diary (charId, time, action, param) values(?,?,?,?)"))
{
ps.setInt(1, charId);
- ps.setLong(2, System.currentTimeMillis());
+ ps.setLong(2, Chronos.currentTimeMillis());
ps.setInt(3, action);
ps.setInt(4, param);
ps.execute();
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index 2a54d83dc7..0427829eb2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,6 +27,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
@@ -546,7 +547,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
String winner = "draw";
// Calculate Fight time
- final long _fightTime = (System.currentTimeMillis() - _startTime);
+ final long _fightTime = (Chronos.currentTimeMillis() - _startTime);
double playerOneHp = 0;
if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index 119e447b15..4bb2fc156e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.handler.PunishmentHandler;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
@@ -133,7 +134,7 @@ public class PunishmentTask implements Runnable
*/
public boolean isExpired()
{
- return (_expirationTime > 0) && (System.currentTimeMillis() > _expirationTime);
+ return (_expirationTime > 0) && (Chronos.currentTimeMillis() > _expirationTime);
}
/**
@@ -149,7 +150,7 @@ public class PunishmentTask implements Runnable
onStart();
if (_expirationTime > 0) // Has expiration?
{
- _task = ThreadPool.schedule(this, (_expirationTime - System.currentTimeMillis()));
+ _task = ThreadPool.schedule(this, (_expirationTime - Chronos.currentTimeMillis()));
}
}
@@ -226,7 +227,7 @@ public class PunishmentTask implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement st = con.prepareStatement(UPDATE_QUERY))
{
- st.setLong(1, System.currentTimeMillis());
+ st.setLong(1, Chronos.currentTimeMillis());
st.setLong(2, _id);
st.execute();
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 7c2d57fdc6..2e36bece7c 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -32,6 +32,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.EventDroplist;
import org.l2jmobius.gameserver.data.ItemTable;
@@ -100,7 +101,7 @@ public class LongTimeEvent extends Quest
}
else if (_eventPeriod.getStartDate().after(new Date()))
{
- final long delay = _eventPeriod.getStartDate().getTime() - System.currentTimeMillis();
+ final long delay = _eventPeriod.getStartDate().getTime() - Chronos.currentTimeMillis();
ThreadPool.schedule(new ScheduleStart(), delay);
LOGGER.info("Event " + _eventName + " will be started at " + _eventPeriod.getStartDate());
}
@@ -323,7 +324,7 @@ public class LongTimeEvent extends Quest
}
// Add spawns.
- final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - System.currentTimeMillis();
+ final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - Chronos.currentTimeMillis();
for (NpcSpawn spawn : _spawnList)
{
addSpawn(spawn.npcId, spawn.loc.getX(), spawn.loc.getY(), spawn.loc.getZ(), spawn.loc.getHeading(), false, millisToEventEnd, false);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 1218569d81..4264d72834 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.enums.QuestType;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
@@ -785,7 +786,7 @@ public class QuestState
public boolean isNowAvailable()
{
final String val = get("restartTime");
- return (val != null) && (Long.parseLong(val) <= System.currentTimeMillis());
+ return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
public void setSimulated(boolean simulated)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
index cf665da8f8..b4d0d36648 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.SocialClass;
@@ -138,7 +139,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
final int level = rs.getInt("level");
final long expiration = rs.getLong("expiration");
final ResidenceFunction func = new ResidenceFunction(id, level, expiration, this);
- if ((expiration <= System.currentTimeMillis()) && !func.reactivate())
+ if ((expiration <= Chronos.currentTimeMillis()) && !func.reactivate())
{
removeFunction(func);
continue;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
index a292c439e5..d81d7f08af 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanHallGrade;
import org.l2jmobius.gameserver.enums.ClanHallType;
@@ -265,7 +266,7 @@ public class ClanHall extends AbstractResidence
final int failDays = getCostFailDay();
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : _paidUntil;
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - Chronos.currentTimeMillis());
}
else
{
@@ -310,7 +311,7 @@ public class ClanHall extends AbstractResidence
*/
public long getNextPayment()
{
- return (_checkPaymentTask != null) ? System.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
+ return (_checkPaymentTask != null) ? Chronos.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
}
public Location getOwnerLocation()
@@ -382,7 +383,7 @@ public class ClanHall extends AbstractResidence
{
_owner.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, _lease, null, null);
setPaidUntil(Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(7)).toEpochMilli());
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - Chronos.currentTimeMillis());
updateDB();
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
index 2fa683814d..faac3921be 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
@@ -30,6 +30,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
@@ -85,7 +86,7 @@ public class ClanHallAuction
public void addBid(Clan clan, long bid)
{
- addBid(clan, bid, System.currentTimeMillis());
+ addBid(clan, bid, Chronos.currentTimeMillis());
}
public void addBid(Clan clan, long bid, long bidTime)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index c71380874f..841d3b180c 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -20,6 +20,7 @@ import java.time.Instant;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ResidenceFunctionsData;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -63,9 +64,9 @@ public class ResidenceFunction
private void init()
{
final ResidenceFunctionTemplate template = getTemplate();
- if ((template != null) && (_expiration > System.currentTimeMillis()))
+ if ((template != null) && (_expiration > Chronos.currentTimeMillis()))
{
- _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
+ _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - Chronos.currentTimeMillis());
}
}
@@ -170,7 +171,7 @@ public class ResidenceFunction
if (wh.destroyItem("FunctionFee", item, template.getCost().getCount(), null, this) != null)
{
- _expiration = System.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
+ _expiration = Chronos.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
init();
}
return true;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
index 3a425c9b03..af7fd2e85e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.shuttle;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Location;
/**
@@ -29,7 +30,7 @@ public class ShuttleStop
private final int _id;
private boolean _isOpen = true;
private final List _dimensions = new ArrayList<>(3);
- private long _lastDoorStatusChanges = System.currentTimeMillis();
+ private long _lastDoorStatusChanges = Chronos.currentTimeMillis();
public ShuttleStop(int id)
{
@@ -64,7 +65,7 @@ public class ShuttleStop
}
_isOpen = true;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public void closeDoor()
@@ -75,11 +76,11 @@ public class ShuttleStop
}
_isOpen = false;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public boolean hasDoorChanged()
{
- return (System.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
+ return (Chronos.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Castle.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Castle.java
index 8aa51ae1d1..a85192d134 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Castle.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Castle.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.CastleData;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -160,7 +161,7 @@ public class Castle extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -195,7 +196,7 @@ public class Castle extends AbstractResidence
fee = _tempFee;
}
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Fort.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Fort.java
index 95839a8065..de66de79ed 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Fort.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Fort.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.FortUpdater;
import org.l2jmobius.gameserver.FortUpdater.UpdaterType;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -163,7 +164,7 @@ public class Fort extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -193,7 +194,7 @@ public class Fort extends AbstractResidence
if ((_fortOwner.getWarehouse().getAdena() >= _fee) || !_cwh)
{
final int fee = _endDate == -1 ? _tempFee : _fee;
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
@@ -580,7 +581,7 @@ public class Fort extends AbstractResidence
clan.setFortId(getResidenceId());
setOwnerClan(clan);
final int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
- long initial = System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
+ long initial = Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
while (initial > (Config.FS_UPDATE_FRQ * 60000))
{
initial -= Config.FS_UPDATE_FRQ * 60000;
@@ -786,7 +787,7 @@ public class Fort extends AbstractResidence
if (clan != null)
{
clanId = clan.getId();
- _lastOwnedTime.setTimeInMillis(System.currentTimeMillis());
+ _lastOwnedTime.setTimeInMillis(Chronos.currentTimeMillis());
}
else
{
@@ -920,12 +921,12 @@ public class Fort extends AbstractResidence
public int getOwnedTime()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
}
public int getTimeTillRebelArmy()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - System.currentTimeMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - Chronos.currentTimeMillis()) / 1000);
}
public long getTimeTillNextFortUpdate()
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Siege.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Siege.java
index 25e8b587a3..31f673fbb7 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Siege.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/siege/Siege.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SiegeScheduleData;
import org.l2jmobius.gameserver.enums.SiegeClanType;
@@ -1434,9 +1435,9 @@ public class Siege implements Siegable
}
final Calendar calendar = _castle.getSiegeDate();
- if (calendar.getTimeInMillis() < System.currentTimeMillis())
+ if (calendar.getTimeInMillis() < Chronos.currentTimeMillis())
{
- calendar.setTimeInMillis(System.currentTimeMillis());
+ calendar.setTimeInMillis(Chronos.currentTimeMillis());
}
calendar.set(Calendar.DAY_OF_WEEK, holder.getDay());
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
index c7b80987c7..77396cff6d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
@@ -32,10 +32,10 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
+import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
import org.l2jmobius.gameserver.model.stats.Stat;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
index c3ac06e1fc..18161a6c75 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
@@ -30,8 +30,8 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
index 5428c6f7dd..497f4e7247 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.zone.type;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -99,7 +100,7 @@ public class NoRestartZone extends ZoneType
return;
}
- if (((System.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
+ if (((Chronos.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
{
player.teleToLocation(TeleportWhereType.TOWN);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/GameClient.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/GameClient.java
index badd7b05a1..99c66513d8 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/GameClient.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/GameClient.java
@@ -30,6 +30,7 @@ import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.ICrypt;
import org.l2jmobius.commons.network.IIncomingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -341,7 +342,7 @@ public class GameClient extends ChannelInboundHandler
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps2 = con.prepareStatement("UPDATE characters SET deletetime=? WHERE charId=?"))
{
- ps2.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ ps2.setLong(1, Chronos.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
ps2.setInt(2, objectId);
ps2.execute();
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
index bf151234da..cf2986ced6 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -81,7 +82,7 @@ public class AllyDismiss implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000), Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
leaderClan.updateClanInDB();
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
index 3d5c508a4c..7cc2fa0c1f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class AllyLeave implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
clan.setAllyId(0);
clan.setAllyName(null);
clan.changeAllyCrest(0, true);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index e5f9aa60a5..4588af50ea 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
@@ -539,7 +540,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_RECENTLY_BEEN_DISMISSED_FROM_A_CLAN_YOU_ARE_NOT_ALLOWED_TO_JOIN_ANOTHER_CLAN_FOR_24_HOURS);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
index c63a8bfcf4..854d89da8d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.AdminTeleportType;
@@ -74,7 +75,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
player.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
index 0116b13a14..520c45b7ce 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
@@ -20,6 +20,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.enums.ItemSkillType;
@@ -126,7 +127,7 @@ public class RequestEnchantItem implements IClientIncomingPacket
}
// fast auto-enchant cheat check
- if ((request.getTimestamp() == 0) || ((System.currentTimeMillis() - request.getTimestamp()) < 2000))
+ if ((request.getTimestamp() == 0) || ((Chronos.currentTimeMillis() - request.getTimestamp()) < 2000))
{
Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " use autoenchant program ", Config.DEFAULT_PUNISH);
player.removeRequest(request.getClass());
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
index b8a07b77e8..bad73f8c28 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -82,7 +83,7 @@ public class RequestExAddEnchantScrollItem implements IClientIncomingPacket
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantScrollItemResult(_scrollObjectId));
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
index db4db5e742..b004d448e0 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -55,7 +56,7 @@ public class RequestExRemoveEnchantSupportItem implements IClientIncomingPacket
request.setSupportItem(PlayerInstance.ID_NONE);
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(ExRemoveEnchantSupportItemResult.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
index 7081788fa8..b7c0e01d93 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -69,7 +70,7 @@ public class RequestExSetPledgeCrestLarge implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
index c9e0cf1be8..7a2a1c706a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -85,7 +86,7 @@ public class RequestExTryToPutEnchantSupportItem implements IClientIncomingPacke
}
request.setSupportItem(support.getObjectId());
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantSupportItemResult(_supportObjectId));
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
index cdf3996711..4b04a3965e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -76,7 +77,7 @@ public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
}
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
client.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
index 715be58f93..cd86a6542c 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -69,7 +70,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
{
if (_isJoining == 1)
{
- if (System.currentTimeMillis() < clan.getDissolvingExpiryTime())
+ if (Chronos.currentTimeMillis() < clan.getDissolvingExpiryTime())
{
client.sendPacket(SystemMessageId.YOUR_CLAN_MAY_NOT_REGISTER_TO_PARTICIPATE_IN_A_SIEGE_WHILE_UNDER_A_GRACE_PERIOD_OF_THE_CLAN_S_DISSOLUTION);
return;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
index 1e78964e1b..e31721fdce 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.BoatManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.instance.BoatInstance;
@@ -61,7 +62,7 @@ public class RequestMoveToLocationInVehicle implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
client.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
index 5563872c57..0fd55d3ffe 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
@@ -80,8 +81,8 @@ public class RequestOustPledgeMember implements IClientIncomingPacket
}
// this also updates the database
- clan.removeClanMember(member.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
- clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(member.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setCharPenaltyExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
final SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_HAS_BEEN_EXPELLED);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
index 0bf1ebf5ec..a61cc79835 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
@@ -22,6 +22,7 @@ import java.sql.SQLException;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -68,7 +69,7 @@ public class RequestPetitionFeedback implements IClientIncomingPacket
statement.setString(2, player.getLastPetitionGmName());
statement.setInt(3, _rate);
statement.setString(4, _message);
- statement.setLong(5, System.currentTimeMillis());
+ statement.setLong(5, Chronos.currentTimeMillis());
statement.execute();
}
catch (SQLException e)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
index 12ab962a2b..b63d0490df 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.ClanEntryManager;
import org.l2jmobius.gameserver.instancemanager.FortManager;
@@ -62,12 +63,12 @@ public class RequestPledgeSignInForOpenJoiningMethod implements IClientIncomingP
final Clan clan = pledgeRecruitInfo.getClan();
if ((clan != null) && (player.getClan() == null))
{
- if (clan.getCharPenaltyExpiryTime() > System.currentTimeMillis())
+ if (clan.getCharPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return;
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 30e0b1b097..9c606fc9fe 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -34,8 +34,8 @@ import org.l2jmobius.gameserver.model.quest.Event;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.network.GameClient;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
index ed6c0db580..2d92eb4df9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -74,7 +75,7 @@ public class RequestSetPledgeCrest implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
index 16f6b732ba..f1d9597133 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.enums.UserInfoType;
@@ -101,7 +102,7 @@ public class RequestStartPledgeWar implements IClientIncomingPacket
client.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
- else if (clanDeclaredWar.getDissolvingExpiryTime() > System.currentTimeMillis())
+ else if (clanDeclaredWar.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(new SystemMessage(SystemMessageId.A_CLAN_WAR_CAN_NOT_BE_DECLARED_AGAINST_A_CLAN_THAT_IS_BEING_DISSOLVED));
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
index 8d0f9b92cc..48988b5249 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class RequestWithdrawalPledge implements IClientIncomingPacket
}
final Clan clan = player.getClan();
- clan.removeClanMember(player.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(player.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
index e1f30a1018..c379f83677 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlEvent;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.NextAction;
@@ -258,7 +259,7 @@ public class UseItem implements IClientIncomingPacket
else if (player.isAttackingNow())
{
// Equip or unEquip.
- ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
+ ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
index aef68ac971..96ce901338 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.appearance;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.enums.InventorySlot;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -252,7 +253,7 @@ public class RequestShapeShiftingItem implements IClientIncomingPacket
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getLifeTime() > 0))
{
- targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, System.currentTimeMillis() + appearanceStone.getLifeTime());
+ targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, Chronos.currentTimeMillis() + appearanceStone.getLifeTime());
targetItem.scheduleVisualLifeTime();
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
index 2aa7eeeeac..d6bbe9b766 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,9 +119,9 @@ public class ConfirmMenteeAdd implements IClientIncomingPacket
mentor.sendPacket(SystemMessageId.YOU_MUST_AWAKEN_IN_ORDER_TO_BECOME_A_MENTOR);
return false;
}
- else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > System.currentTimeMillis())
+ else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > Chronos.currentTimeMillis())
{
- long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - System.currentTimeMillis()) / 1000;
+ long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - Chronos.currentTimeMillis()) / 1000;
final int days = (int) (remainingTime / 86400);
remainingTime = remainingTime % 86400;
final int hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
index e06cd9048d..1e8aba6d16 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
@@ -119,7 +120,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
index f6702caa41..9c076a29a5 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.enums.MailType;
@@ -140,7 +141,7 @@ public class RequestBRPresentBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
index c3faad961a..138ed60513 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.training;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.TrainingHolder;
import org.l2jmobius.gameserver.network.GameClient;
@@ -52,7 +53,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
if (holder.isTraining())
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
@@ -60,7 +61,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
player.setImmobilized(false);
player.teleToLocation(player.getLastLocation());
player.sendPacket(ExTrainingZone_Leaving.STATIC_PACKET);
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
index ee1c787150..3f1213f2ee 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.loginserverpackets.game;
import org.l2jmobius.commons.network.BaseSendablePacket;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author mrTJO
@@ -28,7 +29,7 @@ public class TempBan extends BaseSendablePacket
writeC(0x0A);
writeS(accountName);
writeS(ip);
- writeQ(System.currentTimeMillis() + (time * 60000));
+ writeQ(Chronos.currentTimeMillis() + (time * 60000));
// if (reason != null)
// {
// writeC(0x01);
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
index 52191c1fed..41d702f6be 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.CharSelectInfoPackage;
@@ -188,7 +189,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP
packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP
- packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
+ packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0);
packet.writeD(charInfoPackage.getClassId());
packet.writeD(i == _activeId ? 1 : 0);
@@ -283,7 +284,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
// See if the char must be deleted
final long deletetime = chardata.getLong("deletetime");
- if ((deletetime > 0) && (System.currentTimeMillis() > deletetime))
+ if ((deletetime > 0) && (Chronos.currentTimeMillis() > deletetime))
{
final Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
if (clan != null)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
index 57dd77c3f1..6cbf9639e3 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
@@ -53,7 +54,7 @@ public class ExInzoneWaiting implements IClientOutgoingPacket
packet.writeD(_instanceTimes.size());
for (Entry entry : _instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
index a40690e845..6f7b5f8735 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MatchingRoomManager;
@@ -73,7 +74,7 @@ public class ExListPartyMatchingWaitingRoom implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
index d455d825fd..5921d44781 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MatchingMemberType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -61,7 +62,7 @@ public class ExPartyRoomMember implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
index 3656ddbc4e..ab85228caf 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MailType;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
@@ -45,7 +46,7 @@ public class ExShowReceivedPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_RECEIVED_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_inbox != null) && !_inbox.isEmpty())
{
packet.writeD(_inbox.size());
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
index 2ae09181a7..db4bccc928 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -40,7 +41,7 @@ public class ExShowSentPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_SENT_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_outbox != null) && !_outbox.isEmpty())
{
packet.writeD(_outbox.size());
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
index db2091ad54..4403da53fe 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.items.Henna;
import org.l2jmobius.gameserver.model.stats.BaseStat;
@@ -73,7 +74,7 @@ public class HennaInfo implements IClientOutgoingPacket
int duration = premium.getDuration();
if (duration > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
duration = (int) Math.max(0, _player.getVariables().getLong("HennaDuration4", currentTime) - currentTime) / 1000;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
index 5ed678042b..caed96260b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -88,7 +89,7 @@ public class SiegeInfo implements IClientOutgoingPacket
packet.writeS(""); // Ally Name
}
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if (!_castle.isTimeRegistrationOver() && _player.isClanLeader() && (_player.getClanId() == _castle.getOwnerId()))
{
final Calendar cal = Calendar.getInstance();
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
index 5871334785..c6de3ccd8b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.TimeStamp;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -36,7 +37,7 @@ public class SkillCoolTime implements IClientOutgoingPacket
public SkillCoolTime(PlayerInstance player)
{
- _currentTime = System.currentTimeMillis();
+ _currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : player.getSkillReuseTimeStamps().values())
{
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel()).isNotBroadcastable())
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/dailymission/ExOneDayReceiveRewardList.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/dailymission/ExOneDayReceiveRewardList.java
index c99b6e0617..2ee70b560d 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/dailymission/ExOneDayReceiveRewardList.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/dailymission/ExOneDayReceiveRewardList.java
@@ -22,6 +22,7 @@ import java.util.Collections;
import java.util.function.Function;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -37,7 +38,7 @@ public class ExOneDayReceiveRewardList implements IClientOutgoingPacket
{
final PlayerInstance _player;
private final Collection _rewards;
- private static final Function _remainTime = pattern -> (new Predictor(pattern).nextMatchingTime() - System.currentTimeMillis()) / 1000;
+ private static final Function _remainTime = pattern -> (new Predictor(pattern).nextMatchingTime() - Chronos.currentTimeMillis()) / 1000;
private final long _dayRemainTime;
private final long _weekRemainTime;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
index 74955d8a26..2ffa34919b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets.friend;
import java.util.Calendar;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -39,7 +40,7 @@ public class ExFriendDetailInfo implements IClientOutgoingPacket
_objectId = player.getObjectId();
_name = name;
_friend = World.getInstance().getPlayer(_name);
- _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) System.currentTimeMillis() : (int) (System.currentTimeMillis() - _friend.getLastAccess()) / 1000;
+ _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) Chronos.currentTimeMillis() : (int) (Chronos.currentTimeMillis() - _friend.getLastAccess()) / 1000;
}
@Override
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/scripting/ManagedScript.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
index 00235baa25..9d206480d8 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
@@ -20,6 +20,8 @@ import java.nio.file.Path;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* Abstract class for classes that are meant to be implemented by scripts.
* @author KenM
@@ -35,7 +37,7 @@ public abstract class ManagedScript
public ManagedScript()
{
_scriptFile = getScriptPath();
- setLastLoadTime(System.currentTimeMillis());
+ setLastLoadTime(Chronos.currentTimeMillis());
}
public abstract Path getScriptPath();
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9c8c4bb5dd..b5a2e04233 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -54,7 +55,7 @@ public class AttackStanceTaskManager
}
_working = true;
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
try
{
final Iterator> iterator = _attackStanceTasks.entrySet().iterator();
@@ -105,7 +106,7 @@ public class AttackStanceTaskManager
return;
}
- _attackStanceTasks.put(creature, System.currentTimeMillis());
+ _attackStanceTasks.put(creature, Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
index 8ab6c99d28..d56e0b8a23 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.buylist.Product;
/**
@@ -45,7 +46,7 @@ public class BuyListTaskManager
}
_workingProducts = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : PRODUCTS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 8b4a7db319..f8218055f3 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@@ -44,7 +45,7 @@ public class DecayTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -87,7 +88,7 @@ public class DecayTaskManager
}
// Add to decay schedules.
- DECAY_SCHEDULES.put(creature, System.currentTimeMillis() + (delay * 1000));
+ DECAY_SCHEDULES.put(creature, Chronos.currentTimeMillis() + (delay * 1000));
}
/**
@@ -107,7 +108,7 @@ public class DecayTaskManager
public long getRemainingTime(Creature creature)
{
final Long time = DECAY_SCHEDULES.get(creature);
- return time != null ? time.longValue() - System.currentTimeMillis() : Long.MAX_VALUE;
+ return time != null ? time.longValue() - Chronos.currentTimeMillis() : Long.MAX_VALUE;
}
@Override
@@ -122,7 +123,7 @@ public class DecayTaskManager
ret.append("Tasks dump:");
ret.append(Config.EOL);
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
ret.append("Class/Name: ");
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
index c3834ecbb9..e0f823bef4 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemAppearanceTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
index 27f0273802..de10959db8 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemLifeTimeTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 396633692c..160debb492 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -42,7 +43,7 @@ public class ItemManaTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
@@ -61,7 +62,7 @@ public class ItemManaTaskManager
{
if (!ITEMS.containsKey(item))
{
- ITEMS.put(item, System.currentTimeMillis() + MANA_CONSUMPTION_RATE);
+ ITEMS.put(item, Chronos.currentTimeMillis() + MANA_CONSUMPTION_RATE);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
index eb0dd7a59f..a2f0dc5563 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.model.World;
@@ -48,7 +49,7 @@ public class MessageDeletionTaskManager
Integer msgId;
Message msg;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_MESSAGES.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
index 2f270649fb..82483a498a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PlayerAutoSaveTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SEARCH: for (Entry entry : PLAYER_TIMES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -63,7 +64,7 @@ public class PlayerAutoSaveTaskManager
public void add(PlayerInstance player)
{
- PLAYER_TIMES.put(player, System.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
+ PLAYER_TIMES.put(player, Chronos.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
}
public void remove(PlayerInstance player)
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
index 6a406a9591..3a812e2fcb 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PvpFlagTaskManager
if (!PLAYERS.isEmpty())
{
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (PlayerInstance player : PLAYERS)
{
if (time > player.getPvpFlagLasts())
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
index 5473f21a8f..b8135996f8 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -43,7 +44,7 @@ public class RandomAnimationTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_ANIMATIONS.entrySet())
{
if (time > entry.getValue().longValue())
@@ -65,7 +66,7 @@ public class RandomAnimationTaskManager
{
if (npc.hasRandomAnimation())
{
- PENDING_ANIMATIONS.putIfAbsent(npc, System.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
+ PENDING_ANIMATIONS.putIfAbsent(npc, Chronos.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
index 8e8e818908..debb0d68e6 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Spawn;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -42,7 +43,7 @@ public class RespawnTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_RESPAWNS.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
index 990efb8b45..d1946b860a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -36,6 +36,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskBirthday;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskRecom;
@@ -94,7 +95,7 @@ public class TaskManager
public void run()
{
task.onTimeElapsed(this);
- lastActivation = System.currentTimeMillis();
+ lastActivation = Chronos.currentTimeMillis();
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement statement = con.prepareStatement(SQL_STATEMENTS[1]))
{
@@ -242,7 +243,7 @@ public class TaskManager
try
{
final Date desired = DateFormat.getInstance().parse(task.getParams()[0]);
- final long diff = desired.getTime() - System.currentTimeMillis();
+ final long diff = desired.getTime() - Chronos.currentTimeMillis();
if (diff >= 0)
{
task.scheduled = ThreadPool.schedule(task, diff);
@@ -293,7 +294,7 @@ public class TaskManager
return false;
}
- delay = min.getTimeInMillis() - System.currentTimeMillis();
+ delay = min.getTimeInMillis() - Chronos.currentTimeMillis();
if (check.after(min) || (delay < 0))
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ui/SystemPanel.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ui/SystemPanel.java
index 8c01c1f8fe..a19a873bfe 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ui/SystemPanel.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ui/SystemPanel.java
@@ -31,6 +31,7 @@ import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.util.Locator;
@@ -42,7 +43,7 @@ public class SystemPanel extends JPanel
{
protected static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
- protected static final long START_TIME = System.currentTimeMillis();
+ protected static final long START_TIME = Chronos.currentTimeMillis();
public SystemPanel()
{
@@ -136,7 +137,7 @@ public class SystemPanel extends JPanel
lblConnected.setText("Connected: " + playerCount);
lblMaxConnected.setText("Max connected: " + World.MAX_CONNECTED_COUNT);
lblOfflineShops.setText("Offline trade: " + World.OFFLINE_TRADE_COUNT);
- lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - START_TIME));
+ lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(Chronos.currentTimeMillis() - START_TIME));
}
}, 1000, 1000);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
index ec95816f82..cc8059f91a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.PlayerCondOverride;
@@ -151,7 +152,7 @@ public class FloodProtectorAction
*/
private void banAccount()
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
if (LOGGER.isLoggable(Level.WARNING))
{
log(" banned for flooding ", _config.PUNISHMENT_TIME <= 0 ? "forever" : "for " + (_config.PUNISHMENT_TIME / 60000) + " mins");
@@ -171,7 +172,7 @@ public class FloodProtectorAction
final int charId = _client.getPlayer().getObjectId();
if (charId > 0)
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
}
if (LOGGER.isLoggable(Level.WARNING))
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
index e5912dd51b..d6580161c7 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World;
@@ -143,7 +144,7 @@ public class OfflineTradeUtil
if (player.getOfflineStartTime() == 0)
{
- player.setOfflineStartTime(System.currentTimeMillis());
+ player.setOfflineStartTime(Chronos.currentTimeMillis());
}
// Store trade on exit, if realtime saving is enabled.
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/FloodProtectedListener.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/FloodProtectedListener.java
index ba2fc6536a..e2bbcc1aa3 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/FloodProtectedListener.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/FloodProtectedListener.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author -Wooden-
@@ -63,9 +64,9 @@ public abstract class FloodProtectedListener extends Thread
if (fConnection != null)
{
fConnection.connectionNumber += 1;
- if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((System.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((System.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
+ if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
{
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
connection.close();
fConnection.connectionNumber -= 1;
if (!fConnection.isFlooding)
@@ -80,11 +81,11 @@ public abstract class FloodProtectedListener extends Thread
fConnection.isFlooding = false;
LOGGER.info(connection.getInetAddress().getHostAddress() + " is not considered as flooding anymore.");
}
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
}
else
{
- fConnection = new ForeignConnection(System.currentTimeMillis());
+ fConnection = new ForeignConnection(Chronos.currentTimeMillis());
_floodProtection.put(connection.getInetAddress().getHostAddress(), fConnection);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/LoginController.java
index 189b90e2ee..9d382c646b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/LoginController.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/LoginController.java
@@ -41,6 +41,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.GameServerTable.GameServerInfo;
@@ -176,7 +177,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(USER_INFO_SELECT))
{
- ps.setString(1, Long.toString(System.currentTimeMillis()));
+ ps.setString(1, Long.toString(Chronos.currentTimeMillis()));
ps.setString(2, login);
try (ResultSet rset = ps.executeQuery())
{
@@ -208,7 +209,7 @@ public class LoginController
{
ps.setString(1, login);
ps.setString(2, hashBase64);
- ps.setLong(3, System.currentTimeMillis());
+ ps.setLong(3, Chronos.currentTimeMillis());
ps.setInt(4, 0);
ps.setString(5, addr.getHostAddress());
ps.execute();
@@ -273,7 +274,7 @@ public class LoginController
*/
public void addBanForAddress(InetAddress address, long duration)
{
- _bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
+ _bannedIps.putIfAbsent(address, Chronos.currentTimeMillis() + duration);
}
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
@@ -294,7 +295,7 @@ public class LoginController
}
if (bi != null)
{
- if ((bi > 0) && (bi < System.currentTimeMillis()))
+ if ((bi > 0) && (bi < Chronos.currentTimeMillis()))
{
_bannedIps.remove(address);
LOGGER.info("Removed expired ip address ban " + address.getHostAddress() + ".");
@@ -541,7 +542,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(ACCOUNT_INFO_UPDATE))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.setString(2, address.getHostAddress());
ps.setString(3, info.getLogin());
ps.execute();
@@ -613,7 +614,7 @@ public class LoginController
{
continue;
}
- if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < System.currentTimeMillis())
+ if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < Chronos.currentTimeMillis())
{
client.close(LoginFailReason.REASON_ACCESS_FAILED);
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/network/LoginClient.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/network/LoginClient.java
index 04455664e2..93194a11c0 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/network/LoginClient.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/network/LoginClient.java
@@ -27,6 +27,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.IIncomingPacket;
import org.l2jmobius.commons.network.IOutgoingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.LoginController;
@@ -82,14 +83,14 @@ public class LoginClient extends ChannelInboundHandler
_addr = address.getAddress();
_channel = ctx.channel();
_sessionId = Rnd.nextInt();
- _connectionStartTime = System.currentTimeMillis();
+ _connectionStartTime = Chronos.currentTimeMillis();
sendPacket(new Init(_scrambledPair.getScrambledModulus(), _blowfishKey.getEncoded(), _sessionId));
}
@Override
public void channelInactive(ChannelHandlerContext ctx)
{
- if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < System.currentTimeMillis()))
+ if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < Chronos.currentTimeMillis()))
{
LoginController.getInstance().removeAuthedLoginClient(getAccount());
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
index 801bc957ae..875759b72a 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
@@ -24,6 +24,8 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* IPv4 filter.
* @author Forsaiken
@@ -59,7 +61,7 @@ public class IPv4Filter implements Runnable
Flood()
{
- lastAccess = System.currentTimeMillis();
+ lastAccess = Chronos.currentTimeMillis();
trys = 0;
}
}
@@ -74,7 +76,7 @@ public class IPv4Filter implements Runnable
}
final int h = hash(addr.getAddress());
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
Flood f;
synchronized (_ipFloodMap)
{
@@ -120,7 +122,7 @@ public class IPv4Filter implements Runnable
{
while (true)
{
- final long reference = System.currentTimeMillis() - (1000 * 300);
+ final long reference = Chronos.currentTimeMillis() - (1000 * 300);
synchronized (_ipFloodMap)
{
final Iterator> it = _ipFloodMap.entrySet().iterator();
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
index e66362d6c0..86b46f1919 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.model.Location;
@@ -137,7 +138,7 @@ public class Parade extends AbstractNpcAI
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
- LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
+ LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
}
void load()
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
index c91b42bb26..7757d82c61 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -304,7 +305,7 @@ public class TalentShow extends AbstractNpcAI
hourDiff *= 3600000;
minDiff *= 60000;
diff = hourDiff + minDiff;
- LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
+ LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
startQuestTimer("Start", diff, null, null); // first start
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
index 940193f4fc..32c8b9f9f1 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
@@ -16,6 +16,7 @@
*/
package ai.areas.GainakUnderground.Lailly;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -64,7 +65,7 @@ public class Lailly extends AbstractNpcAI
case "okay":
{
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
- if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis()))
+ if ((instance != null) && (instance.getEndTime() > Chronos.currentTimeMillis()))
{
switch (instance.getTemplateId())
{
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
index a00d59028e..037b29d579 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
@@ -29,6 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -516,7 +517,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
final GlobalVariablesManager vars = GlobalVariablesManager.getInstance();
final long var = vars.getLong("FourSepulchers" + npcId, 0) + (TIME_ATTACK * 60 * 1000);
- if (var > System.currentTimeMillis())
+ if (var > Chronos.currentTimeMillis())
{
showHtmlFile(player, npcId + "-NE.html", npc, null);
return;
@@ -581,7 +582,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
ThreadPool.schedule(() -> ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers(), TIME_ATTACK * 60 * 1000);
// Save attack time
- vars.set("FourSepulchers" + npcId, System.currentTimeMillis());
+ vars.set("FourSepulchers" + npcId, Chronos.currentTimeMillis());
// Init progress
STORED_PROGRESS.put(sepulcherId, 1); // start from 1
// Start
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
index 244867b7c6..ded5cf9a43 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
@@ -19,6 +19,7 @@ package ai.areas.KeucereusAllianceBase;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
@@ -109,7 +110,7 @@ public class LindviorScene extends AbstractNpcAI
final GregorianCalendar date = new GregorianCalendar();
date.set(Calendar.MINUTE, RESET_MIN);
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
- if (System.currentTimeMillis() >= date.getTimeInMillis())
+ if (Chronos.currentTimeMillis() >= date.getTimeInMillis())
{
date.add(Calendar.DAY_OF_WEEK, 1);
}
@@ -135,7 +136,7 @@ public class LindviorScene extends AbstractNpcAI
{
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
}
- return date.getTimeInMillis() - System.currentTimeMillis();
+ return date.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
index 80dffe38b2..de8ea0aea9 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
@@ -19,6 +19,7 @@ package ai.areas.Rune.RuneCastle.Venom;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -111,7 +112,7 @@ public class Venom extends AbstractNpcAI
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
index a7d7250e8b..c42186c0d0 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -229,7 +230,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
int buffsNow = 0;
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
- if (var < System.currentTimeMillis())
+ if (var < Chronos.currentTimeMillis())
{
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
@@ -254,7 +255,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
reenter.set(Calendar.MINUTE, 0);
reenter.set(Calendar.HOUR_OF_DAY, 13);
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
- if (reenter.getTimeInMillis() <= System.currentTimeMillis())
+ if (reenter.getTimeInMillis() <= Chronos.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 7);
}
@@ -272,7 +273,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
}
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
private void spawnGroupOfMinion(MonsterInstance npc, int[] mobIds)
@@ -317,7 +318,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
zone.clearSkills();
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
else if (event.equalsIgnoreCase("transform"))
{
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
index e004e80b3d..8044c58bf3 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -345,7 +346,7 @@ public class Anakim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ANAKIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_anakim", time, null, null);
@@ -373,7 +374,7 @@ public class Anakim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(ANAKIM, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -550,7 +551,7 @@ public class Anakim extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_anakimStatus == WAITING) && (npc.getId() == ANAKIM_CUBIC))
@@ -578,7 +579,7 @@ public class Anakim extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid())// Anakim and minions
{
// Anti BUGGERS
@@ -614,7 +615,7 @@ public class Anakim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ANAKIM, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(ANAKIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ANAKIM, info);
startQuestTimer("unlock_anakim", respawnTime, null, null);
@@ -686,7 +687,7 @@ public class Anakim extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
index 4a77fb6bfd..fe808aef25 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.MountType;
@@ -169,14 +170,14 @@ public class Antharas extends AbstractNpcAI
_antharas = (GrandBossInstance) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
_antharas.setCurrentHpMp(curr_hp, curr_mp);
addBoss(_antharas);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
break;
}
case DEAD:
{
- final long remain = respawnTime - System.currentTimeMillis();
+ final long remain = respawnTime - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -272,7 +273,7 @@ public class Antharas extends AbstractNpcAI
_antharas.setRandomWalking(false);
_antharas.teleToLocation(181323, 114850, -7623, 32542);
setStatus(IN_FIGHT);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
zone.broadcastPacket(new PlaySound("BS02_A"));
startQuestTimer("CAMERA_1", 23, _antharas, null);
break;
@@ -367,7 +368,7 @@ public class Antharas extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 900000) < Chronos.currentTimeMillis()))
{
setStatus(ALIVE);
for (Creature creature : zone.getCharactersInside())
@@ -619,7 +620,7 @@ public class Antharas extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BOMBER)
{
if (npc.calculateDistance3D(attacker) < 230)
@@ -765,7 +766,7 @@ public class Antharas extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
+ GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
}
private final void refreshAiParams(PlayerInstance attacker, int damage)
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Baium/Baium.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Baium/Baium.java
index faca4576a8..44b37b992a 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Baium/Baium.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Baium/Baium.java
@@ -17,6 +17,7 @@
package ai.bosses.Baium;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.CategoryType;
@@ -136,7 +137,7 @@ public class Baium extends AbstractNpcAI
final int heading = info.getInt("heading");
_baium = (GrandBossInstance) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
_baium.setCurrentHpMp(curr_hp, curr_mp);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
addBoss(_baium);
for (Location loc : ARCHANGEL_LOC)
@@ -149,7 +150,7 @@ public class Baium extends AbstractNpcAI
}
case DEAD:
{
- final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -209,7 +210,7 @@ public class Baium extends AbstractNpcAI
_baium.disableCoreAI(true);
_baium.setRandomWalking(false);
addBoss(_baium);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
@@ -375,7 +376,7 @@ public class Baium extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
{
notifyEvent("CLEAR_ZONE", null, null);
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
@@ -383,7 +384,7 @@ public class Baium extends AbstractNpcAI
}
else if (npc != null)
{
- if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
+ if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
{
npc.setTarget(npc);
npc.doCast(HEAL_OF_BAIUM.getSkill());
@@ -484,7 +485,7 @@ public class Baium extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BAIUM)
{
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
@@ -663,7 +664,7 @@ public class Baium extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
+ GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
}
private void manageSkills(Npc npc)
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
index aa8528926d..dfce75d90b 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -108,7 +109,7 @@ public class Beleth extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("BELETH_UNLOCK", time, null, null);
@@ -349,7 +350,7 @@ public class Beleth extends AbstractNpcAI
c.setImmobilized(false);
}
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, null, null);
startQuestTimer("SPAWN25", 60000, null, null);
break;
@@ -507,7 +508,7 @@ public class Beleth extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((_lastAttack + 900000) < System.currentTimeMillis())
+ if ((_lastAttack + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -708,7 +709,7 @@ public class Beleth extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(REAL_BELETH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
deleteAll();
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Core/Core.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Core/Core.java
index 969bb08788..69dc20dc5d 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Core/Core.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Core/Core.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -89,7 +90,7 @@ public class Core extends AbstractNpcAI
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
@@ -206,7 +207,7 @@ public class Core extends AbstractNpcAI
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
index 3ed92d8f08..b499a47575 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.MountType;
@@ -295,7 +296,7 @@ public class IceQueensCastleBattle extends AbstractInstance
{
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
- controller.getVariables().set("TIMER_END", System.currentTimeMillis() + 360000);
+ controller.getVariables().set("TIMER_END", Chronos.currentTimeMillis() + 360000);
}
break;
}
@@ -688,7 +689,7 @@ public class IceQueensCastleBattle extends AbstractInstance
}
case "SHOW_GLAKIAS_TIMER":
{
- final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - System.currentTimeMillis()) / 1000);
+ final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - Chronos.currentTimeMillis()) / 1000);
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
break;
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
index acbc2c3094..6023594423 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
@@ -23,6 +23,7 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -143,11 +144,11 @@ public class ScarletVanHalisha extends AbstractNpcAI
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
}
@@ -248,7 +249,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
case FRINTEZZA_DAEMON_MORPH:
case FRINTEZZA_DAEMON_FIELD:
{
- _lastRangedSkillTime = System.currentTimeMillis();
+ _lastRangedSkillTime = Chronos.currentTimeMillis();
skillRange = 550;
break;
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Helios/Helios.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Helios/Helios.java
index af4d5b4e8e..7e5c37bf69 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Helios/Helios.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Helios/Helios.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +151,7 @@ public class Helios extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(HELIOS3);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_helios", time, null, null);
@@ -496,7 +497,7 @@ public class Helios extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(HELIOS3, DEAD);
final long respawnTime = (Config.HELIOS_SPAWN_INTERVAL + getRandom(-Config.HELIOS_SPAWN_RANDOM, Config.HELIOS_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(HELIOS3);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(HELIOS3, info);
startQuestTimer("unlock_helios", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
index 81fd9ae6e8..9c32d36ecf 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.Movie;
@@ -121,7 +122,7 @@ public class Kelbim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(KELBIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_kelbim", time, null, null);
@@ -156,7 +157,7 @@ public class Kelbim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(KELBIM, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -193,7 +194,7 @@ public class Kelbim extends AbstractNpcAI
{
_kelbimBoss = (GrandBossInstance) addSpawn(KELBIM, -56340, 60801, -269, 54262, false, 0);
GrandBossManager.getInstance().addBoss(_kelbimBoss);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
startQuestTimer("stage_all_random_area_attack", Rnd.get(2, 3) * 60000, null, null);
break;
@@ -369,7 +370,7 @@ public class Kelbim extends AbstractNpcAI
{
if (npc.getId() == KELBIM)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
switch (_bossStage)
{
@@ -434,7 +435,7 @@ public class Kelbim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(KELBIM, DEAD);
final long respawnTime = (Config.KELBIM_SPAWN_INTERVAL + getRandom(-Config.KELBIM_SPAWN_RANDOM, Config.KELBIM_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(KELBIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(KELBIM, info);
startQuestTimer("unlock_kelbim", respawnTime, null, null);
startQuestTimer("end_kelbim", 1800000, null, null);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
index 62507c9762..510a8060de 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -371,7 +372,7 @@ public class Lilith extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LILITH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lilith", time, null, null);
@@ -399,7 +400,7 @@ public class Lilith extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(LILITH, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -576,7 +577,7 @@ public class Lilith extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_lilithStatus == WAITING) && (npc.getId() == LILITH_CUBIC))
@@ -594,7 +595,7 @@ public class Lilith extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid()) // Lilith and minions
{
// Anti BUGGERS
@@ -630,7 +631,7 @@ public class Lilith extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LILITH, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(LILITH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LILITH, info);
startQuestTimer("unlock_lilith", respawnTime, null, null);
@@ -702,7 +703,7 @@ public class Lilith extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
@Override
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
index 6b02643bc0..63811284a1 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -213,7 +214,7 @@ public class Lindvior extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lindvior", time, null, null);
@@ -863,7 +864,7 @@ public class Lindvior extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
final long respawnTime = (Config.LINDVIOR_SPAWN_INTERVAL + getRandom(-Config.LINDVIOR_SPAWN_RANDOM, Config.LINDVIOR_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
startQuestTimer("unlock_lindvior", respawnTime, null, null);
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
index edd3abc4b8..801d31427b 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -97,7 +98,7 @@ public class Orfen extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for Orfen from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if Orfen is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -328,7 +329,7 @@ public class Orfen extends AbstractNpcAI
startQuestTimer("orfen_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ORFEN, info);
cancelQuestTimer("check_minion_loc", npc, null);
cancelQuestTimer("check_orfen_pos", npc, null);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index f2869a3fe9..c00a82fb97 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -96,7 +97,7 @@ public class QueenAnt extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for queen ant from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if queen ant is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -367,7 +368,7 @@ public class QueenAnt extends AbstractNpcAI
cancelQuestTimer("heal", null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(QUEEN, info);
_nurses.clear();
_larva.deleteMe();
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
index eda49595a1..fd26faf27c 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.QueenShyeed;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -87,7 +88,7 @@ public class QueenShyeed extends AbstractNpcAI
private void spawnShyeed()
{
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
- final long remain = respawn != 0 ? respawn - System.currentTimeMillis() : 0;
+ final long remain = respawn != 0 ? respawn - Chronos.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("respawn", remain, null, null);
@@ -103,7 +104,7 @@ public class QueenShyeed extends AbstractNpcAI
private void startRespawn()
{
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
- GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(System.currentTimeMillis() + respawnTime));
+ GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(Chronos.currentTimeMillis() + respawnTime));
startQuestTimer("respawn", respawnTime, null, null);
// MOB_BUFF_ZONE.setEnabled(false);
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
index e6cd81dbf4..b02a51942f 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -137,7 +138,7 @@ public class Ramona extends AbstractNpcAI
addAttackId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3);
addSpawnId(RAMONA_1, RAMONA_2, RAMONA_3);
- final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - System.currentTimeMillis();
+ final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - Chronos.currentTimeMillis();
if (temp > 0)
{
_boss = Status.DEAD;
@@ -167,7 +168,7 @@ public class Ramona extends AbstractNpcAI
npc.setInvul(false);
cancelQuestTimers("SPAWN_MS");
startQuestTimer("CHECK_ACTIVITY_TASK", 5000, null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
}
break;
}
@@ -186,7 +187,7 @@ public class Ramona extends AbstractNpcAI
startQuestTimer("GENERATOR_2", getRandom(900000, 1200000), null, null);
startQuestTimer("GENERATOR_3", getRandom(1500000, 1800000), null, null);
startQuestTimer("GENERATOR_4", getRandom(2100000, 2400000), null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("RAMONA1_SKILL", 6000, _ramona1, null);
break;
}
@@ -300,7 +301,7 @@ public class Ramona extends AbstractNpcAI
}
case "CHECK_ACTIVITY_TASK":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
for (Creature creature : ZONE.getCharactersInside())
{
@@ -396,17 +397,17 @@ public class Ramona extends AbstractNpcAI
}
case RAMONA_1:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
@@ -540,7 +541,7 @@ public class Ramona extends AbstractNpcAI
{
_boss = Status.DEAD;
final long respawnTime = (Config.RAMONA_SPAWN_INTERVAL + getRandom(-Config.RAMONA_SPAWN_RANDOM, Config.RAMONA_SPAWN_RANDOM)) * 3600000;
- GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, Chronos.currentTimeMillis() + respawnTime);
startQuestTimer("RAMONA_UNLOCK", respawnTime, null, null);
startQuestTimer("END_RAMONA", 90000, null, null);
break;
@@ -568,13 +569,13 @@ public class Ramona extends AbstractNpcAI
case RAMONA_1:
{
_boss = Status.IN_FIGHT;
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
index 4d4eb8653a..be58208558 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.Sailren;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -71,7 +72,7 @@ public class Sailren extends AbstractNpcAI
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
- final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
+ final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - Chronos.currentTimeMillis();
if (remain > 0)
{
STATUS = Status.DEAD;
@@ -118,7 +119,7 @@ public class Sailren extends AbstractNpcAI
{
takeItems(player, GAZKH, 1);
STATUS = Status.IN_FIGHT;
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
for (PlayerInstance member : player.getParty().getMembers())
{
if (member.isInsideRadius3D(npc, 1000))
@@ -237,7 +238,7 @@ public class Sailren extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
+ if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < Chronos.currentTimeMillis()))
{
cancelQuestTimer("TIME_OUT", null, null);
notifyEvent("TIME_OUT", null, null);
@@ -257,7 +258,7 @@ public class Sailren extends AbstractNpcAI
{
if (zone.isCharacterInZone(attacker))
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -274,7 +275,7 @@ public class Sailren extends AbstractNpcAI
STATUS = Status.DEAD;
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
final long respawnTime = RESPAWN * 3600000;
- GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set("SailrenRespawn", Chronos.currentTimeMillis() + respawnTime);
cancelQuestTimer("CHECK_ATTACK", null, null);
cancelQuestTimer("TIME_OUT", null, null);
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
index 0c824fd3b2..523f53e898 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -326,7 +327,7 @@ public class Trasken extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_trasken", time, null, null);
@@ -604,7 +605,7 @@ public class Trasken extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
startQuestTimer("unlock_trasken", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
index 94d29e346e..c8e0f497af 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.MountType;
@@ -129,7 +130,7 @@ public class Valakas extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for valakas from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (temp > 0)
{
// The time has not yet expired. Mark Valakas as currently locked (dead).
@@ -168,7 +169,7 @@ public class Valakas extends AbstractNpcAI
if (status == FIGHTING)
{
// stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
startQuestTimer("regen_task", 60000, valakas, null, true);
startQuestTimer("skill_task", 2000, valakas, null, true);
@@ -196,7 +197,7 @@ public class Valakas extends AbstractNpcAI
if (event.equalsIgnoreCase("beginning"))
{
// Stores current time
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
// Teleport Valakas to his lair.
npc.teleToLocation(VALAKAS_LAIR);
@@ -220,7 +221,7 @@ public class Valakas extends AbstractNpcAI
else if (event.equalsIgnoreCase("regen_task"))
{
// Inactivity task - 15min
- if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
+ if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < Chronos.currentTimeMillis()))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
@@ -416,7 +417,7 @@ public class Valakas extends AbstractNpcAI
npc.setTarget(attacker);
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
}
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -447,7 +448,7 @@ public class Valakas extends AbstractNpcAI
startQuestTimer("valakas_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
return super.onKill(npc, killer, isSummon);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
index ddc6ff9e74..40bd1cf6c2 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
@@ -46,8 +46,8 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcManorBypass;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.teleporter.TeleportHolder;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index 7278c7327f..e1575721d3 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -26,6 +26,7 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -153,7 +154,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -189,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
@@ -247,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
@@ -296,7 +297,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0]");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
sb.append(" | ");
sb.append(auction.getHighestBid());
sb.append(" | ");
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
index f469c39159..2362aa9446 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -21,6 +21,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.Location;
@@ -73,7 +74,7 @@ public class ProvisionalHalls extends AbstractNpcAI
if (resetTime > 0)
{
cancelQuestTimers(HALL_RESET_VAR + id);
- startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
}
}
}
@@ -126,7 +127,7 @@ public class ProvisionalHalls extends AbstractNpcAI
for (int id : CLAN_HALLS.keySet())
{
- if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < Chronos.currentTimeMillis()))
{
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
@@ -137,7 +138,7 @@ public class ProvisionalHalls extends AbstractNpcAI
clanHall.setOwner(player.getClan());
}
player.sendMessage("Congratulations! You now own a provisional clan hall!");
- startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
return null;
}
}
@@ -177,7 +178,7 @@ public class ProvisionalHalls extends AbstractNpcAI
else if (event.startsWith(HALL_RESET_VAR))
{
final String id = event.replace(HALL_RESET_VAR, "");
- if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
{
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
if (clanId > 0)
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index 6075e499f2..dfcb4a657c 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -19,6 +19,7 @@ package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -111,7 +112,7 @@ public class TrainingCamp extends AbstractNpcAI
player.teleToLocation(TRAINING_LOCATION);
player.setImmobilized(true);
// @Sdw: Here we are supposed to send ExUserInfoEquipSlot with a fake equip of a SLS, feels ugly to me, not doing it.
- player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
+ player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), Chronos.currentTimeMillis(), -1));
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
@@ -203,7 +204,7 @@ public class TrainingCamp extends AbstractNpcAI
final TrainingHolder holder = player.getTraingCampInfo();
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
index 266a3ce5d7..0bdd1866e5 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
@@ -16,6 +16,7 @@
*/
package events.FreyaCelebration;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -79,7 +80,7 @@ public class FreyaCelebration extends LongTimeEvent
{
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
if (currentTime > reuseTime)
{
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
index 81a3c0008a..e44992df15 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
@@ -16,6 +16,7 @@
*/
package events.GiftOfVitality;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -94,9 +95,9 @@ public class GiftOfVitality extends LongTimeEvent
case "vitality":
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HR_S3_MIN);
@@ -110,7 +111,7 @@ public class GiftOfVitality extends LongTimeEvent
{
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
htmltext = "4306-okvitality.htm";
}
break;
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/HappyHours/HappyHours.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/HappyHours/HappyHours.java
index 536ed53fe2..2d3261f1c3 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/HappyHours/HappyHours.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/HappyHours/HappyHours.java
@@ -16,6 +16,7 @@
*/
package events.HappyHours;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -39,7 +40,7 @@ public class HappyHours extends LongTimeEvent
// Other
private static final int MIN_LEVEL = 20;
private static final int REWARD_INTERVAL = 60 * 60 * 1000; // 1 hour
- private static long _lastRewardTime = System.currentTimeMillis();
+ private static long _lastRewardTime = Chronos.currentTimeMillis();
private HappyHours()
{
@@ -76,9 +77,9 @@ public class HappyHours extends LongTimeEvent
{
if (isEventPeriod())
{
- if ((System.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
+ if ((Chronos.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
{
- _lastRewardTime = System.currentTimeMillis();
+ _lastRewardTime = Chronos.currentTimeMillis();
final ExShowScreenMessage screenMsg = new ExShowScreenMessage("You obtained 20 Sibi's coins.", ExShowScreenMessage.TOP_CENTER, 7000, 0, true, true);
final SystemMessage systemMsg = new SystemMessage(SystemMessageId.YOU_HAVE_OBTAINED_S1_SIBI_S_COINS);
systemMsg.addInt(20);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
index 9c977cbe43..2e66ed664e 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
@@ -16,6 +16,7 @@
*/
package events.LoveYourGatekeeper;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -58,9 +59,9 @@ public class LoveYourGatekeeper extends LongTimeEvent
if (player.getAdena() >= PRICE)
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HR_S3_MIN);
@@ -73,7 +74,7 @@ public class LoveYourGatekeeper extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, PRICE);
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
}
}
else
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
index 241482d1cb..3e5d9a15d5 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
@@ -16,6 +16,7 @@
*/
package events.MasterOfEnchanting;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -86,7 +87,7 @@ public class MasterOfEnchanting extends LongTimeEvent
}
else if (event.equalsIgnoreCase("buy_scroll_24"))
{
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
final String value = player.getVariables().getString("MasterOfEnchanting", "");
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
@@ -100,7 +101,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
@@ -134,7 +135,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/SavingSanta/SavingSanta.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
index 4f95514f8c..b6900127dc 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -324,7 +325,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_rewardedPlayers.containsKey(pl.getAccountName()))
{
- final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
+ final long elapsedTimeSinceLastRewarded = Chronos.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
{
continue;
@@ -333,7 +334,7 @@ public class SavingSanta extends LongTimeEvent
else
{
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
- if ((System.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
+ if ((Chronos.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
{
_rewardedPlayers.put(pl.getAccountName(), time);
continue;
@@ -343,8 +344,8 @@ public class SavingSanta extends LongTimeEvent
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
- _rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
- player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
+ _rewardedPlayers.put(pl.getAccountName(), Chronos.currentTimeMillis());
+ player.getVariables().set("LAST_SANTA_REWARD", Chronos.currentTimeMillis());
startQuestTimer("SantaRewarding0", 500, santa, pl);
}
}
@@ -437,7 +438,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
{
startQuestTimer("SantaBlessings", 15000, null, null);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Npc santaHelper1 : _santaHelpers)
{
for (PlayerInstance plb : World.getInstance().getVisibleObjects(santaHelper1, PlayerInstance.class))
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
index 64d4112e1f..729838d853 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Collection;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.CursedWeapon;
@@ -209,7 +210,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
}
- cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
+ cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
cw.reActivate();
}
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
index 9801093a20..0e4285c8e3 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Calendar;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -66,7 +67,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
{
final Calendar nextChangeDate = Calendar.getInstance();
- nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
+ nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
html.replace("%sodtime%", nextChangeDate.getTime().toString());
}
else
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
index e2c17e3d50..dec3cec950 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,7 +119,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
int hours = 0;
int minutes = 0;
final int id = entry.getKey();
- final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
if (remainingTime > 0)
{
hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
index 5fffc77ae3..8c3faede2d 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -233,7 +234,7 @@ public class AdminPunishment implements IAdminCommandHandler
long expirationTime = Integer.parseInt(exp);
if (expirationTime > 0)
{
- expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
+ expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
}
final PunishmentAffect affect = PunishmentAffect.getByName(af);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
index aa1d6dd435..ae1bb4e0b2 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -60,7 +61,7 @@ public class AdminServerInfo implements IAdminCommandHandler
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
- html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
+ html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
html.replace("%serverUpTime%", getServerUpTime());
html.replace("%onlineAll%", getPlayersCount("ALL"));
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
@@ -76,7 +77,7 @@ public class AdminServerInfo implements IAdminCommandHandler
private String getServerUpTime()
{
- long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
+ long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
final long days = TimeUnit.MILLISECONDS.toDays(time);
time -= TimeUnit.DAYS.toMillis(days);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
index ff3b82a10f..21489c89f6 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IBypassHandler;
@@ -133,7 +134,7 @@ public class FindPvP implements IBypassHandler
player.setSpawnProtection(true);
if (!player.isGM())
{
- player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
player.startPvPFlag();
}
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
index a81161c50a..adb3c27701 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.dailymissionhandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -61,9 +62,9 @@ public class LoginMonthDailyMissionHandler extends AbstractDailyMissionHandler
final long lastCompleted = entry.getLastCompleted();
if (lastCompleted == 0) // Initial entry.
{
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
}
- else if ((System.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
+ else if ((Chronos.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
index 9fee9dd50e..0322107487 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
@@ -18,6 +18,7 @@ package handlers.dailymissionhandlers;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -63,7 +64,7 @@ public class LoginWeekendDailyMissionHandler extends AbstractDailyMissionHandler
final int currentDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
final long lastCompleted = entry.getLastCompleted();
if (((currentDay == Calendar.SATURDAY) || (currentDay == Calendar.SUNDAY)) // Reward only on weekend.
- && ((lastCompleted == 0) || ((System.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
+ && ((lastCompleted == 0) || ((Chronos.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
index 71928b144a..c2ea6f7a5a 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.punishmenthandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.model.World;
@@ -126,7 +127,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 245af11bfa..2abbe8e8e8 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -17,6 +17,7 @@
package handlers.punishmenthandlers;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
@@ -180,7 +181,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
index 3dd1cdc97d..fd92c92ed9 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Ban implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
index f653561c0d..85b92a163b 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class BanChat implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
index cf3736fc0e..c21718ad0c 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Jail implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
index 43b6df41dc..a57194664d 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
@@ -18,6 +18,7 @@ package handlers.usercommandhandlers;
import java.text.SimpleDateFormat;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -46,7 +47,7 @@ public class ClanPenalty implements IUserCommandHandler
final StringBuilder htmlContent = new StringBuilder(500);
htmlContent.append("");
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append("Unable to join a clan. | ");
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
@@ -54,7 +55,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append(" | Unable to create a clan. | ");
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
@@ -62,7 +63,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
+ if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
{
htmlContent.append(" | Unable to invite a clan member. | ");
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/usercommandhandlers/Time.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
index 530047a4f2..57bd48cd81 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Time implements IUserCommandHandler
player.sendPacket(sm);
if (Config.DISPLAY_SERVER_TIME)
{
- player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
+ player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
}
return true;
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
index a2eab150c7..f727b3518f 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
@@ -18,6 +18,7 @@ package handlers.voicedcommandhandlers;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
@@ -103,7 +104,7 @@ public class ChatAdmin implements IVoicedCommandHandler
return false;
}
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
if (expirationTime > 0)
{
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
index 213e03e20a..5bf36c47d0 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
@@ -19,6 +19,7 @@ package handlers.voicedcommandhandlers;
import java.text.SimpleDateFormat;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Premium implements IVoicedCommandHandler
html.append(" |
Spoil Chance: x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " |
");
html.append("Spoil Amount: x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " |
");
html.append("Expires: " + format.format(endDate) + " |
");
- html.append("Current Date: " + format.format(System.currentTimeMillis()) + "
|
");
+ html.append("Current Date: " + format.format(Chronos.currentTimeMillis()) + "
|
");
html.append("Premium Info & Rules
|
");
html.append("1. Premium accounts CAN NOT BE TRANSFERED. |
");
html.append("2. Premium does not effect party members. |
");
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
index 4dedee6473..6a07191990 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -156,7 +157,7 @@ public class CastleDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -174,7 +175,7 @@ public class CastleDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
index 686b01379b..ea8ca11b83 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -169,7 +170,7 @@ public class FortressDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -197,7 +198,7 @@ public class FortressDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
index 298c540332..cba8d2bb56 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
@@ -469,7 +470,7 @@ public class Kamaloka extends AbstractInstance
continue;
}
// if found instance still can't be reentered - exit
- if (System.currentTimeMillis() < entry.getValue().longValue())
+ if (Chronos.currentTimeMillis() < entry.getValue().longValue())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
sm.addPcName(partyMember);
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
index b3de2f227a..31fa72d28c 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
@@ -260,7 +261,7 @@ public class PailakaRuneCastle extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first wave
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
}
@@ -280,7 +281,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
@@ -309,7 +310,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/Chronos.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/Chronos.java
new file mode 100644
index 0000000000..a4d15f77e5
--- /dev/null
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/Chronos.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2021 Pantelis Andrianakis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.l2jmobius.commons.util;
+
+/**
+ * Chronos updates an internal long value with System.currentTimeMillis() approximately every 1 millisecond.
+ * To get the current time in milliseconds use Chronos.currentTimeMillis()
+ * @author Pantelis Andrianakis
+ * @version February 3rd 2021
+ */
+public class Chronos extends Thread
+{
+ private long _currentTimeMillis = System.currentTimeMillis();
+
+ public Chronos()
+ {
+ super.setName("Chronos");
+ super.setPriority(MAX_PRIORITY);
+ super.setDaemon(true);
+ super.start();
+ }
+
+ @Override
+ public void run()
+ {
+ while (true)
+ {
+ _currentTimeMillis = System.currentTimeMillis();
+
+ // Sleep for approximately 1 millisecond.
+ try
+ {
+ Thread.sleep(1);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /**
+ * Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond,the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
+ *
+ * See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).
+ * @return the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+ */
+ public static long currentTimeMillis()
+ {
+ return getInstance()._currentTimeMillis;
+ }
+
+ public static Chronos getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final Chronos INSTANCE = new Chronos();
+ }
+}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java
index a4c436a915..cac91bf103 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java
@@ -32,6 +32,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.enums.ServerMode;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.DeadLockDetector;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.BotReportTable;
@@ -182,7 +183,7 @@ public class GameServer
public GameServer() throws Exception
{
- final long serverLoadStart = System.currentTimeMillis();
+ final long serverLoadStart = Chronos.currentTimeMillis();
// GUI
if (!GraphicsEnvironment.isHeadless())
@@ -465,7 +466,7 @@ public class GameServer
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
- LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
+ LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
ClientNetworkManager.getInstance().start();
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameTimeController.java
index aa4d359090..48391b466d 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameTimeController.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange;
@@ -97,7 +98,7 @@ public class GameTimeController extends Thread
*/
public int getGameTicks()
{
- return (int) ((System.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
+ return (int) ((Chronos.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
}
/**
@@ -155,7 +156,7 @@ public class GameTimeController extends Thread
while (true)
{
- nextTickTime = ((System.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
+ nextTickTime = ((Chronos.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
try
{
@@ -166,7 +167,7 @@ public class GameTimeController extends Thread
LOGGER.log(Level.WARNING, getClass().getSimpleName(), e);
}
- sleepTime = nextTickTime - System.currentTimeMillis();
+ sleepTime = nextTickTime - Chronos.currentTimeMillis();
if (sleepTime > 0)
{
try
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
index 2fcae24603..cfb16ebb07 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -42,7 +43,7 @@ public class ItemsAutoDestroy
public synchronized void addItem(ItemInstance item)
{
- item.setDropTime(System.currentTimeMillis());
+ item.setDropTime(Chronos.currentTimeMillis());
_items.add(item);
}
@@ -53,7 +54,7 @@ public class ItemsAutoDestroy
return;
}
- final long curtime = System.currentTimeMillis();
+ final long curtime = Chronos.currentTimeMillis();
final Iterator itemIterator = _items.iterator();
while (itemIterator.hasNext())
{
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/Shutdown.java
index 01f7e56d47..7ac8c79420 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/Shutdown.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseBackup;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
@@ -529,19 +530,19 @@ public class Shutdown extends Thread
protected void restartCounter()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
}
protected long getEstimatedTimeAndRestartCounter()
{
- final long toReturn = System.currentTimeMillis() - _startTime;
+ final long toReturn = Chronos.currentTimeMillis() - _startTime;
restartCounter();
return toReturn;
}
protected long getEstimatedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/CreatureAI.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/CreatureAI.java
index 22de59f51a..e03e0463be 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/CreatureAI.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/CreatureAI.java
@@ -33,6 +33,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -308,7 +309,7 @@ public class CreatureAI extends AbstractAI
if (_actor.isAttackingNow())
{
- ThreadPool.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(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index fa5cca3384..26734231aa 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -39,7 +40,7 @@ public class WarehouseCacheManager
public void addCacheTask(PlayerInstance pc)
{
- CACHED_WH.put(pc, System.currentTimeMillis());
+ CACHED_WH.put(pc, Chronos.currentTimeMillis());
}
public void remCacheTask(PlayerInstance pc)
@@ -56,7 +57,7 @@ public class WarehouseCacheManager
@Override
public void run()
{
- final long cTime = System.currentTimeMillis();
+ final long cTime = Chronos.currentTimeMillis();
for (Entry entry : CACHED_WH.entrySet())
{
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/BotReportTable.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/BotReportTable.java
index 28f600ef20..9979f927c4 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/BotReportTable.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/BotReportTable.java
@@ -39,6 +39,7 @@ import org.xml.sax.helpers.DefaultHandler;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -124,7 +125,7 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() < c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() < c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
}
@@ -290,7 +291,7 @@ public class BotReportTable
return false;
}
- final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
+ final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MIN_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
@@ -301,7 +302,7 @@ public class BotReportTable
}
}
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
if (rcd == null)
{
rcd = new ReportedCharData();
@@ -418,12 +419,12 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() > c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() > c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
}
- ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
+ ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - Chronos.currentTimeMillis());
}
catch (Exception e)
{
@@ -464,7 +465,7 @@ public class BotReportTable
{
if (map.containsKey(objectId))
{
- return (System.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
+ return (Chronos.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
}
return true;
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/sql/ClanTable.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
index 4e4da8df06..10f7e0b311 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.enums.ClanWarState;
@@ -171,7 +172,7 @@ public class ClanTable
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
return null;
}
- if (System.currentTimeMillis() < player.getClanCreateExpiryTime())
+ if (Chronos.currentTimeMillis() < player.getClanCreateExpiryTime())
{
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
return null;
@@ -346,7 +347,7 @@ public class ClanTable
{
destroyClan(clanId);
}
- }, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
+ }, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
}
public boolean isAllyExists(String allyName)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index 49b0381c91..c3ab796fbf 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World;
@@ -185,7 +186,7 @@ public class OfflineTraderTable
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- if (cal.getTimeInMillis() <= System.currentTimeMillis())
+ if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
{
continue;
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
index 771af1a0a5..8f51b3f599 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.enums.SpecialItemType;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -114,7 +115,7 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
final DailyMissionPlayerEntry entry = getPlayerEntry(player.getObjectId(), true);
entry.setStatus(DailyMissionStatus.COMPLETED);
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
entry.setRecentlyCompleted(true);
storePlayerEntry(entry);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
index 025c3208e6..ecb5b8dc95 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.enums.PlayerAction;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -115,7 +116,7 @@ public class AdminCommandHandler implements IHandler
{
- final long begin = System.currentTimeMillis();
+ final long begin = Chronos.currentTimeMillis();
try
{
if (Config.GMAUDIT)
@@ -133,7 +134,7 @@ public class AdminCommandHandler implements IHandler 5000)
{
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
index fedf7cd9dc..ee7642eca5 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -48,7 +49,7 @@ public class AntiFeedManager
*/
public void setLastDeathTime(int objectId)
{
- _lastDeathTimes.put(objectId, System.currentTimeMillis());
+ _lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
}
/**
@@ -81,7 +82,7 @@ public class AntiFeedManager
return false;
}
- if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
+ if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((Chronos.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
{
return false;
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index 3d8c1f50e4..301806d976 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ManorMode;
@@ -276,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
- ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
+ ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
}
public void changeMode()
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
index c43d026ec7..56d896b304 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.model.CursedWeapon;
import org.l2jmobius.gameserver.model.actor.Attackable;
@@ -313,7 +314,7 @@ public class CursedWeaponsManager implements IXmlReader
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MIN_OF_USAGE_TIME_REMAINING);
sm.addString(cw.getName());
// sm.addItemName(cw.getItemId());
- sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
+ sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
player.sendPacket(sm);
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index 72602e0968..babf2e1476 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -193,7 +194,7 @@ public class DBSpawnManager
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
- final long respawnTime = System.currentTimeMillis() + respawnDelay;
+ final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
info.set("currentHP", npc.getMaxHp());
info.set("currentMP", npc.getMaxMp());
info.set("respawnTime", respawnTime);
@@ -235,7 +236,7 @@ public class DBSpawnManager
}
final int npcId = spawn.getId();
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SpawnTable.getInstance().addNewSpawn(spawn, false);
if ((respawnTime == 0) || (time > respawnTime))
{
@@ -257,7 +258,7 @@ public class DBSpawnManager
}
else
{
- final long spawnTime = respawnTime - System.currentTimeMillis();
+ final long spawnTime = respawnTime - Chronos.currentTimeMillis();
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index 60a818cab6..06cce0d3a3 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -21,6 +21,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -104,7 +105,7 @@ public class GraciaSeedsManager
case 2:
{
// Conquest Complete state, if too much time is passed than change to defense state
- final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
+ final long timePast = Chronos.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
if (timePast >= Config.SOD_STAGE_2_LENGTH)
{
// change to Attack state because Defend statet is not implemented
@@ -172,7 +173,7 @@ public class GraciaSeedsManager
public void setSoDState(int value, boolean doSave)
{
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
- _SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
+ _SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
_SoDState = value;
// reset number of Tiat kills
if (_SoDState == 1)
@@ -198,7 +199,7 @@ public class GraciaSeedsManager
}
case 2:
{
- return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
+ return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
}
case 3:
{
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index d595a5befa..052f8984d2 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.util.PrimeFinder;
/**
@@ -85,7 +86,7 @@ public class IdManager
try (Connection con = DatabaseFactory.getConnection();
Statement statement = con.createStatement())
{
- final long cleanupStart = System.currentTimeMillis();
+ final long cleanupStart = Chronos.currentTimeMillis();
int cleanCount = 0;
// Characters
@@ -157,7 +158,7 @@ public class IdManager
statement.executeUpdate("UPDATE characters SET clanid=0, clan_privs=0, wantspeace=0, subpledge=0, lvl_joined_academy=0, apprentice=0, sponsor=0, clan_join_expiry_time=0, clan_create_expiry_time=0 WHERE characters.clanid > 0 AND characters.clanid NOT IN (SELECT clan_id FROM clan_data);");
statement.executeUpdate("UPDATE fort SET owner=0 WHERE owner NOT IN (SELECT clan_id FROM clan_data);");
- LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((System.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
+ LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((Chronos.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
}
catch (Exception e)
{
@@ -173,7 +174,7 @@ public class IdManager
{
try (PreparedStatement statement = con.prepareStatement(line))
{
- statement.setLong(1, System.currentTimeMillis());
+ statement.setLong(1, Chronos.currentTimeMillis());
cleanCount += statement.executeUpdate();
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
index d47e436ace..d1f8cd35e2 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
@@ -40,6 +40,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.data.xml.SpawnData;
@@ -521,7 +522,7 @@ public class InstanceManager implements IXmlReader
{
// Check if instance penalty passed
final long time = rs.getLong("time");
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
// Load params
final int charId = rs.getInt("charId");
@@ -556,7 +557,7 @@ public class InstanceManager implements IXmlReader
final List invalidPenalty = new ArrayList<>(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- if (entry.getValue() <= System.currentTimeMillis())
+ if (entry.getValue() <= Chronos.currentTimeMillis())
{
invalidPenalty.add(entry.getKey());
}
@@ -615,7 +616,7 @@ public class InstanceManager implements IXmlReader
// If reenter time is higher then current, delete it
final long time = playerData.get(id);
- if (time <= System.currentTimeMillis())
+ if (time <= Chronos.currentTimeMillis())
{
deleteInstanceTime(player, id);
return -1;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 739f67e9a9..dfb4734ca5 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -83,7 +84,7 @@ public class ItemsOnGroundManager implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(str))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.execute();
}
catch (Exception e)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
index df45860d40..d429a2f8c9 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Mentee;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -145,7 +146,7 @@ public class MentorManager
{
final PlayerInstance player = World.getInstance().getPlayer(mentorId);
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
- vars.set("Mentor-Penalty-" + mentorId, String.valueOf(System.currentTimeMillis() + penalty));
+ vars.set("Mentor-Penalty-" + mentorId, String.valueOf(Chronos.currentTimeMillis() + penalty));
}
public long getMentorPenalty(int mentorId)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
index b6c44953b1..80bfff5fdb 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.Containers;
@@ -79,7 +80,7 @@ public class PremiumManager
final PlayerInstance player = event.getPlayer();
final String accountName = player.getAccountName();
loadPremiumData(accountName);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
final long premiumExpiration = getPremiumExpiration(accountName);
player.setPremiumStatus(premiumExpiration > now);
if (player.hasPremiumStatus())
@@ -153,7 +154,7 @@ public class PremiumManager
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
{
final long addTime = timeUnit.toMillis(timeValue);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
// new premium task at least from now
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
final long newPremiumExpiration = oldPremiumExpiration + addTime;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
index 9617f26e43..08193f9c5b 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
@@ -71,7 +72,7 @@ public class PunishmentManager
final String punishedBy = rset.getString("punishedBy");
if ((type != null) && (affect != null))
{
- if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
+ if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
{
expired++;
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
index 687d1288b9..ab73056bb1 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -424,7 +425,7 @@ public class BlockChecker
// Start up player parameters
setUpPlayers();
// Set the started time
- _startedTime = System.currentTimeMillis() + 300000;
+ _startedTime = Chronos.currentTimeMillis() + 300000;
}
}
@@ -524,7 +525,7 @@ public class BlockChecker
_redPoints += _numOfBoxes / 2;
_bluePoints += _numOfBoxes / 2;
- final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((_startedTime - Chronos.currentTimeMillis()) / 1000);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
_holder.broadCastPacketToTeam(changePoints);
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/CursedWeapon.java
index 60865845b8..e647f880d7 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/CursedWeapon.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
@@ -237,7 +238,7 @@ public class CursedWeapon implements INamable
@Override
public void run()
{
- if (System.currentTimeMillis() >= _endTime)
+ if (Chronos.currentTimeMillis() >= _endTime)
{
endOfLife();
}
@@ -366,7 +367,7 @@ public class CursedWeapon implements INamable
public void reActivate()
{
_isActivated = true;
- if ((_endTime - System.currentTimeMillis()) <= 0)
+ if ((_endTime - Chronos.currentTimeMillis()) <= 0)
{
endOfLife();
}
@@ -384,7 +385,7 @@ public class CursedWeapon implements INamable
dropIt(attackable, player);
// Start the Life Task
- _endTime = System.currentTimeMillis() + (_duration * 60000);
+ _endTime = Chronos.currentTimeMillis() + (_duration * 60000);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
return true;
}
@@ -678,7 +679,7 @@ public class CursedWeapon implements INamable
public long getTimeLeft()
{
- return _endTime - System.currentTimeMillis();
+ return _endTime - Chronos.currentTimeMillis();
}
public void goTo(PlayerInstance player)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/ItemInfo.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/ItemInfo.java
index 9ea4c13763..16f3dfe23e 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/ItemInfo.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/ItemInfo.java
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.model.buylist.Product;
import org.l2jmobius.gameserver.model.ensoul.EnsoulOption;
@@ -151,14 +152,14 @@ public class ItemInfo
_soulCrystalOptions = item.getSpecialAbilities();
_soulCrystalSpecialOptions = item.getAdditionalSpecialAbilities();
_visualId = item.getVisualId();
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(ItemInstance item, int change)
{
this(item);
_change = change;
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(TradeItem item)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Message.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Message.java
index e6b1c31d32..53d2f20768 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Message.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Message.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.enums.MailType;
@@ -104,7 +105,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = text;
- _expiration = (isCod ? System.currentTimeMillis() + (COD_EXPIRATION * 3600000) : System.currentTimeMillis() + (EXPIRATION * 3600000));
+ _expiration = (isCod ? Chronos.currentTimeMillis() + (COD_EXPIRATION * 3600000) : Chronos.currentTimeMillis() + (EXPIRATION * 3600000));
_hasAttachments = false;
_unread = true;
_deletedBySender = false;
@@ -123,7 +124,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_reqAdena = 0;
_hasAttachments = false;
_unread = true;
@@ -143,7 +144,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_hasAttachments = false;
_unread = true;
_deletedBySender = true;
@@ -162,7 +163,7 @@ public class Message
_receiverId = msg.getSenderId();
_subject = "";
_content = "";
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_deletedByReceiver = false;
@@ -182,7 +183,7 @@ public class Message
_receiverId = receiverId;
_subject = "";
_content = item.getName();
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_messageType = mailType;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Petition.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Petition.java
index b19b6f9025..d3f95461ac 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Petition.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Petition.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PetitionState;
import org.l2jmobius.gameserver.enums.PetitionType;
import org.l2jmobius.gameserver.instancemanager.IdManager;
@@ -36,7 +37,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class Petition
{
- private final long _submitTime = System.currentTimeMillis();
+ private final long _submitTime = Chronos.currentTimeMillis();
private final int _id;
private final PetitionType _type;
private PetitionState _state = PetitionState.PENDING;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Spawn.java
index 4a1a2926b3..eb57e4e69b 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -258,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
_scheduledCount++;
// Schedule the next respawn.
- RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
+ RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/TimeStamp.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/TimeStamp.java
index 8c232969e0..9bdb39d293 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/TimeStamp.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/TimeStamp.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -52,7 +53,7 @@ public class TimeStamp
_id2 = skill.getLevel();
_id3 = skill.getSubLevel();
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = -1;
}
@@ -68,7 +69,7 @@ public class TimeStamp
_id2 = item.getObjectId();
_id3 = 0;
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = item.getSharedReuseGroup();
}
@@ -155,7 +156,7 @@ public class TimeStamp
{
return 0;
}
- final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
+ final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
if (remainingTime == 0)
{
_stamp = 0;
@@ -173,7 +174,7 @@ public class TimeStamp
{
return false;
}
- final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
+ final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
if (!hasNotPassed)
{
_stamp = 0;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java
index 134a095206..43fe92a776 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.AttackableAI;
import org.l2jmobius.gameserver.ai.CreatureAI;
@@ -215,7 +216,7 @@ public class Attackable extends Npc
if (_firstCommandChannelAttacked != null)
{
_commandChannelTimer = new CommandChannelTimer(this);
- _commandChannelLastAttack = System.currentTimeMillis();
+ _commandChannelLastAttack = Chronos.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
@@ -224,7 +225,7 @@ public class Attackable extends Npc
}
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
{
- _commandChannelLastAttack = System.currentTimeMillis(); // update last attack time
+ _commandChannelLastAttack = Chronos.currentTimeMillis(); // update last attack time
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 321f95d137..c44bdcf809 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -41,6 +41,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.EmptyQueue;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -1393,7 +1394,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : _reuseTimeStampsItems.values())
{
if (ts.getSharedReuseGroup() == group)
@@ -1523,7 +1524,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return;
}
- _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? System.currentTimeMillis() + delay : Long.MAX_VALUE);
+ _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? Chronos.currentTimeMillis() + delay : Long.MAX_VALUE);
}
/**
@@ -1571,7 +1572,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return false;
}
- if (stamp < System.currentTimeMillis())
+ if (stamp < Chronos.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java
index 62f1d1049f..d288fe8816 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -203,7 +204,7 @@ public class Npc extends Creature
public void onRandomAnimation(int animationId)
{
// Send a packet SocialAction to all PlayerInstance in the _KnownPlayers of the NpcInstance
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
{
_lastSocialBroadcast = now;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
index 7eacda4aa1..c87a2006a9 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.actor.instance;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
@@ -141,7 +142,7 @@ public class BlockInstance extends MonsterInstance
{
eng.increasePlayerPoints(player, team);
- final int timeLeft = (int) ((eng.getStarterTime() - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((eng.getStarterTime() - Chronos.currentTimeMillis()) / 1000);
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints());
final ExCubeGameExtendedChangePoints secretPoints = new ExCubeGameExtendedChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints(), isRed, player, eng.getPlayerPoints(player, isRed));
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 8bab7b04b7..b28cb84dbe 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -45,6 +45,7 @@ import java.util.stream.Collectors;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -2829,7 +2830,7 @@ public class PlayerInstance extends Playable
public void setOnlineTime(long time)
{
_onlineTime = time;
- _onlineBeginTime = System.currentTimeMillis();
+ _onlineBeginTime = Chronos.currentTimeMillis();
}
/**
@@ -3874,22 +3875,22 @@ public class PlayerInstance extends Playable
public boolean isSpawnProtected()
{
- return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
+ return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
}
public boolean isTeleportProtected()
{
- return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
+ return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
}
public void setSpawnProtection(boolean protect)
{
- _spawnProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
+ _spawnProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
}
public void setTeleportProtection(boolean protect)
{
- _teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
+ _teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
}
/**
@@ -5215,7 +5216,7 @@ public class PlayerInstance extends Playable
{
return;
}
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
if (_pvpFlag == 0)
{
startPvPFlag();
@@ -5248,11 +5249,11 @@ public class PlayerInstance extends Playable
{
if (checkIfPvP(targetPlayer))
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
}
else
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
}
if (_pvpFlag == 0)
{
@@ -6129,7 +6130,7 @@ public class PlayerInstance extends Playable
public long getUptime()
{
- return System.currentTimeMillis() - _uptime;
+ return Chronos.currentTimeMillis() - _uptime;
}
/**
@@ -6373,7 +6374,7 @@ public class PlayerInstance extends Playable
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
{
statement.setInt(1, isOnlineInt());
- statement.setLong(2, System.currentTimeMillis());
+ statement.setLong(2, Chronos.currentTimeMillis());
statement.setInt(3, getObjectId());
statement.execute();
}
@@ -6499,12 +6500,12 @@ public class PlayerInstance extends Playable
}
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
- if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanJoinExpiryTime(0);
}
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
- if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanCreateExpiryTime(0);
}
@@ -6566,7 +6567,7 @@ public class PlayerInstance extends Playable
player.getAppearance().setTitleColor(titleColor);
}
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
- player.setUptime(System.currentTimeMillis());
+ player.setUptime(Chronos.currentTimeMillis());
currentHp = rset.getDouble("curHp");
currentCp = rset.getDouble("curCp");
@@ -7082,7 +7083,7 @@ public class PlayerInstance extends Playable
long totalOnlineTime = _onlineTime;
if (_onlineBeginTime > 0)
{
- totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
+ totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
}
statement.setLong(34, totalOnlineTime);
@@ -7168,7 +7169,7 @@ public class PlayerInstance extends Playable
int buffIndex = 0;
final List storedSkills = new ArrayList<>();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
// Store all effect data along with calulated remaining
// reuse delays for matching skills. 'restore_type'= 0.
@@ -7283,7 +7284,7 @@ public class PlayerInstance extends Playable
ps1.setInt(1, getObjectId());
ps1.execute();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : getItemReuseTimeStamps().values())
{
if ((ts != null) && (currentTime < ts.getStamp()))
@@ -7606,7 +7607,7 @@ public class PlayerInstance extends Playable
statement.setInt(2, _classIndex);
try (ResultSet rset = statement.executeQuery())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
final int remainingTime = rset.getInt("remaining_time");
@@ -7668,7 +7669,7 @@ public class PlayerInstance extends Playable
long systime;
boolean isInInventory;
long remainingTime;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
itemId = rset.getInt("itemId");
@@ -7743,7 +7744,7 @@ public class PlayerInstance extends Playable
{
int slot;
int symbolId;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
slot = rset.getInt("slot");
@@ -7866,7 +7867,7 @@ public class PlayerInstance extends Playable
// Send Server->Client UserInfo packet to this PlayerInstance
broadcastUserInfo(UserInfoType.BASE_STATS, UserInfoType.MAX_HPCPMP, UserInfoType.STATS, UserInfoType.SPEED);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long timeLeft = getVariables().getLong("HennaDuration" + slot, currentTime) - currentTime;
if ((henna.getDuration() < 0) || (timeLeft > 0))
{
@@ -7957,7 +7958,7 @@ public class PlayerInstance extends Playable
// Task for henna duration
if (henna.getDuration() > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
@@ -12413,7 +12414,7 @@ public class PlayerInstance extends Playable
public int getBirthdays()
{
- long time = (System.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
+ long time = (Chronos.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
time /= TimeUnit.DAYS.toMillis(365);
return (int) time;
}
@@ -12653,7 +12654,7 @@ public class PlayerInstance extends Playable
return false;
}
- if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
+ if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@@ -12713,7 +12714,7 @@ public class PlayerInstance extends Playable
*/
public void setFalling()
{
- _fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
+ _fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
}
/**
@@ -12734,7 +12735,7 @@ public class PlayerInstance extends Playable
*/
public void updateLastItemAuctionRequest()
{
- _lastItemAuctionInfoRequest = System.currentTimeMillis();
+ _lastItemAuctionInfoRequest = Chronos.currentTimeMillis();
}
/**
@@ -12743,7 +12744,7 @@ public class PlayerInstance extends Playable
*/
public boolean isItemAuctionPolling()
{
- return (System.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
+ return (Chronos.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
}
@Override
@@ -13127,7 +13128,7 @@ public class PlayerInstance extends Playable
public void updateNotMoveUntil()
{
- _notMoveUntil = System.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
+ _notMoveUntil = Chronos.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
}
@Override
@@ -14174,7 +14175,7 @@ public class PlayerInstance extends Playable
public boolean isInTraingCamp()
{
final TrainingHolder trainingHolder = getTraingCampInfo();
- return (trainingHolder != null) && (trainingHolder.getEndTime() > System.currentTimeMillis());
+ return (trainingHolder != null) && (trainingHolder.getEndTime() > Chronos.currentTimeMillis());
}
public AttendanceInfoHolder getAttendanceInfo()
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
index ac089b7e91..bf4cea7560 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
@@ -21,6 +21,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.InstanceType;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
@@ -280,13 +281,13 @@ public class VillageMasterInstance extends NpcInstance
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
return;
}
- clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setDissolvingExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
// The clan leader should take the XP penalty of a full death.
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 843165d245..18d77105c7 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.attackable;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
/**
@@ -40,7 +41,7 @@ public class CommandChannelTimer implements Runnable
return;
}
- if ((System.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
+ if ((Chronos.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
{
_attackable.setCommandChannelTimer(null);
_attackable.setFirstCommandChannelAttacked(null);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
index e2130407ac..290e49a99f 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.player;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -92,12 +93,12 @@ public class IllegalPlayerActionTask implements Runnable
}
case KICKBAN:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
case JAIL:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/buylist/Product.java
index 0782846eba..3fc18a73e3 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/buylist/Product.java
@@ -25,6 +25,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.type.EtcItemType;
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
@@ -134,7 +135,7 @@ public class Product
public void restartRestockTask(long nextRestockTime)
{
- final long remainTime = nextRestockTime - System.currentTimeMillis();
+ final long remainTime = nextRestockTime - Chronos.currentTimeMillis();
if (remainTime > 0)
{
BuyListTaskManager.getInstance().update(this, remainTime);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
index 8e5e7b71d1..c6e52cf0a0 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
import org.l2jmobius.gameserver.enums.QuestSound;
@@ -278,7 +279,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
});
}
}
- _battleStartTime = System.currentTimeMillis();
+ _battleStartTime = Chronos.currentTimeMillis();
getTimers().addRepeatingTimer("update", 1000, null, null);
}
@@ -505,7 +506,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
private void updateLifeTime(CeremonyOfChaosMember member)
{
- member.setLifeTime(((int) (System.currentTimeMillis() - _battleStartTime) / 1000));
+ member.setLifeTime(((int) (Chronos.currentTimeMillis() - _battleStartTime) / 1000));
}
public List getWinners()
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/clan/Clan.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/clan/Clan.java
index fd7c721083..d3f28a8c3f 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/clan/Clan.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/clan/Clan.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -505,7 +506,7 @@ public class Clan implements IIdentifiable, INamable
if (player.isClanLeader())
{
SiegeManager.getInstance().removeSiegeSkills(player);
- player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ player.setClanCreateExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
}
// remove Clan skills from Player
@@ -537,7 +538,7 @@ public class Clan implements IIdentifiable, INamable
}
else
{
- removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
+ removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
}
// Notify to scripts
@@ -1002,12 +1003,12 @@ public class Clan implements IIdentifiable, INamable
setAllyId(clanData.getInt("ally_id"));
setAllyName(clanData.getString("ally_name"));
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
- if (_allyPenaltyExpiryTime < System.currentTimeMillis())
+ if (_allyPenaltyExpiryTime < Chronos.currentTimeMillis())
{
setAllyPenaltyExpiryTime(0, 0);
}
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
- if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
+ if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < Chronos.currentTimeMillis()) // 24*60*60*1000 = 86400000
{
setCharPenaltyExpiryTime(0);
}
@@ -2048,7 +2049,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
return false;
}
- if (_charPenaltyExpiryTime > System.currentTimeMillis())
+ if (_charPenaltyExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return false;
@@ -2060,7 +2061,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (target.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (target.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(target.getName());
@@ -2102,7 +2103,7 @@ public class Clan implements IIdentifiable, INamable
return false;
}
final Clan leaderClan = player.getClan();
- if ((leaderClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis()) && (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN))
+ if ((leaderClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis()) && (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN))
{
player.sendPacket(SystemMessageId.YOU_MAY_NOT_ACCEPT_ANY_CLAN_WITHIN_A_DAY_AFTER_EXPELLING_ANOTHER_CLAN);
return false;
@@ -2138,7 +2139,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
{
@@ -2232,12 +2233,12 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
return;
}
- if ((_allyPenaltyExpiryTime > System.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
+ if ((_allyPenaltyExpiryTime > Chronos.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
return;
}
- if (_dissolvingExpiryTime > System.currentTimeMillis())
+ if (_dissolvingExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
return;
@@ -2289,7 +2290,7 @@ public class Clan implements IIdentifiable, INamable
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
{
if (clan.getId() != getId())
@@ -2315,7 +2316,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
return false;
}
- if (System.currentTimeMillis() < _dissolvingExpiryTime)
+ if (Chronos.currentTimeMillis() < _dissolvingExpiryTime)
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
return false;
@@ -2700,7 +2701,7 @@ public class Clan implements IIdentifiable, INamable
public void addMasterySkill(int id)
{
- getVariables().set(ClanVariables.CLAN_MASTERY_SKILL_TIME + id, System.currentTimeMillis() + 1296000000);
+ getVariables().set(ClanVariables.CLAN_MASTERY_SKILL_TIME + id, Chronos.currentTimeMillis() + 1296000000);
final ScheduledFuture> task = ThreadPool.schedule(() -> removeMasterySkill(id), 1296000000); // 1296000000 = 15 days
masterySkillTasks.add(task);
addNewSkill(SkillData.getInstance().getSkill(id, 1));
@@ -2719,7 +2720,7 @@ public class Clan implements IIdentifiable, INamable
{
return -1;
}
- return (int) (endTime - System.currentTimeMillis());
+ return (int) (endTime - Chronos.currentTimeMillis());
}
public void setDevelopmentPoints(int count)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/clan/ClanWar.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
index ce65694044..9641d24f79 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -54,9 +55,9 @@ public class ClanWar
{
_attackerClanId = attacker.getId();
_attackedClanId = attacked.getId();
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_state = ClanWarState.BLOOD_DECLARATION;
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
attacker.addWar(attacked.getId(), this);
attacked.addWar(attacker.getId(), this);
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
@@ -79,15 +80,15 @@ public class ClanWar
_attackerKillCount.set(attackerKillCount);
_attackedKillCount.set(attackedKillCount);
_winnerClanId = winnerClan;
- if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > System.currentTimeMillis())
+ if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > Chronos.currentTimeMillis())
{
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
}
if (_endTime > 0)
{
final long endTimePeriod = _endTime + (_state == ClanWarState.TIE ? TIME_TO_DELETION_AFTER_CANCELLATION : TIME_TO_DELETION_AFTER_DEFEAT);
- if (endTimePeriod > System.currentTimeMillis())
+ if (endTimePeriod > Chronos.currentTimeMillis())
{
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(_attackerClanId, _attackedClanId), 10000);
}
@@ -177,8 +178,8 @@ public class ClanWar
winnerClan.broadcastToOnlineMembers(sm);
_winnerClanId = winnerClan.getId();
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - Chronos.currentTimeMillis());
}
public void clanWarTimeout()
@@ -196,8 +197,8 @@ public class ClanWar
attackerClan.broadcastToOnlineMembers(sm);
_state = ClanWarState.TIE;
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - Chronos.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index f150ec3238..b1b3a83fd1 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.StatSet;
import it.sauronsoftware.cron4j.PastPredictor;
@@ -112,7 +113,7 @@ public class EventScheduler
final Predictor predictor = new Predictor(_pattern);
final long nextSchedule = predictor.nextMatchingTime();
- final long timeSchedule = nextSchedule - System.currentTimeMillis();
+ final long timeSchedule = nextSchedule - Chronos.currentTimeMillis();
if (timeSchedule <= (30 * 1000))
{
LOGGER.warning("Wrong reschedule for " + _eventManager.getClass().getSimpleName() + " end up run in " + (timeSchedule / 1000) + " seconds!");
@@ -144,10 +145,10 @@ public class EventScheduler
{
ps.setString(1, _eventManager.getName());
ps.setString(2, _name);
- ps.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(3, new Timestamp(Chronos.currentTimeMillis()));
ps.setString(4, _eventManager.getName());
ps.setString(5, _name);
- ps.setTimestamp(6, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(6, new Timestamp(Chronos.currentTimeMillis()));
ps.execute();
return true;
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/events/EventType.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/events/EventType.java
index 99875a73cf..f266ac008b 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/events/EventType.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/events/EventType.java
@@ -76,7 +76,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
@@ -84,8 +83,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaR
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemAdd;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDestroy;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDrop;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemTransfer;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
@@ -114,7 +115,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
index 77e7205bfa..6139454534 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -85,7 +86,7 @@ public class TrainingHolder implements Serializable
public long getElapsedTime()
{
- return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
+ return TimeUnit.SECONDS.convert(Chronos.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
index efd4221a12..c876f04050 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -39,6 +39,7 @@ import java.util.stream.Stream;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -105,7 +106,7 @@ public class Instance implements IIdentifiable, INamable
// Set basic instance info
_id = id;
_template = template;
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_spawns = new ArrayList<>(template.getSpawns().size());
// Clone and add the spawn templates
@@ -755,7 +756,7 @@ public class Instance implements IIdentifiable, INamable
}
// Set new cleanup task
- _endTime = System.currentTimeMillis() + millis;
+ _endTime = Chronos.currentTimeMillis() + millis;
if (minutes < 1) // Destroy instance
{
destroy();
@@ -858,7 +859,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getElapsedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
/**
@@ -867,7 +868,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getRemainingTime()
{
- return (_endTime == -1) ? -1 : (_endTime - System.currentTimeMillis());
+ return (_endTime == -1) ? -1 : (_endTime - Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
index 973dab1661..84466d8e0a 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.GroupType;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -547,7 +548,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
{
if (data.getTime() > 0)
{
- time = System.currentTimeMillis() + data.getTime();
+ time = Chronos.currentTimeMillis() + data.getTime();
break;
}
@@ -557,7 +558,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
calendar.set(Calendar.SECOND, 0);
// If calendar time is lower than current, add one more day
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
@@ -574,7 +575,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Set exact day. If modified date is before current, add one more week.
calendar.set(Calendar.DAY_OF_WEEK, day);
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.WEEK_OF_MONTH, 1);
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
index 1850d30783..07ce5a3538 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.instancezone.conditions;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -39,6 +40,6 @@ public class ConditionReenter extends Condition
protected boolean test(PlayerInstance player, Npc npc)
{
final int instanceId = getParameters().getInt("instanceId", getInstanceTemplate().getId());
- return System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
+ return Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index 8972820ba8..a976a4a7bd 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.ItemInfo;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -181,12 +182,12 @@ public class ItemAuction
public long getStartingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public long getFinishingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public void storeMe()
@@ -339,7 +340,7 @@ public class ItemAuction
_highestBid = bid;
}
- if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
+ if ((_endingTime - Chronos.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
{
switch (_auctionEndingExtendState)
{
@@ -426,7 +427,7 @@ public class ItemAuction
}
case FINISHED:
{
- if (_startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
+ if (_startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
{
return false;
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 8d81451dc9..f14581064a 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -243,7 +244,7 @@ public class ItemAuctionInstance
{
case 0:
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
case 1:
@@ -252,10 +253,10 @@ public class ItemAuctionInstance
{
case CREATED:
{
- if (auctions[0].getStartingTime() < (System.currentTimeMillis() + START_TIME_SPACE))
+ if (auctions[0].getStartingTime() < (Chronos.currentTimeMillis() + START_TIME_SPACE))
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
else
{
@@ -266,13 +267,13 @@ public class ItemAuctionInstance
case STARTED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, System.currentTimeMillis() + START_TIME_SPACE));
+ nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, Chronos.currentTimeMillis() + START_TIME_SPACE));
break;
}
case FINISHED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
default:
@@ -287,7 +288,7 @@ public class ItemAuctionInstance
{
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
// just to make sure we won't skip any auction because of little different times
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (ItemAuction auction : auctions)
{
if (auction.getAuctionState() == ItemAuctionState.STARTED)
@@ -311,7 +312,7 @@ public class ItemAuctionInstance
}
if (nextAuction == null)
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
break;
}
@@ -326,17 +327,17 @@ public class ItemAuctionInstance
{
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
}
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
}
}
@@ -422,7 +423,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -432,7 +433,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -442,7 +443,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -452,7 +453,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
}
@@ -577,7 +578,7 @@ public class ItemAuctionInstance
return null;
}
- if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
+ if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
{
LOGGER.info(getClass().getSimpleName() + ": Clearing expired auction: " + auctionId);
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
index beae6e0db1..abbe632775 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.AgathionData;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
@@ -206,7 +207,7 @@ public class ItemInstance extends WorldObject
_type2 = 0;
_dropTime = 0;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -229,7 +230,7 @@ public class ItemInstance extends WorldObject
super.setName(_item.getName());
_loc = ItemLocation.VOID;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -1583,7 +1584,7 @@ public class ItemInstance extends WorldObject
setSpawned(true);
setXYZ(x, y, z);
- setDropTime(System.currentTimeMillis());
+ setDropTime(Chronos.currentTimeMillis());
setDropperObjectId(dropper != null ? dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
// Add the ItemInstance dropped in the world as a visible object
@@ -1862,7 +1863,7 @@ public class ItemInstance extends WorldObject
public long getRemainingTime()
{
- return _time - System.currentTimeMillis();
+ return _time - Chronos.currentTimeMillis();
}
public void endOfLife()
@@ -2520,7 +2521,7 @@ public class ItemInstance extends WorldObject
if (getVisualLifeTime() > 0)
{
final long endTime = getVisualLifeTime();
- if ((endTime - System.currentTimeMillis()) > 0)
+ if ((endTime - Chronos.currentTimeMillis()) > 0)
{
ItemAppearanceTaskManager.getInstance().add(this, endTime);
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index e6e471cce5..09adeca7a9 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -21,6 +21,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
@@ -84,7 +85,7 @@ public abstract class AbstractOlympiadGame
protected boolean makeCompetitionStart()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
return !_aborted;
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 10af0d183d..a0334635fe 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
@@ -765,7 +766,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", template.getName() + " was defeated");
@@ -786,7 +787,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", castle.getName() + " Castle was successfuly taken");
@@ -800,7 +801,7 @@ public class Hero
PreparedStatement ps = con.prepareStatement("INSERT INTO heroes_diary (charId, time, action, param) values(?,?,?,?)"))
{
ps.setInt(1, charId);
- ps.setLong(2, System.currentTimeMillis());
+ ps.setLong(2, Chronos.currentTimeMillis());
ps.setInt(3, action);
ps.setInt(4, param);
ps.execute();
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index 2a54d83dc7..0427829eb2 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,6 +27,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
@@ -546,7 +547,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
String winner = "draw";
// Calculate Fight time
- final long _fightTime = (System.currentTimeMillis() - _startTime);
+ final long _fightTime = (Chronos.currentTimeMillis() - _startTime);
double playerOneHp = 0;
if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index 119e447b15..4bb2fc156e 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.handler.PunishmentHandler;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
@@ -133,7 +134,7 @@ public class PunishmentTask implements Runnable
*/
public boolean isExpired()
{
- return (_expirationTime > 0) && (System.currentTimeMillis() > _expirationTime);
+ return (_expirationTime > 0) && (Chronos.currentTimeMillis() > _expirationTime);
}
/**
@@ -149,7 +150,7 @@ public class PunishmentTask implements Runnable
onStart();
if (_expirationTime > 0) // Has expiration?
{
- _task = ThreadPool.schedule(this, (_expirationTime - System.currentTimeMillis()));
+ _task = ThreadPool.schedule(this, (_expirationTime - Chronos.currentTimeMillis()));
}
}
@@ -226,7 +227,7 @@ public class PunishmentTask implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement st = con.prepareStatement(UPDATE_QUERY))
{
- st.setLong(1, System.currentTimeMillis());
+ st.setLong(1, Chronos.currentTimeMillis());
st.setLong(2, _id);
st.execute();
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 7c2d57fdc6..2e36bece7c 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -32,6 +32,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.EventDroplist;
import org.l2jmobius.gameserver.data.ItemTable;
@@ -100,7 +101,7 @@ public class LongTimeEvent extends Quest
}
else if (_eventPeriod.getStartDate().after(new Date()))
{
- final long delay = _eventPeriod.getStartDate().getTime() - System.currentTimeMillis();
+ final long delay = _eventPeriod.getStartDate().getTime() - Chronos.currentTimeMillis();
ThreadPool.schedule(new ScheduleStart(), delay);
LOGGER.info("Event " + _eventName + " will be started at " + _eventPeriod.getStartDate());
}
@@ -323,7 +324,7 @@ public class LongTimeEvent extends Quest
}
// Add spawns.
- final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - System.currentTimeMillis();
+ final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - Chronos.currentTimeMillis();
for (NpcSpawn spawn : _spawnList)
{
addSpawn(spawn.npcId, spawn.loc.getX(), spawn.loc.getY(), spawn.loc.getZ(), spawn.loc.getHeading(), false, millisToEventEnd, false);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 1218569d81..4264d72834 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.enums.QuestType;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
@@ -785,7 +786,7 @@ public class QuestState
public boolean isNowAvailable()
{
final String val = get("restartTime");
- return (val != null) && (Long.parseLong(val) <= System.currentTimeMillis());
+ return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
public void setSimulated(boolean simulated)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
index cf665da8f8..b4d0d36648 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.SocialClass;
@@ -138,7 +139,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
final int level = rs.getInt("level");
final long expiration = rs.getLong("expiration");
final ResidenceFunction func = new ResidenceFunction(id, level, expiration, this);
- if ((expiration <= System.currentTimeMillis()) && !func.reactivate())
+ if ((expiration <= Chronos.currentTimeMillis()) && !func.reactivate())
{
removeFunction(func);
continue;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
index a292c439e5..d81d7f08af 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanHallGrade;
import org.l2jmobius.gameserver.enums.ClanHallType;
@@ -265,7 +266,7 @@ public class ClanHall extends AbstractResidence
final int failDays = getCostFailDay();
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : _paidUntil;
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - Chronos.currentTimeMillis());
}
else
{
@@ -310,7 +311,7 @@ public class ClanHall extends AbstractResidence
*/
public long getNextPayment()
{
- return (_checkPaymentTask != null) ? System.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
+ return (_checkPaymentTask != null) ? Chronos.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
}
public Location getOwnerLocation()
@@ -382,7 +383,7 @@ public class ClanHall extends AbstractResidence
{
_owner.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, _lease, null, null);
setPaidUntil(Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(7)).toEpochMilli());
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - Chronos.currentTimeMillis());
updateDB();
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
index 2fa683814d..faac3921be 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
@@ -30,6 +30,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
@@ -85,7 +86,7 @@ public class ClanHallAuction
public void addBid(Clan clan, long bid)
{
- addBid(clan, bid, System.currentTimeMillis());
+ addBid(clan, bid, Chronos.currentTimeMillis());
}
public void addBid(Clan clan, long bid, long bidTime)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index c71380874f..841d3b180c 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -20,6 +20,7 @@ import java.time.Instant;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ResidenceFunctionsData;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -63,9 +64,9 @@ public class ResidenceFunction
private void init()
{
final ResidenceFunctionTemplate template = getTemplate();
- if ((template != null) && (_expiration > System.currentTimeMillis()))
+ if ((template != null) && (_expiration > Chronos.currentTimeMillis()))
{
- _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
+ _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - Chronos.currentTimeMillis());
}
}
@@ -170,7 +171,7 @@ public class ResidenceFunction
if (wh.destroyItem("FunctionFee", item, template.getCost().getCount(), null, this) != null)
{
- _expiration = System.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
+ _expiration = Chronos.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
init();
}
return true;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
index 3a425c9b03..af7fd2e85e 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.shuttle;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Location;
/**
@@ -29,7 +30,7 @@ public class ShuttleStop
private final int _id;
private boolean _isOpen = true;
private final List _dimensions = new ArrayList<>(3);
- private long _lastDoorStatusChanges = System.currentTimeMillis();
+ private long _lastDoorStatusChanges = Chronos.currentTimeMillis();
public ShuttleStop(int id)
{
@@ -64,7 +65,7 @@ public class ShuttleStop
}
_isOpen = true;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public void closeDoor()
@@ -75,11 +76,11 @@ public class ShuttleStop
}
_isOpen = false;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public boolean hasDoorChanged()
{
- return (System.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
+ return (Chronos.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Castle.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Castle.java
index 1ee2ffa27b..41cd50499c 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Castle.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Castle.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.CastleData;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -160,7 +161,7 @@ public class Castle extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -195,7 +196,7 @@ public class Castle extends AbstractResidence
fee = _tempFee;
}
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Fort.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Fort.java
index 95839a8065..de66de79ed 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Fort.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Fort.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.FortUpdater;
import org.l2jmobius.gameserver.FortUpdater.UpdaterType;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -163,7 +164,7 @@ public class Fort extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -193,7 +194,7 @@ public class Fort extends AbstractResidence
if ((_fortOwner.getWarehouse().getAdena() >= _fee) || !_cwh)
{
final int fee = _endDate == -1 ? _tempFee : _fee;
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
@@ -580,7 +581,7 @@ public class Fort extends AbstractResidence
clan.setFortId(getResidenceId());
setOwnerClan(clan);
final int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
- long initial = System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
+ long initial = Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
while (initial > (Config.FS_UPDATE_FRQ * 60000))
{
initial -= Config.FS_UPDATE_FRQ * 60000;
@@ -786,7 +787,7 @@ public class Fort extends AbstractResidence
if (clan != null)
{
clanId = clan.getId();
- _lastOwnedTime.setTimeInMillis(System.currentTimeMillis());
+ _lastOwnedTime.setTimeInMillis(Chronos.currentTimeMillis());
}
else
{
@@ -920,12 +921,12 @@ public class Fort extends AbstractResidence
public int getOwnedTime()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
}
public int getTimeTillRebelArmy()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - System.currentTimeMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - Chronos.currentTimeMillis()) / 1000);
}
public long getTimeTillNextFortUpdate()
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Siege.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Siege.java
index 03336d2bda..107d03af95 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Siege.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/siege/Siege.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SiegeScheduleData;
import org.l2jmobius.gameserver.enums.SiegeClanType;
@@ -1434,9 +1435,9 @@ public class Siege implements Siegable
}
final Calendar calendar = _castle.getSiegeDate();
- if (calendar.getTimeInMillis() < System.currentTimeMillis())
+ if (calendar.getTimeInMillis() < Chronos.currentTimeMillis())
{
- calendar.setTimeInMillis(System.currentTimeMillis());
+ calendar.setTimeInMillis(Chronos.currentTimeMillis());
}
calendar.set(Calendar.DAY_OF_WEEK, holder.getDay());
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
index c7b80987c7..77396cff6d 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
@@ -32,10 +32,10 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
+import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
import org.l2jmobius.gameserver.model.stats.Stat;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
index c3ac06e1fc..18161a6c75 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
@@ -30,8 +30,8 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
index 5428c6f7dd..497f4e7247 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.zone.type;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -99,7 +100,7 @@ public class NoRestartZone extends ZoneType
return;
}
- if (((System.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
+ if (((Chronos.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
{
player.teleToLocation(TeleportWhereType.TOWN);
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/GameClient.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/GameClient.java
index badd7b05a1..99c66513d8 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/GameClient.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/GameClient.java
@@ -30,6 +30,7 @@ import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.ICrypt;
import org.l2jmobius.commons.network.IIncomingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -341,7 +342,7 @@ public class GameClient extends ChannelInboundHandler
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps2 = con.prepareStatement("UPDATE characters SET deletetime=? WHERE charId=?"))
{
- ps2.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ ps2.setLong(1, Chronos.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
ps2.setInt(2, objectId);
ps2.execute();
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
index bf151234da..cf2986ced6 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -81,7 +82,7 @@ public class AllyDismiss implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000), Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
leaderClan.updateClanInDB();
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
index 3d5c508a4c..7cc2fa0c1f 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class AllyLeave implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
clan.setAllyId(0);
clan.setAllyName(null);
clan.changeAllyCrest(0, true);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index ecba025eaf..be72640474 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
@@ -540,7 +541,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_RECENTLY_BEEN_DISMISSED_FROM_A_CLAN_YOU_ARE_NOT_ALLOWED_TO_JOIN_ANOTHER_CLAN_FOR_24_HR);
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
index c63a8bfcf4..854d89da8d 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.AdminTeleportType;
@@ -74,7 +75,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
player.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
index 54c3fc6029..d3dee51253 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
@@ -20,6 +20,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.enums.ItemSkillType;
@@ -126,7 +127,7 @@ public class RequestEnchantItem implements IClientIncomingPacket
}
// fast auto-enchant cheat check
- if ((request.getTimestamp() == 0) || ((System.currentTimeMillis() - request.getTimestamp()) < 2000))
+ if ((request.getTimestamp() == 0) || ((Chronos.currentTimeMillis() - request.getTimestamp()) < 2000))
{
Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " use autoenchant program ", Config.DEFAULT_PUNISH);
player.removeRequest(request.getClass());
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
index b8a07b77e8..bad73f8c28 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -82,7 +83,7 @@ public class RequestExAddEnchantScrollItem implements IClientIncomingPacket
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantScrollItemResult(_scrollObjectId));
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
index db4db5e742..b004d448e0 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -55,7 +56,7 @@ public class RequestExRemoveEnchantSupportItem implements IClientIncomingPacket
request.setSupportItem(PlayerInstance.ID_NONE);
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(ExRemoveEnchantSupportItemResult.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
index 92018f3a8d..035cf151b6 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -69,7 +70,7 @@ public class RequestExSetPledgeCrestLarge implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
index c9e0cf1be8..7a2a1c706a 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -85,7 +86,7 @@ public class RequestExTryToPutEnchantSupportItem implements IClientIncomingPacke
}
request.setSupportItem(support.getObjectId());
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantSupportItemResult(_supportObjectId));
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
index cdf3996711..4b04a3965e 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -76,7 +77,7 @@ public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
}
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
client.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
index 715be58f93..cd86a6542c 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -69,7 +70,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
{
if (_isJoining == 1)
{
- if (System.currentTimeMillis() < clan.getDissolvingExpiryTime())
+ if (Chronos.currentTimeMillis() < clan.getDissolvingExpiryTime())
{
client.sendPacket(SystemMessageId.YOUR_CLAN_MAY_NOT_REGISTER_TO_PARTICIPATE_IN_A_SIEGE_WHILE_UNDER_A_GRACE_PERIOD_OF_THE_CLAN_S_DISSOLUTION);
return;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
index 1e78964e1b..e31721fdce 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.BoatManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.instance.BoatInstance;
@@ -61,7 +62,7 @@ public class RequestMoveToLocationInVehicle implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
client.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
index cdde62edef..ae22c5feea 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
@@ -80,8 +81,8 @@ public class RequestOustPledgeMember implements IClientIncomingPacket
}
// this also updates the database
- clan.removeClanMember(member.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
- clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(member.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setCharPenaltyExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_BEEN_DISMISSED);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
index 0bf1ebf5ec..a61cc79835 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
@@ -22,6 +22,7 @@ import java.sql.SQLException;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -68,7 +69,7 @@ public class RequestPetitionFeedback implements IClientIncomingPacket
statement.setString(2, player.getLastPetitionGmName());
statement.setInt(3, _rate);
statement.setString(4, _message);
- statement.setLong(5, System.currentTimeMillis());
+ statement.setLong(5, Chronos.currentTimeMillis());
statement.execute();
}
catch (SQLException e)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
index ba7a5bab88..0a24a0e492 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanLevelData;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.ClanEntryManager;
@@ -63,12 +64,12 @@ public class RequestPledgeSignInForOpenJoiningMethod implements IClientIncomingP
final Clan clan = pledgeRecruitInfo.getClan();
if ((clan != null) && (player.getClan() == null))
{
- if (clan.getCharPenaltyExpiryTime() > System.currentTimeMillis())
+ if (clan.getCharPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return;
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 30e0b1b097..9c606fc9fe 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -34,8 +34,8 @@ import org.l2jmobius.gameserver.model.quest.Event;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.network.GameClient;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
index d415106f6a..d21279f5be 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -74,7 +75,7 @@ public class RequestSetPledgeCrest implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
index 16f6b732ba..f1d9597133 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.enums.UserInfoType;
@@ -101,7 +102,7 @@ public class RequestStartPledgeWar implements IClientIncomingPacket
client.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
- else if (clanDeclaredWar.getDissolvingExpiryTime() > System.currentTimeMillis())
+ else if (clanDeclaredWar.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(new SystemMessage(SystemMessageId.A_CLAN_WAR_CAN_NOT_BE_DECLARED_AGAINST_A_CLAN_THAT_IS_BEING_DISSOLVED));
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
index 5fdcb9b32f..60793f38b5 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class RequestWithdrawalPledge implements IClientIncomingPacket
}
final Clan clan = player.getClan();
- clan.removeClanMember(player.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(player.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
index f0127be6a7..e8c4a648d3 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlEvent;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.NextAction;
@@ -255,7 +256,7 @@ public class UseItem implements IClientIncomingPacket
else if (player.isAttackingNow())
{
// Equip or unEquip.
- ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
+ ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
index aef68ac971..96ce901338 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.appearance;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.enums.InventorySlot;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -252,7 +253,7 @@ public class RequestShapeShiftingItem implements IClientIncomingPacket
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getLifeTime() > 0))
{
- targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, System.currentTimeMillis() + appearanceStone.getLifeTime());
+ targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, Chronos.currentTimeMillis() + appearanceStone.getLifeTime());
targetItem.scheduleVisualLifeTime();
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
index cb3337644b..5f0fe775e5 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,9 +119,9 @@ public class ConfirmMenteeAdd implements IClientIncomingPacket
mentor.sendPacket(SystemMessageId.YOU_MUST_AWAKEN_IN_ORDER_TO_BECOME_A_MENTOR);
return false;
}
- else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > System.currentTimeMillis())
+ else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > Chronos.currentTimeMillis())
{
- long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - System.currentTimeMillis()) / 1000;
+ long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - Chronos.currentTimeMillis()) / 1000;
final int days = (int) (remainingTime / 86400);
remainingTime = remainingTime % 86400;
final int hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
index e06cd9048d..1e8aba6d16 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
@@ -119,7 +120,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
index f6702caa41..9c076a29a5 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.enums.MailType;
@@ -140,7 +141,7 @@ public class RequestBRPresentBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
index c3faad961a..138ed60513 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.training;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.TrainingHolder;
import org.l2jmobius.gameserver.network.GameClient;
@@ -52,7 +53,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
if (holder.isTraining())
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
@@ -60,7 +61,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
player.setImmobilized(false);
player.teleToLocation(player.getLastLocation());
player.sendPacket(ExTrainingZone_Leaving.STATIC_PACKET);
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
index ee1c787150..3f1213f2ee 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.loginserverpackets.game;
import org.l2jmobius.commons.network.BaseSendablePacket;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author mrTJO
@@ -28,7 +29,7 @@ public class TempBan extends BaseSendablePacket
writeC(0x0A);
writeS(accountName);
writeS(ip);
- writeQ(System.currentTimeMillis() + (time * 60000));
+ writeQ(Chronos.currentTimeMillis() + (time * 60000));
// if (reason != null)
// {
// writeC(0x01);
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
index 240707de09..0bcc780208 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
@@ -256,7 +257,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP
packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP
- packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
+ packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0);
packet.writeD(charInfoPackage.getClassId());
packet.writeD(i == _activeId ? 1 : 0);
@@ -351,7 +352,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
// See if the char must be deleted
final long deletetime = chardata.getLong("deletetime");
- if ((deletetime > 0) && (System.currentTimeMillis() > deletetime))
+ if ((deletetime > 0) && (Chronos.currentTimeMillis() > deletetime))
{
final Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
if (clan != null)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
index 57dd77c3f1..6cbf9639e3 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
@@ -53,7 +54,7 @@ public class ExInzoneWaiting implements IClientOutgoingPacket
packet.writeD(_instanceTimes.size());
for (Entry entry : _instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
index a40690e845..6f7b5f8735 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MatchingRoomManager;
@@ -73,7 +74,7 @@ public class ExListPartyMatchingWaitingRoom implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
index d455d825fd..5921d44781 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MatchingMemberType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -61,7 +62,7 @@ public class ExPartyRoomMember implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
index 3656ddbc4e..ab85228caf 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MailType;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
@@ -45,7 +46,7 @@ public class ExShowReceivedPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_RECEIVED_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_inbox != null) && !_inbox.isEmpty())
{
packet.writeD(_inbox.size());
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
index 2ae09181a7..db4bccc928 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -40,7 +41,7 @@ public class ExShowSentPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_SENT_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_outbox != null) && !_outbox.isEmpty())
{
packet.writeD(_outbox.size());
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
index db2091ad54..4403da53fe 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.items.Henna;
import org.l2jmobius.gameserver.model.stats.BaseStat;
@@ -73,7 +74,7 @@ public class HennaInfo implements IClientOutgoingPacket
int duration = premium.getDuration();
if (duration > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
duration = (int) Math.max(0, _player.getVariables().getLong("HennaDuration4", currentTime) - currentTime) / 1000;
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
index 5ed678042b..caed96260b 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -88,7 +89,7 @@ public class SiegeInfo implements IClientOutgoingPacket
packet.writeS(""); // Ally Name
}
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if (!_castle.isTimeRegistrationOver() && _player.isClanLeader() && (_player.getClanId() == _castle.getOwnerId()))
{
final Calendar cal = Calendar.getInstance();
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
index 5871334785..c6de3ccd8b 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.TimeStamp;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -36,7 +37,7 @@ public class SkillCoolTime implements IClientOutgoingPacket
public SkillCoolTime(PlayerInstance player)
{
- _currentTime = System.currentTimeMillis();
+ _currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : player.getSkillReuseTimeStamps().values())
{
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel()).isNotBroadcastable())
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
index 74955d8a26..2ffa34919b 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets.friend;
import java.util.Calendar;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -39,7 +40,7 @@ public class ExFriendDetailInfo implements IClientOutgoingPacket
_objectId = player.getObjectId();
_name = name;
_friend = World.getInstance().getPlayer(_name);
- _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) System.currentTimeMillis() : (int) (System.currentTimeMillis() - _friend.getLastAccess()) / 1000;
+ _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) Chronos.currentTimeMillis() : (int) (Chronos.currentTimeMillis() - _friend.getLastAccess()) / 1000;
}
@Override
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/scripting/ManagedScript.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
index 00235baa25..9d206480d8 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
@@ -20,6 +20,8 @@ import java.nio.file.Path;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* Abstract class for classes that are meant to be implemented by scripts.
* @author KenM
@@ -35,7 +37,7 @@ public abstract class ManagedScript
public ManagedScript()
{
_scriptFile = getScriptPath();
- setLastLoadTime(System.currentTimeMillis());
+ setLastLoadTime(Chronos.currentTimeMillis());
}
public abstract Path getScriptPath();
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9c8c4bb5dd..b5a2e04233 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -54,7 +55,7 @@ public class AttackStanceTaskManager
}
_working = true;
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
try
{
final Iterator> iterator = _attackStanceTasks.entrySet().iterator();
@@ -105,7 +106,7 @@ public class AttackStanceTaskManager
return;
}
- _attackStanceTasks.put(creature, System.currentTimeMillis());
+ _attackStanceTasks.put(creature, Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
index 8ab6c99d28..d56e0b8a23 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.buylist.Product;
/**
@@ -45,7 +46,7 @@ public class BuyListTaskManager
}
_workingProducts = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : PRODUCTS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 8b4a7db319..f8218055f3 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@@ -44,7 +45,7 @@ public class DecayTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -87,7 +88,7 @@ public class DecayTaskManager
}
// Add to decay schedules.
- DECAY_SCHEDULES.put(creature, System.currentTimeMillis() + (delay * 1000));
+ DECAY_SCHEDULES.put(creature, Chronos.currentTimeMillis() + (delay * 1000));
}
/**
@@ -107,7 +108,7 @@ public class DecayTaskManager
public long getRemainingTime(Creature creature)
{
final Long time = DECAY_SCHEDULES.get(creature);
- return time != null ? time.longValue() - System.currentTimeMillis() : Long.MAX_VALUE;
+ return time != null ? time.longValue() - Chronos.currentTimeMillis() : Long.MAX_VALUE;
}
@Override
@@ -122,7 +123,7 @@ public class DecayTaskManager
ret.append("Tasks dump:");
ret.append(Config.EOL);
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
ret.append("Class/Name: ");
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
index c3834ecbb9..e0f823bef4 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemAppearanceTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
index 27f0273802..de10959db8 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemLifeTimeTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 396633692c..160debb492 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -42,7 +43,7 @@ public class ItemManaTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
@@ -61,7 +62,7 @@ public class ItemManaTaskManager
{
if (!ITEMS.containsKey(item))
{
- ITEMS.put(item, System.currentTimeMillis() + MANA_CONSUMPTION_RATE);
+ ITEMS.put(item, Chronos.currentTimeMillis() + MANA_CONSUMPTION_RATE);
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
index eb0dd7a59f..a2f0dc5563 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.model.World;
@@ -48,7 +49,7 @@ public class MessageDeletionTaskManager
Integer msgId;
Message msg;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_MESSAGES.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
index 2f270649fb..82483a498a 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PlayerAutoSaveTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SEARCH: for (Entry entry : PLAYER_TIMES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -63,7 +64,7 @@ public class PlayerAutoSaveTaskManager
public void add(PlayerInstance player)
{
- PLAYER_TIMES.put(player, System.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
+ PLAYER_TIMES.put(player, Chronos.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
}
public void remove(PlayerInstance player)
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
index 6a406a9591..3a812e2fcb 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PvpFlagTaskManager
if (!PLAYERS.isEmpty())
{
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (PlayerInstance player : PLAYERS)
{
if (time > player.getPvpFlagLasts())
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
index 5473f21a8f..b8135996f8 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -43,7 +44,7 @@ public class RandomAnimationTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_ANIMATIONS.entrySet())
{
if (time > entry.getValue().longValue())
@@ -65,7 +66,7 @@ public class RandomAnimationTaskManager
{
if (npc.hasRandomAnimation())
{
- PENDING_ANIMATIONS.putIfAbsent(npc, System.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
+ PENDING_ANIMATIONS.putIfAbsent(npc, Chronos.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
index 8e8e818908..debb0d68e6 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Spawn;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -42,7 +43,7 @@ public class RespawnTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_RESPAWNS.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
index 990efb8b45..d1946b860a 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -36,6 +36,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskBirthday;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskRecom;
@@ -94,7 +95,7 @@ public class TaskManager
public void run()
{
task.onTimeElapsed(this);
- lastActivation = System.currentTimeMillis();
+ lastActivation = Chronos.currentTimeMillis();
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement statement = con.prepareStatement(SQL_STATEMENTS[1]))
{
@@ -242,7 +243,7 @@ public class TaskManager
try
{
final Date desired = DateFormat.getInstance().parse(task.getParams()[0]);
- final long diff = desired.getTime() - System.currentTimeMillis();
+ final long diff = desired.getTime() - Chronos.currentTimeMillis();
if (diff >= 0)
{
task.scheduled = ThreadPool.schedule(task, diff);
@@ -293,7 +294,7 @@ public class TaskManager
return false;
}
- delay = min.getTimeInMillis() - System.currentTimeMillis();
+ delay = min.getTimeInMillis() - Chronos.currentTimeMillis();
if (check.after(min) || (delay < 0))
{
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ui/SystemPanel.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ui/SystemPanel.java
index 8c01c1f8fe..a19a873bfe 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ui/SystemPanel.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ui/SystemPanel.java
@@ -31,6 +31,7 @@ import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.util.Locator;
@@ -42,7 +43,7 @@ public class SystemPanel extends JPanel
{
protected static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
- protected static final long START_TIME = System.currentTimeMillis();
+ protected static final long START_TIME = Chronos.currentTimeMillis();
public SystemPanel()
{
@@ -136,7 +137,7 @@ public class SystemPanel extends JPanel
lblConnected.setText("Connected: " + playerCount);
lblMaxConnected.setText("Max connected: " + World.MAX_CONNECTED_COUNT);
lblOfflineShops.setText("Offline trade: " + World.OFFLINE_TRADE_COUNT);
- lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - START_TIME));
+ lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(Chronos.currentTimeMillis() - START_TIME));
}
}, 1000, 1000);
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
index ec95816f82..cc8059f91a 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.PlayerCondOverride;
@@ -151,7 +152,7 @@ public class FloodProtectorAction
*/
private void banAccount()
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
if (LOGGER.isLoggable(Level.WARNING))
{
log(" banned for flooding ", _config.PUNISHMENT_TIME <= 0 ? "forever" : "for " + (_config.PUNISHMENT_TIME / 60000) + " mins");
@@ -171,7 +172,7 @@ public class FloodProtectorAction
final int charId = _client.getPlayer().getObjectId();
if (charId > 0)
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
}
if (LOGGER.isLoggable(Level.WARNING))
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
index e5912dd51b..d6580161c7 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World;
@@ -143,7 +144,7 @@ public class OfflineTradeUtil
if (player.getOfflineStartTime() == 0)
{
- player.setOfflineStartTime(System.currentTimeMillis());
+ player.setOfflineStartTime(Chronos.currentTimeMillis());
}
// Store trade on exit, if realtime saving is enabled.
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/FloodProtectedListener.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/FloodProtectedListener.java
index ba2fc6536a..e2bbcc1aa3 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/FloodProtectedListener.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/FloodProtectedListener.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author -Wooden-
@@ -63,9 +64,9 @@ public abstract class FloodProtectedListener extends Thread
if (fConnection != null)
{
fConnection.connectionNumber += 1;
- if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((System.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((System.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
+ if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
{
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
connection.close();
fConnection.connectionNumber -= 1;
if (!fConnection.isFlooding)
@@ -80,11 +81,11 @@ public abstract class FloodProtectedListener extends Thread
fConnection.isFlooding = false;
LOGGER.info(connection.getInetAddress().getHostAddress() + " is not considered as flooding anymore.");
}
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
}
else
{
- fConnection = new ForeignConnection(System.currentTimeMillis());
+ fConnection = new ForeignConnection(Chronos.currentTimeMillis());
_floodProtection.put(connection.getInetAddress().getHostAddress(), fConnection);
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/LoginController.java
index 189b90e2ee..9d382c646b 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/LoginController.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/LoginController.java
@@ -41,6 +41,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.GameServerTable.GameServerInfo;
@@ -176,7 +177,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(USER_INFO_SELECT))
{
- ps.setString(1, Long.toString(System.currentTimeMillis()));
+ ps.setString(1, Long.toString(Chronos.currentTimeMillis()));
ps.setString(2, login);
try (ResultSet rset = ps.executeQuery())
{
@@ -208,7 +209,7 @@ public class LoginController
{
ps.setString(1, login);
ps.setString(2, hashBase64);
- ps.setLong(3, System.currentTimeMillis());
+ ps.setLong(3, Chronos.currentTimeMillis());
ps.setInt(4, 0);
ps.setString(5, addr.getHostAddress());
ps.execute();
@@ -273,7 +274,7 @@ public class LoginController
*/
public void addBanForAddress(InetAddress address, long duration)
{
- _bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
+ _bannedIps.putIfAbsent(address, Chronos.currentTimeMillis() + duration);
}
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
@@ -294,7 +295,7 @@ public class LoginController
}
if (bi != null)
{
- if ((bi > 0) && (bi < System.currentTimeMillis()))
+ if ((bi > 0) && (bi < Chronos.currentTimeMillis()))
{
_bannedIps.remove(address);
LOGGER.info("Removed expired ip address ban " + address.getHostAddress() + ".");
@@ -541,7 +542,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(ACCOUNT_INFO_UPDATE))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.setString(2, address.getHostAddress());
ps.setString(3, info.getLogin());
ps.execute();
@@ -613,7 +614,7 @@ public class LoginController
{
continue;
}
- if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < System.currentTimeMillis())
+ if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < Chronos.currentTimeMillis())
{
client.close(LoginFailReason.REASON_ACCESS_FAILED);
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/network/LoginClient.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/network/LoginClient.java
index 04455664e2..93194a11c0 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/network/LoginClient.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/network/LoginClient.java
@@ -27,6 +27,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.IIncomingPacket;
import org.l2jmobius.commons.network.IOutgoingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.LoginController;
@@ -82,14 +83,14 @@ public class LoginClient extends ChannelInboundHandler
_addr = address.getAddress();
_channel = ctx.channel();
_sessionId = Rnd.nextInt();
- _connectionStartTime = System.currentTimeMillis();
+ _connectionStartTime = Chronos.currentTimeMillis();
sendPacket(new Init(_scrambledPair.getScrambledModulus(), _blowfishKey.getEncoded(), _sessionId));
}
@Override
public void channelInactive(ChannelHandlerContext ctx)
{
- if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < System.currentTimeMillis()))
+ if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < Chronos.currentTimeMillis()))
{
LoginController.getInstance().removeAuthedLoginClient(getAccount());
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
index 801bc957ae..875759b72a 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
@@ -24,6 +24,8 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* IPv4 filter.
* @author Forsaiken
@@ -59,7 +61,7 @@ public class IPv4Filter implements Runnable
Flood()
{
- lastAccess = System.currentTimeMillis();
+ lastAccess = Chronos.currentTimeMillis();
trys = 0;
}
}
@@ -74,7 +76,7 @@ public class IPv4Filter implements Runnable
}
final int h = hash(addr.getAddress());
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
Flood f;
synchronized (_ipFloodMap)
{
@@ -120,7 +122,7 @@ public class IPv4Filter implements Runnable
{
while (true)
{
- final long reference = System.currentTimeMillis() - (1000 * 300);
+ final long reference = Chronos.currentTimeMillis() - (1000 * 300);
synchronized (_ipFloodMap)
{
final Iterator> it = _ipFloodMap.entrySet().iterator();
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
index e66362d6c0..86b46f1919 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.model.Location;
@@ -137,7 +138,7 @@ public class Parade extends AbstractNpcAI
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
- LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
+ LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
}
void load()
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
index c91b42bb26..7757d82c61 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -304,7 +305,7 @@ public class TalentShow extends AbstractNpcAI
hourDiff *= 3600000;
minDiff *= 60000;
diff = hourDiff + minDiff;
- LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
+ LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
startQuestTimer("Start", diff, null, null); // first start
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
index 940193f4fc..32c8b9f9f1 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
@@ -16,6 +16,7 @@
*/
package ai.areas.GainakUnderground.Lailly;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -64,7 +65,7 @@ public class Lailly extends AbstractNpcAI
case "okay":
{
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
- if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis()))
+ if ((instance != null) && (instance.getEndTime() > Chronos.currentTimeMillis()))
{
switch (instance.getTemplateId())
{
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
index 9118e046f7..60cfac5c02 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
@@ -29,6 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -516,7 +517,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
final GlobalVariablesManager vars = GlobalVariablesManager.getInstance();
final long var = vars.getLong("FourSepulchers" + npcId, 0) + (TIME_ATTACK * 60 * 1000);
- if (var > System.currentTimeMillis())
+ if (var > Chronos.currentTimeMillis())
{
showHtmlFile(player, npcId + "-NE.html", npc, null);
return;
@@ -581,7 +582,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
ThreadPool.schedule(() -> ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers(), TIME_ATTACK * 60 * 1000);
// Save attack time
- vars.set("FourSepulchers" + npcId, System.currentTimeMillis());
+ vars.set("FourSepulchers" + npcId, Chronos.currentTimeMillis());
// Init progress
STORED_PROGRESS.put(sepulcherId, 1); // start from 1
// Start
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
index 244867b7c6..ded5cf9a43 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
@@ -19,6 +19,7 @@ package ai.areas.KeucereusAllianceBase;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
@@ -109,7 +110,7 @@ public class LindviorScene extends AbstractNpcAI
final GregorianCalendar date = new GregorianCalendar();
date.set(Calendar.MINUTE, RESET_MIN);
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
- if (System.currentTimeMillis() >= date.getTimeInMillis())
+ if (Chronos.currentTimeMillis() >= date.getTimeInMillis())
{
date.add(Calendar.DAY_OF_WEEK, 1);
}
@@ -135,7 +136,7 @@ public class LindviorScene extends AbstractNpcAI
{
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
}
- return date.getTimeInMillis() - System.currentTimeMillis();
+ return date.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
index 80dffe38b2..de8ea0aea9 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
@@ -19,6 +19,7 @@ package ai.areas.Rune.RuneCastle.Venom;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -111,7 +112,7 @@ public class Venom extends AbstractNpcAI
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
index a7d7250e8b..c42186c0d0 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -229,7 +230,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
int buffsNow = 0;
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
- if (var < System.currentTimeMillis())
+ if (var < Chronos.currentTimeMillis())
{
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
@@ -254,7 +255,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
reenter.set(Calendar.MINUTE, 0);
reenter.set(Calendar.HOUR_OF_DAY, 13);
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
- if (reenter.getTimeInMillis() <= System.currentTimeMillis())
+ if (reenter.getTimeInMillis() <= Chronos.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 7);
}
@@ -272,7 +273,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
}
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
private void spawnGroupOfMinion(MonsterInstance npc, int[] mobIds)
@@ -317,7 +318,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
zone.clearSkills();
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
else if (event.equalsIgnoreCase("transform"))
{
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
index e004e80b3d..8044c58bf3 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -345,7 +346,7 @@ public class Anakim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ANAKIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_anakim", time, null, null);
@@ -373,7 +374,7 @@ public class Anakim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(ANAKIM, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -550,7 +551,7 @@ public class Anakim extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_anakimStatus == WAITING) && (npc.getId() == ANAKIM_CUBIC))
@@ -578,7 +579,7 @@ public class Anakim extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid())// Anakim and minions
{
// Anti BUGGERS
@@ -614,7 +615,7 @@ public class Anakim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ANAKIM, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(ANAKIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ANAKIM, info);
startQuestTimer("unlock_anakim", respawnTime, null, null);
@@ -686,7 +687,7 @@ public class Anakim extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
index 4a77fb6bfd..fe808aef25 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.MountType;
@@ -169,14 +170,14 @@ public class Antharas extends AbstractNpcAI
_antharas = (GrandBossInstance) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
_antharas.setCurrentHpMp(curr_hp, curr_mp);
addBoss(_antharas);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
break;
}
case DEAD:
{
- final long remain = respawnTime - System.currentTimeMillis();
+ final long remain = respawnTime - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -272,7 +273,7 @@ public class Antharas extends AbstractNpcAI
_antharas.setRandomWalking(false);
_antharas.teleToLocation(181323, 114850, -7623, 32542);
setStatus(IN_FIGHT);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
zone.broadcastPacket(new PlaySound("BS02_A"));
startQuestTimer("CAMERA_1", 23, _antharas, null);
break;
@@ -367,7 +368,7 @@ public class Antharas extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 900000) < Chronos.currentTimeMillis()))
{
setStatus(ALIVE);
for (Creature creature : zone.getCharactersInside())
@@ -619,7 +620,7 @@ public class Antharas extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BOMBER)
{
if (npc.calculateDistance3D(attacker) < 230)
@@ -765,7 +766,7 @@ public class Antharas extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
+ GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
}
private final void refreshAiParams(PlayerInstance attacker, int damage)
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Baium/Baium.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Baium/Baium.java
index faca4576a8..44b37b992a 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Baium/Baium.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Baium/Baium.java
@@ -17,6 +17,7 @@
package ai.bosses.Baium;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.CategoryType;
@@ -136,7 +137,7 @@ public class Baium extends AbstractNpcAI
final int heading = info.getInt("heading");
_baium = (GrandBossInstance) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
_baium.setCurrentHpMp(curr_hp, curr_mp);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
addBoss(_baium);
for (Location loc : ARCHANGEL_LOC)
@@ -149,7 +150,7 @@ public class Baium extends AbstractNpcAI
}
case DEAD:
{
- final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -209,7 +210,7 @@ public class Baium extends AbstractNpcAI
_baium.disableCoreAI(true);
_baium.setRandomWalking(false);
addBoss(_baium);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
@@ -375,7 +376,7 @@ public class Baium extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
{
notifyEvent("CLEAR_ZONE", null, null);
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
@@ -383,7 +384,7 @@ public class Baium extends AbstractNpcAI
}
else if (npc != null)
{
- if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
+ if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
{
npc.setTarget(npc);
npc.doCast(HEAL_OF_BAIUM.getSkill());
@@ -484,7 +485,7 @@ public class Baium extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BAIUM)
{
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
@@ -663,7 +664,7 @@ public class Baium extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
+ GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
}
private void manageSkills(Npc npc)
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
index aa8528926d..dfce75d90b 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -108,7 +109,7 @@ public class Beleth extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("BELETH_UNLOCK", time, null, null);
@@ -349,7 +350,7 @@ public class Beleth extends AbstractNpcAI
c.setImmobilized(false);
}
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, null, null);
startQuestTimer("SPAWN25", 60000, null, null);
break;
@@ -507,7 +508,7 @@ public class Beleth extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((_lastAttack + 900000) < System.currentTimeMillis())
+ if ((_lastAttack + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -708,7 +709,7 @@ public class Beleth extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(REAL_BELETH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
deleteAll();
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Core/Core.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Core/Core.java
index 969bb08788..69dc20dc5d 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Core/Core.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Core/Core.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -89,7 +90,7 @@ public class Core extends AbstractNpcAI
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
@@ -206,7 +207,7 @@ public class Core extends AbstractNpcAI
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
index 5570d66bbc..2357d9625e 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -331,7 +332,7 @@ public class EtisVanEtina extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ETIS_VAN_ETINA1);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_etina", time, null, null);
@@ -359,7 +360,7 @@ public class EtisVanEtina extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
if (GrandBossManager.getInstance().getBossStatus(ETIS_VAN_ETINA1) != ALIVE)
{
@@ -514,7 +515,7 @@ public class EtisVanEtina extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
// Anti BUGGERS
if (!BOSS_ZONE.isInsideZone(attacker))
{
@@ -697,7 +698,7 @@ public class EtisVanEtina extends AbstractNpcAI
_paragon.setInvul(true);
BOSS_ZONE.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_CAN_T_DEFEAT_PARAGON_WHILE_PARAGON_S_MINIONS_ARE_ALIVE, ExShowScreenMessage.TOP_CENTER, 7000, true)));
GrandBossManager.getInstance().setBossStatus(ETIS_VAN_ETINA1, FIGHTING);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
}
}
@@ -738,7 +739,7 @@ public class EtisVanEtina extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ETIS_VAN_ETINA1, DEAD);
final long respawnTime = (Config.ETINA_SPAWN_INTERVAL + getRandom(-Config.ETINA_SPAWN_RANDOM, Config.ETINA_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(ETIS_VAN_ETINA1);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ETIS_VAN_ETINA1, info);
startQuestTimer("unlock_etina", respawnTime, null, null);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
index 3ed92d8f08..b499a47575 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.MountType;
@@ -295,7 +296,7 @@ public class IceQueensCastleBattle extends AbstractInstance
{
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
- controller.getVariables().set("TIMER_END", System.currentTimeMillis() + 360000);
+ controller.getVariables().set("TIMER_END", Chronos.currentTimeMillis() + 360000);
}
break;
}
@@ -688,7 +689,7 @@ public class IceQueensCastleBattle extends AbstractInstance
}
case "SHOW_GLAKIAS_TIMER":
{
- final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - System.currentTimeMillis()) / 1000);
+ final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - Chronos.currentTimeMillis()) / 1000);
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
break;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
index acbc2c3094..6023594423 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
@@ -23,6 +23,7 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -143,11 +144,11 @@ public class ScarletVanHalisha extends AbstractNpcAI
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
}
@@ -248,7 +249,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
case FRINTEZZA_DAEMON_MORPH:
case FRINTEZZA_DAEMON_FIELD:
{
- _lastRangedSkillTime = System.currentTimeMillis();
+ _lastRangedSkillTime = Chronos.currentTimeMillis();
skillRange = 550;
break;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Helios/Helios.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Helios/Helios.java
index af4d5b4e8e..7e5c37bf69 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Helios/Helios.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Helios/Helios.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +151,7 @@ public class Helios extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(HELIOS3);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_helios", time, null, null);
@@ -496,7 +497,7 @@ public class Helios extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(HELIOS3, DEAD);
final long respawnTime = (Config.HELIOS_SPAWN_INTERVAL + getRandom(-Config.HELIOS_SPAWN_RANDOM, Config.HELIOS_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(HELIOS3);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(HELIOS3, info);
startQuestTimer("unlock_helios", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
index 81fd9ae6e8..9c32d36ecf 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.Movie;
@@ -121,7 +122,7 @@ public class Kelbim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(KELBIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_kelbim", time, null, null);
@@ -156,7 +157,7 @@ public class Kelbim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(KELBIM, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -193,7 +194,7 @@ public class Kelbim extends AbstractNpcAI
{
_kelbimBoss = (GrandBossInstance) addSpawn(KELBIM, -56340, 60801, -269, 54262, false, 0);
GrandBossManager.getInstance().addBoss(_kelbimBoss);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
startQuestTimer("stage_all_random_area_attack", Rnd.get(2, 3) * 60000, null, null);
break;
@@ -369,7 +370,7 @@ public class Kelbim extends AbstractNpcAI
{
if (npc.getId() == KELBIM)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
switch (_bossStage)
{
@@ -434,7 +435,7 @@ public class Kelbim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(KELBIM, DEAD);
final long respawnTime = (Config.KELBIM_SPAWN_INTERVAL + getRandom(-Config.KELBIM_SPAWN_RANDOM, Config.KELBIM_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(KELBIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(KELBIM, info);
startQuestTimer("unlock_kelbim", respawnTime, null, null);
startQuestTimer("end_kelbim", 1800000, null, null);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
index 62507c9762..510a8060de 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -371,7 +372,7 @@ public class Lilith extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LILITH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lilith", time, null, null);
@@ -399,7 +400,7 @@ public class Lilith extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(LILITH, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -576,7 +577,7 @@ public class Lilith extends AbstractNpcAI
}
_remnants.clear();
notifyEvent("spawn_remant", null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
}
else if ((_lilithStatus == WAITING) && (npc.getId() == LILITH_CUBIC))
@@ -594,7 +595,7 @@ public class Lilith extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid()) // Lilith and minions
{
// Anti BUGGERS
@@ -630,7 +631,7 @@ public class Lilith extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LILITH, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(LILITH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LILITH, info);
startQuestTimer("unlock_lilith", respawnTime, null, null);
@@ -702,7 +703,7 @@ public class Lilith extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
@Override
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
index 6b02643bc0..63811284a1 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -213,7 +214,7 @@ public class Lindvior extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lindvior", time, null, null);
@@ -863,7 +864,7 @@ public class Lindvior extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
final long respawnTime = (Config.LINDVIOR_SPAWN_INTERVAL + getRandom(-Config.LINDVIOR_SPAWN_RANDOM, Config.LINDVIOR_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
startQuestTimer("unlock_lindvior", respawnTime, null, null);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
index 8f5d996e6c..5108b80c03 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -88,7 +89,7 @@ public class Orfen extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for Orfen from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if Orfen is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -309,7 +310,7 @@ public class Orfen extends AbstractNpcAI
startQuestTimer("orfen_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ORFEN, info);
cancelQuestTimer("check_minion_loc", npc, null);
startQuestTimer("despawn_minions", 20000, null, null);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index f2869a3fe9..c00a82fb97 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -96,7 +97,7 @@ public class QueenAnt extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for queen ant from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if queen ant is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -367,7 +368,7 @@ public class QueenAnt extends AbstractNpcAI
cancelQuestTimer("heal", null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(QUEEN, info);
_nurses.clear();
_larva.deleteMe();
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
index eda49595a1..fd26faf27c 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.QueenShyeed;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -87,7 +88,7 @@ public class QueenShyeed extends AbstractNpcAI
private void spawnShyeed()
{
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
- final long remain = respawn != 0 ? respawn - System.currentTimeMillis() : 0;
+ final long remain = respawn != 0 ? respawn - Chronos.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("respawn", remain, null, null);
@@ -103,7 +104,7 @@ public class QueenShyeed extends AbstractNpcAI
private void startRespawn()
{
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
- GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(System.currentTimeMillis() + respawnTime));
+ GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(Chronos.currentTimeMillis() + respawnTime));
startQuestTimer("respawn", respawnTime, null, null);
// MOB_BUFF_ZONE.setEnabled(false);
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
index e6cd81dbf4..b02a51942f 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -137,7 +138,7 @@ public class Ramona extends AbstractNpcAI
addAttackId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3);
addSpawnId(RAMONA_1, RAMONA_2, RAMONA_3);
- final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - System.currentTimeMillis();
+ final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - Chronos.currentTimeMillis();
if (temp > 0)
{
_boss = Status.DEAD;
@@ -167,7 +168,7 @@ public class Ramona extends AbstractNpcAI
npc.setInvul(false);
cancelQuestTimers("SPAWN_MS");
startQuestTimer("CHECK_ACTIVITY_TASK", 5000, null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
}
break;
}
@@ -186,7 +187,7 @@ public class Ramona extends AbstractNpcAI
startQuestTimer("GENERATOR_2", getRandom(900000, 1200000), null, null);
startQuestTimer("GENERATOR_3", getRandom(1500000, 1800000), null, null);
startQuestTimer("GENERATOR_4", getRandom(2100000, 2400000), null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("RAMONA1_SKILL", 6000, _ramona1, null);
break;
}
@@ -300,7 +301,7 @@ public class Ramona extends AbstractNpcAI
}
case "CHECK_ACTIVITY_TASK":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
for (Creature creature : ZONE.getCharactersInside())
{
@@ -396,17 +397,17 @@ public class Ramona extends AbstractNpcAI
}
case RAMONA_1:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
@@ -540,7 +541,7 @@ public class Ramona extends AbstractNpcAI
{
_boss = Status.DEAD;
final long respawnTime = (Config.RAMONA_SPAWN_INTERVAL + getRandom(-Config.RAMONA_SPAWN_RANDOM, Config.RAMONA_SPAWN_RANDOM)) * 3600000;
- GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, Chronos.currentTimeMillis() + respawnTime);
startQuestTimer("RAMONA_UNLOCK", respawnTime, null, null);
startQuestTimer("END_RAMONA", 90000, null, null);
break;
@@ -568,13 +569,13 @@ public class Ramona extends AbstractNpcAI
case RAMONA_1:
{
_boss = Status.IN_FIGHT;
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
index 4d4eb8653a..be58208558 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.Sailren;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -71,7 +72,7 @@ public class Sailren extends AbstractNpcAI
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
- final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
+ final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - Chronos.currentTimeMillis();
if (remain > 0)
{
STATUS = Status.DEAD;
@@ -118,7 +119,7 @@ public class Sailren extends AbstractNpcAI
{
takeItems(player, GAZKH, 1);
STATUS = Status.IN_FIGHT;
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
for (PlayerInstance member : player.getParty().getMembers())
{
if (member.isInsideRadius3D(npc, 1000))
@@ -237,7 +238,7 @@ public class Sailren extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
+ if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < Chronos.currentTimeMillis()))
{
cancelQuestTimer("TIME_OUT", null, null);
notifyEvent("TIME_OUT", null, null);
@@ -257,7 +258,7 @@ public class Sailren extends AbstractNpcAI
{
if (zone.isCharacterInZone(attacker))
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -274,7 +275,7 @@ public class Sailren extends AbstractNpcAI
STATUS = Status.DEAD;
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
final long respawnTime = RESPAWN * 3600000;
- GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set("SailrenRespawn", Chronos.currentTimeMillis() + respawnTime);
cancelQuestTimer("CHECK_ATTACK", null, null);
cancelQuestTimer("TIME_OUT", null, null);
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
index 0c824fd3b2..523f53e898 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -326,7 +327,7 @@ public class Trasken extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_trasken", time, null, null);
@@ -604,7 +605,7 @@ public class Trasken extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
startQuestTimer("unlock_trasken", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
index 94d29e346e..c8e0f497af 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.MountType;
@@ -129,7 +130,7 @@ public class Valakas extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for valakas from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (temp > 0)
{
// The time has not yet expired. Mark Valakas as currently locked (dead).
@@ -168,7 +169,7 @@ public class Valakas extends AbstractNpcAI
if (status == FIGHTING)
{
// stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
startQuestTimer("regen_task", 60000, valakas, null, true);
startQuestTimer("skill_task", 2000, valakas, null, true);
@@ -196,7 +197,7 @@ public class Valakas extends AbstractNpcAI
if (event.equalsIgnoreCase("beginning"))
{
// Stores current time
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
// Teleport Valakas to his lair.
npc.teleToLocation(VALAKAS_LAIR);
@@ -220,7 +221,7 @@ public class Valakas extends AbstractNpcAI
else if (event.equalsIgnoreCase("regen_task"))
{
// Inactivity task - 15min
- if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
+ if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < Chronos.currentTimeMillis()))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
@@ -416,7 +417,7 @@ public class Valakas extends AbstractNpcAI
npc.setTarget(attacker);
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
}
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -447,7 +448,7 @@ public class Valakas extends AbstractNpcAI
startQuestTimer("valakas_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
return super.onKill(npc, killer, isSummon);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
index ddc6ff9e74..40bd1cf6c2 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
@@ -46,8 +46,8 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcManorBypass;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.teleporter.TeleportHolder;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index 7278c7327f..e1575721d3 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -26,6 +26,7 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -153,7 +154,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -189,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
@@ -247,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
@@ -296,7 +297,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0]");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
sb.append(" | ");
sb.append(auction.getHighestBid());
sb.append(" | ");
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
index f469c39159..2362aa9446 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -21,6 +21,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.Location;
@@ -73,7 +74,7 @@ public class ProvisionalHalls extends AbstractNpcAI
if (resetTime > 0)
{
cancelQuestTimers(HALL_RESET_VAR + id);
- startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
}
}
}
@@ -126,7 +127,7 @@ public class ProvisionalHalls extends AbstractNpcAI
for (int id : CLAN_HALLS.keySet())
{
- if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < Chronos.currentTimeMillis()))
{
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
@@ -137,7 +138,7 @@ public class ProvisionalHalls extends AbstractNpcAI
clanHall.setOwner(player.getClan());
}
player.sendMessage("Congratulations! You now own a provisional clan hall!");
- startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
return null;
}
}
@@ -177,7 +178,7 @@ public class ProvisionalHalls extends AbstractNpcAI
else if (event.startsWith(HALL_RESET_VAR))
{
final String id = event.replace(HALL_RESET_VAR, "");
- if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
{
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
if (clanId > 0)
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index 18f813b1a2..a3c74220a9 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -19,6 +19,7 @@ package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -111,7 +112,7 @@ public class TrainingCamp extends AbstractNpcAI
player.teleToLocation(TRAINING_LOCATION);
player.setImmobilized(true);
// @Sdw: Here we are supposed to send ExUserInfoEquipSlot with a fake equip of a SLS, feels ugly to me, not doing it.
- player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
+ player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), Chronos.currentTimeMillis(), -1));
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
@@ -203,7 +204,7 @@ public class TrainingCamp extends AbstractNpcAI
final TrainingHolder holder = player.getTraingCampInfo();
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
index 49dfa6b963..6140daa716 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
@@ -16,6 +16,7 @@
*/
package events.FreyaCelebration;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -79,7 +80,7 @@ public class FreyaCelebration extends LongTimeEvent
{
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
if (currentTime > reuseTime)
{
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
index cce5b52533..d97b3c74db 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
@@ -16,6 +16,7 @@
*/
package events.GiftOfVitality;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -94,9 +95,9 @@ public class GiftOfVitality extends LongTimeEvent
case "vitality":
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -110,7 +111,7 @@ public class GiftOfVitality extends LongTimeEvent
{
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
htmltext = "4306-okvitality.htm";
}
break;
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/HappyHours/HappyHours.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/HappyHours/HappyHours.java
index 536ed53fe2..2d3261f1c3 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/HappyHours/HappyHours.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/HappyHours/HappyHours.java
@@ -16,6 +16,7 @@
*/
package events.HappyHours;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -39,7 +40,7 @@ public class HappyHours extends LongTimeEvent
// Other
private static final int MIN_LEVEL = 20;
private static final int REWARD_INTERVAL = 60 * 60 * 1000; // 1 hour
- private static long _lastRewardTime = System.currentTimeMillis();
+ private static long _lastRewardTime = Chronos.currentTimeMillis();
private HappyHours()
{
@@ -76,9 +77,9 @@ public class HappyHours extends LongTimeEvent
{
if (isEventPeriod())
{
- if ((System.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
+ if ((Chronos.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
{
- _lastRewardTime = System.currentTimeMillis();
+ _lastRewardTime = Chronos.currentTimeMillis();
final ExShowScreenMessage screenMsg = new ExShowScreenMessage("You obtained 20 Sibi's coins.", ExShowScreenMessage.TOP_CENTER, 7000, 0, true, true);
final SystemMessage systemMsg = new SystemMessage(SystemMessageId.YOU_HAVE_OBTAINED_S1_SIBI_S_COINS);
systemMsg.addInt(20);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
index 038d7883b0..7fb3b481dd 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
@@ -16,6 +16,7 @@
*/
package events.LoveYourGatekeeper;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -58,9 +59,9 @@ public class LoveYourGatekeeper extends LongTimeEvent
if (player.getAdena() >= PRICE)
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -73,7 +74,7 @@ public class LoveYourGatekeeper extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, PRICE);
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
}
}
else
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
index f7d34dfccd..6615d3e9c8 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
@@ -16,6 +16,7 @@
*/
package events.MasterOfEnchanting;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -86,7 +87,7 @@ public class MasterOfEnchanting extends LongTimeEvent
}
else if (event.equalsIgnoreCase("buy_scroll_24"))
{
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
final String value = player.getVariables().getString("MasterOfEnchanting", "");
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
@@ -100,7 +101,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
@@ -134,7 +135,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/SavingSanta/SavingSanta.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
index 4f95514f8c..b6900127dc 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -324,7 +325,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_rewardedPlayers.containsKey(pl.getAccountName()))
{
- final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
+ final long elapsedTimeSinceLastRewarded = Chronos.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
{
continue;
@@ -333,7 +334,7 @@ public class SavingSanta extends LongTimeEvent
else
{
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
- if ((System.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
+ if ((Chronos.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
{
_rewardedPlayers.put(pl.getAccountName(), time);
continue;
@@ -343,8 +344,8 @@ public class SavingSanta extends LongTimeEvent
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
- _rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
- player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
+ _rewardedPlayers.put(pl.getAccountName(), Chronos.currentTimeMillis());
+ player.getVariables().set("LAST_SANTA_REWARD", Chronos.currentTimeMillis());
startQuestTimer("SantaRewarding0", 500, santa, pl);
}
}
@@ -437,7 +438,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
{
startQuestTimer("SantaBlessings", 15000, null, null);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Npc santaHelper1 : _santaHelpers)
{
for (PlayerInstance plb : World.getInstance().getVisibleObjects(santaHelper1, PlayerInstance.class))
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
index 64d4112e1f..729838d853 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Collection;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.CursedWeapon;
@@ -209,7 +210,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
}
- cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
+ cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
cw.reActivate();
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
index 9801093a20..0e4285c8e3 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Calendar;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -66,7 +67,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
{
final Calendar nextChangeDate = Calendar.getInstance();
- nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
+ nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
html.replace("%sodtime%", nextChangeDate.getTime().toString());
}
else
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
index 72117290b3..6855d75da1 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.World;
@@ -117,7 +118,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
int hours = 0;
int minutes = 0;
final int id = entry.getKey();
- final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
if (remainingTime > 0)
{
hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
index 5fffc77ae3..8c3faede2d 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -233,7 +234,7 @@ public class AdminPunishment implements IAdminCommandHandler
long expirationTime = Integer.parseInt(exp);
if (expirationTime > 0)
{
- expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
+ expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
}
final PunishmentAffect affect = PunishmentAffect.getByName(af);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
index aa1d6dd435..ae1bb4e0b2 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -60,7 +61,7 @@ public class AdminServerInfo implements IAdminCommandHandler
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
- html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
+ html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
html.replace("%serverUpTime%", getServerUpTime());
html.replace("%onlineAll%", getPlayersCount("ALL"));
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
@@ -76,7 +77,7 @@ public class AdminServerInfo implements IAdminCommandHandler
private String getServerUpTime()
{
- long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
+ long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
final long days = TimeUnit.MILLISECONDS.toDays(time);
time -= TimeUnit.DAYS.toMillis(days);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
index ff3b82a10f..21489c89f6 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IBypassHandler;
@@ -133,7 +134,7 @@ public class FindPvP implements IBypassHandler
player.setSpawnProtection(true);
if (!player.isGM())
{
- player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
player.startPvPFlag();
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
index a81161c50a..adb3c27701 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.dailymissionhandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -61,9 +62,9 @@ public class LoginMonthDailyMissionHandler extends AbstractDailyMissionHandler
final long lastCompleted = entry.getLastCompleted();
if (lastCompleted == 0) // Initial entry.
{
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
}
- else if ((System.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
+ else if ((Chronos.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
index 9fee9dd50e..0322107487 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
@@ -18,6 +18,7 @@ package handlers.dailymissionhandlers;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -63,7 +64,7 @@ public class LoginWeekendDailyMissionHandler extends AbstractDailyMissionHandler
final int currentDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
final long lastCompleted = entry.getLastCompleted();
if (((currentDay == Calendar.SATURDAY) || (currentDay == Calendar.SUNDAY)) // Reward only on weekend.
- && ((lastCompleted == 0) || ((System.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
+ && ((lastCompleted == 0) || ((Chronos.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
index 71928b144a..c2ea6f7a5a 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.punishmenthandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.model.World;
@@ -126,7 +127,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 245af11bfa..2abbe8e8e8 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -17,6 +17,7 @@
package handlers.punishmenthandlers;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
@@ -180,7 +181,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
index 3dd1cdc97d..fd92c92ed9 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Ban implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
index f653561c0d..85b92a163b 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class BanChat implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
index cf3736fc0e..c21718ad0c 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Jail implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
index 43b6df41dc..a57194664d 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
@@ -18,6 +18,7 @@ package handlers.usercommandhandlers;
import java.text.SimpleDateFormat;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -46,7 +47,7 @@ public class ClanPenalty implements IUserCommandHandler
final StringBuilder htmlContent = new StringBuilder(500);
htmlContent.append("");
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append("Unable to join a clan. | ");
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
@@ -54,7 +55,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append(" | Unable to create a clan. | ");
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
@@ -62,7 +63,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
+ if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
{
htmlContent.append(" | Unable to invite a clan member. | ");
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/usercommandhandlers/Time.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
index 530047a4f2..57bd48cd81 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Time implements IUserCommandHandler
player.sendPacket(sm);
if (Config.DISPLAY_SERVER_TIME)
{
- player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
+ player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
}
return true;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
index a2eab150c7..f727b3518f 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
@@ -18,6 +18,7 @@ package handlers.voicedcommandhandlers;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
@@ -103,7 +104,7 @@ public class ChatAdmin implements IVoicedCommandHandler
return false;
}
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
if (expirationTime > 0)
{
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
index 213e03e20a..5bf36c47d0 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
@@ -19,6 +19,7 @@ package handlers.voicedcommandhandlers;
import java.text.SimpleDateFormat;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Premium implements IVoicedCommandHandler
html.append(" |
Spoil Chance: x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " |
");
html.append("Spoil Amount: x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " |
");
html.append("Expires: " + format.format(endDate) + " |
");
- html.append("Current Date: " + format.format(System.currentTimeMillis()) + "
|
");
+ html.append("Current Date: " + format.format(Chronos.currentTimeMillis()) + "
|
");
html.append("Premium Info & Rules
|
");
html.append("1. Premium accounts CAN NOT BE TRANSFERED. |
");
html.append("2. Premium does not effect party members. |
");
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
index 4dedee6473..6a07191990 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -156,7 +157,7 @@ public class CastleDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -174,7 +175,7 @@ public class CastleDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
index 686b01379b..ea8ca11b83 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -169,7 +170,7 @@ public class FortressDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -197,7 +198,7 @@ public class FortressDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
index 298c540332..cba8d2bb56 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
@@ -469,7 +470,7 @@ public class Kamaloka extends AbstractInstance
continue;
}
// if found instance still can't be reentered - exit
- if (System.currentTimeMillis() < entry.getValue().longValue())
+ if (Chronos.currentTimeMillis() < entry.getValue().longValue())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
sm.addPcName(partyMember);
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
index b3de2f227a..31fa72d28c 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
@@ -260,7 +261,7 @@ public class PailakaRuneCastle extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first wave
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
}
@@ -280,7 +281,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
@@ -309,7 +310,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/Chronos.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/Chronos.java
new file mode 100644
index 0000000000..a4d15f77e5
--- /dev/null
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/Chronos.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2021 Pantelis Andrianakis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.l2jmobius.commons.util;
+
+/**
+ * Chronos updates an internal long value with System.currentTimeMillis() approximately every 1 millisecond.
+ * To get the current time in milliseconds use Chronos.currentTimeMillis()
+ * @author Pantelis Andrianakis
+ * @version February 3rd 2021
+ */
+public class Chronos extends Thread
+{
+ private long _currentTimeMillis = System.currentTimeMillis();
+
+ public Chronos()
+ {
+ super.setName("Chronos");
+ super.setPriority(MAX_PRIORITY);
+ super.setDaemon(true);
+ super.start();
+ }
+
+ @Override
+ public void run()
+ {
+ while (true)
+ {
+ _currentTimeMillis = System.currentTimeMillis();
+
+ // Sleep for approximately 1 millisecond.
+ try
+ {
+ Thread.sleep(1);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /**
+ * Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond,the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
+ *
+ * See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).
+ * @return the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+ */
+ public static long currentTimeMillis()
+ {
+ return getInstance()._currentTimeMillis;
+ }
+
+ public static Chronos getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final Chronos INSTANCE = new Chronos();
+ }
+}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java
index a4c436a915..cac91bf103 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java
@@ -32,6 +32,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.enums.ServerMode;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.DeadLockDetector;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.BotReportTable;
@@ -182,7 +183,7 @@ public class GameServer
public GameServer() throws Exception
{
- final long serverLoadStart = System.currentTimeMillis();
+ final long serverLoadStart = Chronos.currentTimeMillis();
// GUI
if (!GraphicsEnvironment.isHeadless())
@@ -465,7 +466,7 @@ public class GameServer
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
- LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
+ LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
ClientNetworkManager.getInstance().start();
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameTimeController.java
index aa4d359090..48391b466d 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameTimeController.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange;
@@ -97,7 +98,7 @@ public class GameTimeController extends Thread
*/
public int getGameTicks()
{
- return (int) ((System.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
+ return (int) ((Chronos.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
}
/**
@@ -155,7 +156,7 @@ public class GameTimeController extends Thread
while (true)
{
- nextTickTime = ((System.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
+ nextTickTime = ((Chronos.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
try
{
@@ -166,7 +167,7 @@ public class GameTimeController extends Thread
LOGGER.log(Level.WARNING, getClass().getSimpleName(), e);
}
- sleepTime = nextTickTime - System.currentTimeMillis();
+ sleepTime = nextTickTime - Chronos.currentTimeMillis();
if (sleepTime > 0)
{
try
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
index 2fcae24603..cfb16ebb07 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -42,7 +43,7 @@ public class ItemsAutoDestroy
public synchronized void addItem(ItemInstance item)
{
- item.setDropTime(System.currentTimeMillis());
+ item.setDropTime(Chronos.currentTimeMillis());
_items.add(item);
}
@@ -53,7 +54,7 @@ public class ItemsAutoDestroy
return;
}
- final long curtime = System.currentTimeMillis();
+ final long curtime = Chronos.currentTimeMillis();
final Iterator itemIterator = _items.iterator();
while (itemIterator.hasNext())
{
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/Shutdown.java
index 5279bac36d..d7328247aa 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/Shutdown.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseBackup;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
@@ -529,19 +530,19 @@ public class Shutdown extends Thread
protected void restartCounter()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
}
protected long getEstimatedTimeAndRestartCounter()
{
- final long toReturn = System.currentTimeMillis() - _startTime;
+ final long toReturn = Chronos.currentTimeMillis() - _startTime;
restartCounter();
return toReturn;
}
protected long getEstimatedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/CreatureAI.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/CreatureAI.java
index 22de59f51a..e03e0463be 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/CreatureAI.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/CreatureAI.java
@@ -33,6 +33,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -308,7 +309,7 @@ public class CreatureAI extends AbstractAI
if (_actor.isAttackingNow())
{
- ThreadPool.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(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index fa5cca3384..26734231aa 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -39,7 +40,7 @@ public class WarehouseCacheManager
public void addCacheTask(PlayerInstance pc)
{
- CACHED_WH.put(pc, System.currentTimeMillis());
+ CACHED_WH.put(pc, Chronos.currentTimeMillis());
}
public void remCacheTask(PlayerInstance pc)
@@ -56,7 +57,7 @@ public class WarehouseCacheManager
@Override
public void run()
{
- final long cTime = System.currentTimeMillis();
+ final long cTime = Chronos.currentTimeMillis();
for (Entry entry : CACHED_WH.entrySet())
{
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/BotReportTable.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/BotReportTable.java
index 0e2f9777b7..46e025bd3d 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/BotReportTable.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/BotReportTable.java
@@ -39,6 +39,7 @@ import org.xml.sax.helpers.DefaultHandler;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -124,7 +125,7 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() < c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() < c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
}
@@ -290,7 +291,7 @@ public class BotReportTable
return false;
}
- final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
+ final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
@@ -301,7 +302,7 @@ public class BotReportTable
}
}
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
if (rcd == null)
{
rcd = new ReportedCharData();
@@ -418,12 +419,12 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() > c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() > c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
}
- ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
+ ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - Chronos.currentTimeMillis());
}
catch (Exception e)
{
@@ -464,7 +465,7 @@ public class BotReportTable
{
if (map.containsKey(objectId))
{
- return (System.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
+ return (Chronos.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
}
return true;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/sql/ClanTable.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
index 4e4da8df06..10f7e0b311 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.enums.ClanWarState;
@@ -171,7 +172,7 @@ public class ClanTable
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
return null;
}
- if (System.currentTimeMillis() < player.getClanCreateExpiryTime())
+ if (Chronos.currentTimeMillis() < player.getClanCreateExpiryTime())
{
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
return null;
@@ -346,7 +347,7 @@ public class ClanTable
{
destroyClan(clanId);
}
- }, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
+ }, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
}
public boolean isAllyExists(String allyName)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index 49b0381c91..c3ab796fbf 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World;
@@ -185,7 +186,7 @@ public class OfflineTraderTable
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- if (cal.getTimeInMillis() <= System.currentTimeMillis())
+ if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
{
continue;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
index 771af1a0a5..8f51b3f599 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.enums.SpecialItemType;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -114,7 +115,7 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
final DailyMissionPlayerEntry entry = getPlayerEntry(player.getObjectId(), true);
entry.setStatus(DailyMissionStatus.COMPLETED);
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
entry.setRecentlyCompleted(true);
storePlayerEntry(entry);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
index 025c3208e6..ecb5b8dc95 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.enums.PlayerAction;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -115,7 +116,7 @@ public class AdminCommandHandler implements IHandler
{
- final long begin = System.currentTimeMillis();
+ final long begin = Chronos.currentTimeMillis();
try
{
if (Config.GMAUDIT)
@@ -133,7 +134,7 @@ public class AdminCommandHandler implements IHandler 5000)
{
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
index fedf7cd9dc..ee7642eca5 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -48,7 +49,7 @@ public class AntiFeedManager
*/
public void setLastDeathTime(int objectId)
{
- _lastDeathTimes.put(objectId, System.currentTimeMillis());
+ _lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
}
/**
@@ -81,7 +82,7 @@ public class AntiFeedManager
return false;
}
- if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
+ if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((Chronos.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
{
return false;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index 3d8c1f50e4..301806d976 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ManorMode;
@@ -276,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
- ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
+ ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
}
public void changeMode()
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
index 4a91b5c214..64143c7c65 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.model.CursedWeapon;
import org.l2jmobius.gameserver.model.actor.Attackable;
@@ -313,7 +314,7 @@ public class CursedWeaponsManager implements IXmlReader
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING);
sm.addString(cw.getName());
// sm.addItemName(cw.getItemId());
- sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
+ sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
player.sendPacket(sm);
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index 72602e0968..babf2e1476 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -193,7 +194,7 @@ public class DBSpawnManager
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
- final long respawnTime = System.currentTimeMillis() + respawnDelay;
+ final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
info.set("currentHP", npc.getMaxHp());
info.set("currentMP", npc.getMaxMp());
info.set("respawnTime", respawnTime);
@@ -235,7 +236,7 @@ public class DBSpawnManager
}
final int npcId = spawn.getId();
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SpawnTable.getInstance().addNewSpawn(spawn, false);
if ((respawnTime == 0) || (time > respawnTime))
{
@@ -257,7 +258,7 @@ public class DBSpawnManager
}
else
{
- final long spawnTime = respawnTime - System.currentTimeMillis();
+ final long spawnTime = respawnTime - Chronos.currentTimeMillis();
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index 60a818cab6..06cce0d3a3 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -21,6 +21,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -104,7 +105,7 @@ public class GraciaSeedsManager
case 2:
{
// Conquest Complete state, if too much time is passed than change to defense state
- final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
+ final long timePast = Chronos.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
if (timePast >= Config.SOD_STAGE_2_LENGTH)
{
// change to Attack state because Defend statet is not implemented
@@ -172,7 +173,7 @@ public class GraciaSeedsManager
public void setSoDState(int value, boolean doSave)
{
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
- _SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
+ _SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
_SoDState = value;
// reset number of Tiat kills
if (_SoDState == 1)
@@ -198,7 +199,7 @@ public class GraciaSeedsManager
}
case 2:
{
- return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
+ return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
}
case 3:
{
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index d595a5befa..052f8984d2 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.util.PrimeFinder;
/**
@@ -85,7 +86,7 @@ public class IdManager
try (Connection con = DatabaseFactory.getConnection();
Statement statement = con.createStatement())
{
- final long cleanupStart = System.currentTimeMillis();
+ final long cleanupStart = Chronos.currentTimeMillis();
int cleanCount = 0;
// Characters
@@ -157,7 +158,7 @@ public class IdManager
statement.executeUpdate("UPDATE characters SET clanid=0, clan_privs=0, wantspeace=0, subpledge=0, lvl_joined_academy=0, apprentice=0, sponsor=0, clan_join_expiry_time=0, clan_create_expiry_time=0 WHERE characters.clanid > 0 AND characters.clanid NOT IN (SELECT clan_id FROM clan_data);");
statement.executeUpdate("UPDATE fort SET owner=0 WHERE owner NOT IN (SELECT clan_id FROM clan_data);");
- LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((System.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
+ LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((Chronos.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
}
catch (Exception e)
{
@@ -173,7 +174,7 @@ public class IdManager
{
try (PreparedStatement statement = con.prepareStatement(line))
{
- statement.setLong(1, System.currentTimeMillis());
+ statement.setLong(1, Chronos.currentTimeMillis());
cleanCount += statement.executeUpdate();
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
index d47e436ace..d1f8cd35e2 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
@@ -40,6 +40,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.data.xml.SpawnData;
@@ -521,7 +522,7 @@ public class InstanceManager implements IXmlReader
{
// Check if instance penalty passed
final long time = rs.getLong("time");
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
// Load params
final int charId = rs.getInt("charId");
@@ -556,7 +557,7 @@ public class InstanceManager implements IXmlReader
final List invalidPenalty = new ArrayList<>(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- if (entry.getValue() <= System.currentTimeMillis())
+ if (entry.getValue() <= Chronos.currentTimeMillis())
{
invalidPenalty.add(entry.getKey());
}
@@ -615,7 +616,7 @@ public class InstanceManager implements IXmlReader
// If reenter time is higher then current, delete it
final long time = playerData.get(id);
- if (time <= System.currentTimeMillis())
+ if (time <= Chronos.currentTimeMillis())
{
deleteInstanceTime(player, id);
return -1;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 739f67e9a9..dfb4734ca5 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -83,7 +84,7 @@ public class ItemsOnGroundManager implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(str))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.execute();
}
catch (Exception e)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
index df45860d40..d429a2f8c9 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Mentee;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -145,7 +146,7 @@ public class MentorManager
{
final PlayerInstance player = World.getInstance().getPlayer(mentorId);
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
- vars.set("Mentor-Penalty-" + mentorId, String.valueOf(System.currentTimeMillis() + penalty));
+ vars.set("Mentor-Penalty-" + mentorId, String.valueOf(Chronos.currentTimeMillis() + penalty));
}
public long getMentorPenalty(int mentorId)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
index b6c44953b1..80bfff5fdb 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.Containers;
@@ -79,7 +80,7 @@ public class PremiumManager
final PlayerInstance player = event.getPlayer();
final String accountName = player.getAccountName();
loadPremiumData(accountName);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
final long premiumExpiration = getPremiumExpiration(accountName);
player.setPremiumStatus(premiumExpiration > now);
if (player.hasPremiumStatus())
@@ -153,7 +154,7 @@ public class PremiumManager
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
{
final long addTime = timeUnit.toMillis(timeValue);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
// new premium task at least from now
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
final long newPremiumExpiration = oldPremiumExpiration + addTime;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
index 9617f26e43..08193f9c5b 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
@@ -71,7 +72,7 @@ public class PunishmentManager
final String punishedBy = rset.getString("punishedBy");
if ((type != null) && (affect != null))
{
- if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
+ if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
{
expired++;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
index 687d1288b9..ab73056bb1 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -424,7 +425,7 @@ public class BlockChecker
// Start up player parameters
setUpPlayers();
// Set the started time
- _startedTime = System.currentTimeMillis() + 300000;
+ _startedTime = Chronos.currentTimeMillis() + 300000;
}
}
@@ -524,7 +525,7 @@ public class BlockChecker
_redPoints += _numOfBoxes / 2;
_bluePoints += _numOfBoxes / 2;
- final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((_startedTime - Chronos.currentTimeMillis()) / 1000);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
_holder.broadCastPacketToTeam(changePoints);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/CursedWeapon.java
index 9d28f739b9..e8356c8e45 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/CursedWeapon.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
@@ -237,7 +238,7 @@ public class CursedWeapon implements INamable
@Override
public void run()
{
- if (System.currentTimeMillis() >= _endTime)
+ if (Chronos.currentTimeMillis() >= _endTime)
{
endOfLife();
}
@@ -366,7 +367,7 @@ public class CursedWeapon implements INamable
public void reActivate()
{
_isActivated = true;
- if ((_endTime - System.currentTimeMillis()) <= 0)
+ if ((_endTime - Chronos.currentTimeMillis()) <= 0)
{
endOfLife();
}
@@ -384,7 +385,7 @@ public class CursedWeapon implements INamable
dropIt(attackable, player);
// Start the Life Task
- _endTime = System.currentTimeMillis() + (_duration * 60000);
+ _endTime = Chronos.currentTimeMillis() + (_duration * 60000);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
return true;
}
@@ -678,7 +679,7 @@ public class CursedWeapon implements INamable
public long getTimeLeft()
{
- return _endTime - System.currentTimeMillis();
+ return _endTime - Chronos.currentTimeMillis();
}
public void goTo(PlayerInstance player)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/ItemInfo.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/ItemInfo.java
index 9ea4c13763..16f3dfe23e 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/ItemInfo.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/ItemInfo.java
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.model.buylist.Product;
import org.l2jmobius.gameserver.model.ensoul.EnsoulOption;
@@ -151,14 +152,14 @@ public class ItemInfo
_soulCrystalOptions = item.getSpecialAbilities();
_soulCrystalSpecialOptions = item.getAdditionalSpecialAbilities();
_visualId = item.getVisualId();
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(ItemInstance item, int change)
{
this(item);
_change = change;
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(TradeItem item)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Message.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Message.java
index e6b1c31d32..53d2f20768 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Message.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Message.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.enums.MailType;
@@ -104,7 +105,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = text;
- _expiration = (isCod ? System.currentTimeMillis() + (COD_EXPIRATION * 3600000) : System.currentTimeMillis() + (EXPIRATION * 3600000));
+ _expiration = (isCod ? Chronos.currentTimeMillis() + (COD_EXPIRATION * 3600000) : Chronos.currentTimeMillis() + (EXPIRATION * 3600000));
_hasAttachments = false;
_unread = true;
_deletedBySender = false;
@@ -123,7 +124,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_reqAdena = 0;
_hasAttachments = false;
_unread = true;
@@ -143,7 +144,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_hasAttachments = false;
_unread = true;
_deletedBySender = true;
@@ -162,7 +163,7 @@ public class Message
_receiverId = msg.getSenderId();
_subject = "";
_content = "";
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_deletedByReceiver = false;
@@ -182,7 +183,7 @@ public class Message
_receiverId = receiverId;
_subject = "";
_content = item.getName();
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_messageType = mailType;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Petition.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Petition.java
index b19b6f9025..d3f95461ac 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Petition.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Petition.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PetitionState;
import org.l2jmobius.gameserver.enums.PetitionType;
import org.l2jmobius.gameserver.instancemanager.IdManager;
@@ -36,7 +37,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class Petition
{
- private final long _submitTime = System.currentTimeMillis();
+ private final long _submitTime = Chronos.currentTimeMillis();
private final int _id;
private final PetitionType _type;
private PetitionState _state = PetitionState.PENDING;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Spawn.java
index 4a1a2926b3..eb57e4e69b 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -258,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
_scheduledCount++;
// Schedule the next respawn.
- RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
+ RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/TimeStamp.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/TimeStamp.java
index 8c232969e0..9bdb39d293 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/TimeStamp.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/TimeStamp.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -52,7 +53,7 @@ public class TimeStamp
_id2 = skill.getLevel();
_id3 = skill.getSubLevel();
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = -1;
}
@@ -68,7 +69,7 @@ public class TimeStamp
_id2 = item.getObjectId();
_id3 = 0;
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = item.getSharedReuseGroup();
}
@@ -155,7 +156,7 @@ public class TimeStamp
{
return 0;
}
- final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
+ final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
if (remainingTime == 0)
{
_stamp = 0;
@@ -173,7 +174,7 @@ public class TimeStamp
{
return false;
}
- final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
+ final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
if (!hasNotPassed)
{
_stamp = 0;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java
index 134a095206..43fe92a776 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.AttackableAI;
import org.l2jmobius.gameserver.ai.CreatureAI;
@@ -215,7 +216,7 @@ public class Attackable extends Npc
if (_firstCommandChannelAttacked != null)
{
_commandChannelTimer = new CommandChannelTimer(this);
- _commandChannelLastAttack = System.currentTimeMillis();
+ _commandChannelLastAttack = Chronos.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
@@ -224,7 +225,7 @@ public class Attackable extends Npc
}
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
{
- _commandChannelLastAttack = System.currentTimeMillis(); // update last attack time
+ _commandChannelLastAttack = Chronos.currentTimeMillis(); // update last attack time
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 321f95d137..c44bdcf809 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -41,6 +41,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.EmptyQueue;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -1393,7 +1394,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : _reuseTimeStampsItems.values())
{
if (ts.getSharedReuseGroup() == group)
@@ -1523,7 +1524,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return;
}
- _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? System.currentTimeMillis() + delay : Long.MAX_VALUE);
+ _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? Chronos.currentTimeMillis() + delay : Long.MAX_VALUE);
}
/**
@@ -1571,7 +1572,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return false;
}
- if (stamp < System.currentTimeMillis())
+ if (stamp < Chronos.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java
index 62f1d1049f..d288fe8816 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -203,7 +204,7 @@ public class Npc extends Creature
public void onRandomAnimation(int animationId)
{
// Send a packet SocialAction to all PlayerInstance in the _KnownPlayers of the NpcInstance
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
{
_lastSocialBroadcast = now;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
index 7eacda4aa1..c87a2006a9 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.actor.instance;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
@@ -141,7 +142,7 @@ public class BlockInstance extends MonsterInstance
{
eng.increasePlayerPoints(player, team);
- final int timeLeft = (int) ((eng.getStarterTime() - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((eng.getStarterTime() - Chronos.currentTimeMillis()) / 1000);
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints());
final ExCubeGameExtendedChangePoints secretPoints = new ExCubeGameExtendedChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints(), isRed, player, eng.getPlayerPoints(player, isRed));
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index a6bf20c463..43459a3658 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -45,6 +45,7 @@ import java.util.stream.Collectors;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -2829,7 +2830,7 @@ public class PlayerInstance extends Playable
public void setOnlineTime(long time)
{
_onlineTime = time;
- _onlineBeginTime = System.currentTimeMillis();
+ _onlineBeginTime = Chronos.currentTimeMillis();
}
/**
@@ -3874,22 +3875,22 @@ public class PlayerInstance extends Playable
public boolean isSpawnProtected()
{
- return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
+ return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
}
public boolean isTeleportProtected()
{
- return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
+ return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
}
public void setSpawnProtection(boolean protect)
{
- _spawnProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
+ _spawnProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
}
public void setTeleportProtection(boolean protect)
{
- _teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
+ _teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
}
/**
@@ -5215,7 +5216,7 @@ public class PlayerInstance extends Playable
{
return;
}
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
if (_pvpFlag == 0)
{
startPvPFlag();
@@ -5248,11 +5249,11 @@ public class PlayerInstance extends Playable
{
if (checkIfPvP(targetPlayer))
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
}
else
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
}
if (_pvpFlag == 0)
{
@@ -6129,7 +6130,7 @@ public class PlayerInstance extends Playable
public long getUptime()
{
- return System.currentTimeMillis() - _uptime;
+ return Chronos.currentTimeMillis() - _uptime;
}
/**
@@ -6373,7 +6374,7 @@ public class PlayerInstance extends Playable
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
{
statement.setInt(1, isOnlineInt());
- statement.setLong(2, System.currentTimeMillis());
+ statement.setLong(2, Chronos.currentTimeMillis());
statement.setInt(3, getObjectId());
statement.execute();
}
@@ -6499,12 +6500,12 @@ public class PlayerInstance extends Playable
}
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
- if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanJoinExpiryTime(0);
}
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
- if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanCreateExpiryTime(0);
}
@@ -6566,7 +6567,7 @@ public class PlayerInstance extends Playable
player.getAppearance().setTitleColor(titleColor);
}
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
- player.setUptime(System.currentTimeMillis());
+ player.setUptime(Chronos.currentTimeMillis());
currentHp = rset.getDouble("curHp");
currentCp = rset.getDouble("curCp");
@@ -7082,7 +7083,7 @@ public class PlayerInstance extends Playable
long totalOnlineTime = _onlineTime;
if (_onlineBeginTime > 0)
{
- totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
+ totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
}
statement.setLong(34, totalOnlineTime);
@@ -7168,7 +7169,7 @@ public class PlayerInstance extends Playable
int buffIndex = 0;
final List storedSkills = new ArrayList<>();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
// Store all effect data along with calulated remaining
// reuse delays for matching skills. 'restore_type'= 0.
@@ -7283,7 +7284,7 @@ public class PlayerInstance extends Playable
ps1.setInt(1, getObjectId());
ps1.execute();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : getItemReuseTimeStamps().values())
{
if ((ts != null) && (currentTime < ts.getStamp()))
@@ -7606,7 +7607,7 @@ public class PlayerInstance extends Playable
statement.setInt(2, _classIndex);
try (ResultSet rset = statement.executeQuery())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
final int remainingTime = rset.getInt("remaining_time");
@@ -7668,7 +7669,7 @@ public class PlayerInstance extends Playable
long systime;
boolean isInInventory;
long remainingTime;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
itemId = rset.getInt("itemId");
@@ -7743,7 +7744,7 @@ public class PlayerInstance extends Playable
{
int slot;
int symbolId;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
slot = rset.getInt("slot");
@@ -7866,7 +7867,7 @@ public class PlayerInstance extends Playable
// Send Server->Client UserInfo packet to this PlayerInstance
broadcastUserInfo(UserInfoType.BASE_STATS, UserInfoType.MAX_HPCPMP, UserInfoType.STATS, UserInfoType.SPEED);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long timeLeft = getVariables().getLong("HennaDuration" + slot, currentTime) - currentTime;
if ((henna.getDuration() < 0) || (timeLeft > 0))
{
@@ -7957,7 +7958,7 @@ public class PlayerInstance extends Playable
// Task for henna duration
if (henna.getDuration() > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
@@ -12416,7 +12417,7 @@ public class PlayerInstance extends Playable
public int getBirthdays()
{
- long time = (System.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
+ long time = (Chronos.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
time /= TimeUnit.DAYS.toMillis(365);
return (int) time;
}
@@ -12656,7 +12657,7 @@ public class PlayerInstance extends Playable
return false;
}
- if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
+ if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@@ -12716,7 +12717,7 @@ public class PlayerInstance extends Playable
*/
public void setFalling()
{
- _fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
+ _fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
}
/**
@@ -12737,7 +12738,7 @@ public class PlayerInstance extends Playable
*/
public void updateLastItemAuctionRequest()
{
- _lastItemAuctionInfoRequest = System.currentTimeMillis();
+ _lastItemAuctionInfoRequest = Chronos.currentTimeMillis();
}
/**
@@ -12746,7 +12747,7 @@ public class PlayerInstance extends Playable
*/
public boolean isItemAuctionPolling()
{
- return (System.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
+ return (Chronos.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
}
@Override
@@ -13130,7 +13131,7 @@ public class PlayerInstance extends Playable
public void updateNotMoveUntil()
{
- _notMoveUntil = System.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
+ _notMoveUntil = Chronos.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
}
@Override
@@ -14177,7 +14178,7 @@ public class PlayerInstance extends Playable
public boolean isInTraingCamp()
{
final TrainingHolder trainingHolder = getTraingCampInfo();
- return (trainingHolder != null) && (trainingHolder.getEndTime() > System.currentTimeMillis());
+ return (trainingHolder != null) && (trainingHolder.getEndTime() > Chronos.currentTimeMillis());
}
public AttendanceInfoHolder getAttendanceInfo()
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
index ac089b7e91..bf4cea7560 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
@@ -21,6 +21,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.InstanceType;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
@@ -280,13 +281,13 @@ public class VillageMasterInstance extends NpcInstance
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
return;
}
- clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setDissolvingExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
// The clan leader should take the XP penalty of a full death.
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 843165d245..18d77105c7 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.attackable;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
/**
@@ -40,7 +41,7 @@ public class CommandChannelTimer implements Runnable
return;
}
- if ((System.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
+ if ((Chronos.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
{
_attackable.setCommandChannelTimer(null);
_attackable.setFirstCommandChannelAttacked(null);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
index e2130407ac..290e49a99f 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.player;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -92,12 +93,12 @@ public class IllegalPlayerActionTask implements Runnable
}
case KICKBAN:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
case JAIL:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/buylist/Product.java
index 0782846eba..3fc18a73e3 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/buylist/Product.java
@@ -25,6 +25,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.type.EtcItemType;
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
@@ -134,7 +135,7 @@ public class Product
public void restartRestockTask(long nextRestockTime)
{
- final long remainTime = nextRestockTime - System.currentTimeMillis();
+ final long remainTime = nextRestockTime - Chronos.currentTimeMillis();
if (remainTime > 0)
{
BuyListTaskManager.getInstance().update(this, remainTime);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
index 1ccabadff3..1355481e68 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
import org.l2jmobius.gameserver.enums.QuestSound;
@@ -278,7 +279,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
});
}
}
- _battleStartTime = System.currentTimeMillis();
+ _battleStartTime = Chronos.currentTimeMillis();
getTimers().addRepeatingTimer("update", 1000, null, null);
}
@@ -505,7 +506,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
private void updateLifeTime(CeremonyOfChaosMember member)
{
- member.setLifeTime(((int) (System.currentTimeMillis() - _battleStartTime) / 1000));
+ member.setLifeTime(((int) (Chronos.currentTimeMillis() - _battleStartTime) / 1000));
}
public List getWinners()
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/clan/Clan.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/clan/Clan.java
index fd7c721083..d3f28a8c3f 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/clan/Clan.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/clan/Clan.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -505,7 +506,7 @@ public class Clan implements IIdentifiable, INamable
if (player.isClanLeader())
{
SiegeManager.getInstance().removeSiegeSkills(player);
- player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ player.setClanCreateExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
}
// remove Clan skills from Player
@@ -537,7 +538,7 @@ public class Clan implements IIdentifiable, INamable
}
else
{
- removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
+ removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
}
// Notify to scripts
@@ -1002,12 +1003,12 @@ public class Clan implements IIdentifiable, INamable
setAllyId(clanData.getInt("ally_id"));
setAllyName(clanData.getString("ally_name"));
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
- if (_allyPenaltyExpiryTime < System.currentTimeMillis())
+ if (_allyPenaltyExpiryTime < Chronos.currentTimeMillis())
{
setAllyPenaltyExpiryTime(0, 0);
}
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
- if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
+ if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < Chronos.currentTimeMillis()) // 24*60*60*1000 = 86400000
{
setCharPenaltyExpiryTime(0);
}
@@ -2048,7 +2049,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
return false;
}
- if (_charPenaltyExpiryTime > System.currentTimeMillis())
+ if (_charPenaltyExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return false;
@@ -2060,7 +2061,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (target.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (target.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(target.getName());
@@ -2102,7 +2103,7 @@ public class Clan implements IIdentifiable, INamable
return false;
}
final Clan leaderClan = player.getClan();
- if ((leaderClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis()) && (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN))
+ if ((leaderClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis()) && (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN))
{
player.sendPacket(SystemMessageId.YOU_MAY_NOT_ACCEPT_ANY_CLAN_WITHIN_A_DAY_AFTER_EXPELLING_ANOTHER_CLAN);
return false;
@@ -2138,7 +2139,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
{
@@ -2232,12 +2233,12 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
return;
}
- if ((_allyPenaltyExpiryTime > System.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
+ if ((_allyPenaltyExpiryTime > Chronos.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
return;
}
- if (_dissolvingExpiryTime > System.currentTimeMillis())
+ if (_dissolvingExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
return;
@@ -2289,7 +2290,7 @@ public class Clan implements IIdentifiable, INamable
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
{
if (clan.getId() != getId())
@@ -2315,7 +2316,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
return false;
}
- if (System.currentTimeMillis() < _dissolvingExpiryTime)
+ if (Chronos.currentTimeMillis() < _dissolvingExpiryTime)
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
return false;
@@ -2700,7 +2701,7 @@ public class Clan implements IIdentifiable, INamable
public void addMasterySkill(int id)
{
- getVariables().set(ClanVariables.CLAN_MASTERY_SKILL_TIME + id, System.currentTimeMillis() + 1296000000);
+ getVariables().set(ClanVariables.CLAN_MASTERY_SKILL_TIME + id, Chronos.currentTimeMillis() + 1296000000);
final ScheduledFuture> task = ThreadPool.schedule(() -> removeMasterySkill(id), 1296000000); // 1296000000 = 15 days
masterySkillTasks.add(task);
addNewSkill(SkillData.getInstance().getSkill(id, 1));
@@ -2719,7 +2720,7 @@ public class Clan implements IIdentifiable, INamable
{
return -1;
}
- return (int) (endTime - System.currentTimeMillis());
+ return (int) (endTime - Chronos.currentTimeMillis());
}
public void setDevelopmentPoints(int count)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/clan/ClanWar.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
index d4049e1da3..545f226e2c 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -54,9 +55,9 @@ public class ClanWar
{
_attackerClanId = attacker.getId();
_attackedClanId = attacked.getId();
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_state = ClanWarState.BLOOD_DECLARATION;
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
attacker.addWar(attacked.getId(), this);
attacked.addWar(attacker.getId(), this);
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
@@ -79,15 +80,15 @@ public class ClanWar
_attackerKillCount.set(attackerKillCount);
_attackedKillCount.set(attackedKillCount);
_winnerClanId = winnerClan;
- if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > System.currentTimeMillis())
+ if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > Chronos.currentTimeMillis())
{
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
}
if (_endTime > 0)
{
final long endTimePeriod = _endTime + (_state == ClanWarState.TIE ? TIME_TO_DELETION_AFTER_CANCELLATION : TIME_TO_DELETION_AFTER_DEFEAT);
- if (endTimePeriod > System.currentTimeMillis())
+ if (endTimePeriod > Chronos.currentTimeMillis())
{
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(_attackerClanId, _attackedClanId), 10000);
}
@@ -177,8 +178,8 @@ public class ClanWar
winnerClan.broadcastToOnlineMembers(sm);
_winnerClanId = winnerClan.getId();
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - Chronos.currentTimeMillis());
}
public void clanWarTimeout()
@@ -196,8 +197,8 @@ public class ClanWar
attackerClan.broadcastToOnlineMembers(sm);
_state = ClanWarState.TIE;
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - Chronos.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index f150ec3238..b1b3a83fd1 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.StatSet;
import it.sauronsoftware.cron4j.PastPredictor;
@@ -112,7 +113,7 @@ public class EventScheduler
final Predictor predictor = new Predictor(_pattern);
final long nextSchedule = predictor.nextMatchingTime();
- final long timeSchedule = nextSchedule - System.currentTimeMillis();
+ final long timeSchedule = nextSchedule - Chronos.currentTimeMillis();
if (timeSchedule <= (30 * 1000))
{
LOGGER.warning("Wrong reschedule for " + _eventManager.getClass().getSimpleName() + " end up run in " + (timeSchedule / 1000) + " seconds!");
@@ -144,10 +145,10 @@ public class EventScheduler
{
ps.setString(1, _eventManager.getName());
ps.setString(2, _name);
- ps.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(3, new Timestamp(Chronos.currentTimeMillis()));
ps.setString(4, _eventManager.getName());
ps.setString(5, _name);
- ps.setTimestamp(6, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(6, new Timestamp(Chronos.currentTimeMillis()));
ps.execute();
return true;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/events/EventType.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/events/EventType.java
index 99875a73cf..f266ac008b 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/events/EventType.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/events/EventType.java
@@ -76,7 +76,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
@@ -84,8 +83,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaR
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemAdd;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDestroy;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDrop;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemTransfer;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
@@ -114,7 +115,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
index 77e7205bfa..6139454534 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -85,7 +86,7 @@ public class TrainingHolder implements Serializable
public long getElapsedTime()
{
- return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
+ return TimeUnit.SECONDS.convert(Chronos.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
index 6c9ca907b7..62649739ea 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -39,6 +39,7 @@ import java.util.stream.Stream;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -105,7 +106,7 @@ public class Instance implements IIdentifiable, INamable
// Set basic instance info
_id = id;
_template = template;
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_spawns = new ArrayList<>(template.getSpawns().size());
// Clone and add the spawn templates
@@ -755,7 +756,7 @@ public class Instance implements IIdentifiable, INamable
}
// Set new cleanup task
- _endTime = System.currentTimeMillis() + millis;
+ _endTime = Chronos.currentTimeMillis() + millis;
if (minutes < 1) // Destroy instance
{
destroy();
@@ -858,7 +859,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getElapsedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
/**
@@ -867,7 +868,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getRemainingTime()
{
- return (_endTime == -1) ? -1 : (_endTime - System.currentTimeMillis());
+ return (_endTime == -1) ? -1 : (_endTime - Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
index 973dab1661..84466d8e0a 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.GroupType;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -547,7 +548,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
{
if (data.getTime() > 0)
{
- time = System.currentTimeMillis() + data.getTime();
+ time = Chronos.currentTimeMillis() + data.getTime();
break;
}
@@ -557,7 +558,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
calendar.set(Calendar.SECOND, 0);
// If calendar time is lower than current, add one more day
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
@@ -574,7 +575,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Set exact day. If modified date is before current, add one more week.
calendar.set(Calendar.DAY_OF_WEEK, day);
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.WEEK_OF_MONTH, 1);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
index 1850d30783..07ce5a3538 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.instancezone.conditions;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -39,6 +40,6 @@ public class ConditionReenter extends Condition
protected boolean test(PlayerInstance player, Npc npc)
{
final int instanceId = getParameters().getInt("instanceId", getInstanceTemplate().getId());
- return System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
+ return Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index fbe1e21414..a1b1f40b26 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.ItemInfo;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -181,12 +182,12 @@ public class ItemAuction
public long getStartingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public long getFinishingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public void storeMe()
@@ -339,7 +340,7 @@ public class ItemAuction
_highestBid = bid;
}
- if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
+ if ((_endingTime - Chronos.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
{
switch (_auctionEndingExtendState)
{
@@ -426,7 +427,7 @@ public class ItemAuction
}
case FINISHED:
{
- if (_startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
+ if (_startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
{
return false;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 8d81451dc9..f14581064a 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -243,7 +244,7 @@ public class ItemAuctionInstance
{
case 0:
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
case 1:
@@ -252,10 +253,10 @@ public class ItemAuctionInstance
{
case CREATED:
{
- if (auctions[0].getStartingTime() < (System.currentTimeMillis() + START_TIME_SPACE))
+ if (auctions[0].getStartingTime() < (Chronos.currentTimeMillis() + START_TIME_SPACE))
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
else
{
@@ -266,13 +267,13 @@ public class ItemAuctionInstance
case STARTED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, System.currentTimeMillis() + START_TIME_SPACE));
+ nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, Chronos.currentTimeMillis() + START_TIME_SPACE));
break;
}
case FINISHED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
default:
@@ -287,7 +288,7 @@ public class ItemAuctionInstance
{
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
// just to make sure we won't skip any auction because of little different times
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (ItemAuction auction : auctions)
{
if (auction.getAuctionState() == ItemAuctionState.STARTED)
@@ -311,7 +312,7 @@ public class ItemAuctionInstance
}
if (nextAuction == null)
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
break;
}
@@ -326,17 +327,17 @@ public class ItemAuctionInstance
{
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
}
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
}
}
@@ -422,7 +423,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -432,7 +433,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -442,7 +443,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -452,7 +453,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
}
@@ -577,7 +578,7 @@ public class ItemAuctionInstance
return null;
}
- if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
+ if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
{
LOGGER.info(getClass().getSimpleName() + ": Clearing expired auction: " + auctionId);
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
index beae6e0db1..abbe632775 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.AgathionData;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
@@ -206,7 +207,7 @@ public class ItemInstance extends WorldObject
_type2 = 0;
_dropTime = 0;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -229,7 +230,7 @@ public class ItemInstance extends WorldObject
super.setName(_item.getName());
_loc = ItemLocation.VOID;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -1583,7 +1584,7 @@ public class ItemInstance extends WorldObject
setSpawned(true);
setXYZ(x, y, z);
- setDropTime(System.currentTimeMillis());
+ setDropTime(Chronos.currentTimeMillis());
setDropperObjectId(dropper != null ? dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
// Add the ItemInstance dropped in the world as a visible object
@@ -1862,7 +1863,7 @@ public class ItemInstance extends WorldObject
public long getRemainingTime()
{
- return _time - System.currentTimeMillis();
+ return _time - Chronos.currentTimeMillis();
}
public void endOfLife()
@@ -2520,7 +2521,7 @@ public class ItemInstance extends WorldObject
if (getVisualLifeTime() > 0)
{
final long endTime = getVisualLifeTime();
- if ((endTime - System.currentTimeMillis()) > 0)
+ if ((endTime - Chronos.currentTimeMillis()) > 0)
{
ItemAppearanceTaskManager.getInstance().add(this, endTime);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index e6e471cce5..09adeca7a9 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -21,6 +21,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
@@ -84,7 +85,7 @@ public abstract class AbstractOlympiadGame
protected boolean makeCompetitionStart()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
return !_aborted;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 8f929acb1e..cf96eac121 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
@@ -765,7 +766,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", template.getName() + " was defeated");
@@ -786,7 +787,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", castle.getName() + " Castle was successfuly taken");
@@ -800,7 +801,7 @@ public class Hero
PreparedStatement ps = con.prepareStatement("INSERT INTO heroes_diary (charId, time, action, param) values(?,?,?,?)"))
{
ps.setInt(1, charId);
- ps.setLong(2, System.currentTimeMillis());
+ ps.setLong(2, Chronos.currentTimeMillis());
ps.setInt(3, action);
ps.setInt(4, param);
ps.execute();
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index 2a54d83dc7..0427829eb2 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,6 +27,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
@@ -546,7 +547,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
String winner = "draw";
// Calculate Fight time
- final long _fightTime = (System.currentTimeMillis() - _startTime);
+ final long _fightTime = (Chronos.currentTimeMillis() - _startTime);
double playerOneHp = 0;
if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index 119e447b15..4bb2fc156e 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.handler.PunishmentHandler;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
@@ -133,7 +134,7 @@ public class PunishmentTask implements Runnable
*/
public boolean isExpired()
{
- return (_expirationTime > 0) && (System.currentTimeMillis() > _expirationTime);
+ return (_expirationTime > 0) && (Chronos.currentTimeMillis() > _expirationTime);
}
/**
@@ -149,7 +150,7 @@ public class PunishmentTask implements Runnable
onStart();
if (_expirationTime > 0) // Has expiration?
{
- _task = ThreadPool.schedule(this, (_expirationTime - System.currentTimeMillis()));
+ _task = ThreadPool.schedule(this, (_expirationTime - Chronos.currentTimeMillis()));
}
}
@@ -226,7 +227,7 @@ public class PunishmentTask implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement st = con.prepareStatement(UPDATE_QUERY))
{
- st.setLong(1, System.currentTimeMillis());
+ st.setLong(1, Chronos.currentTimeMillis());
st.setLong(2, _id);
st.execute();
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 7c2d57fdc6..2e36bece7c 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -32,6 +32,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.EventDroplist;
import org.l2jmobius.gameserver.data.ItemTable;
@@ -100,7 +101,7 @@ public class LongTimeEvent extends Quest
}
else if (_eventPeriod.getStartDate().after(new Date()))
{
- final long delay = _eventPeriod.getStartDate().getTime() - System.currentTimeMillis();
+ final long delay = _eventPeriod.getStartDate().getTime() - Chronos.currentTimeMillis();
ThreadPool.schedule(new ScheduleStart(), delay);
LOGGER.info("Event " + _eventName + " will be started at " + _eventPeriod.getStartDate());
}
@@ -323,7 +324,7 @@ public class LongTimeEvent extends Quest
}
// Add spawns.
- final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - System.currentTimeMillis();
+ final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - Chronos.currentTimeMillis();
for (NpcSpawn spawn : _spawnList)
{
addSpawn(spawn.npcId, spawn.loc.getX(), spawn.loc.getY(), spawn.loc.getZ(), spawn.loc.getHeading(), false, millisToEventEnd, false);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 1218569d81..4264d72834 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.enums.QuestType;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
@@ -785,7 +786,7 @@ public class QuestState
public boolean isNowAvailable()
{
final String val = get("restartTime");
- return (val != null) && (Long.parseLong(val) <= System.currentTimeMillis());
+ return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
public void setSimulated(boolean simulated)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
index cf665da8f8..b4d0d36648 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.SocialClass;
@@ -138,7 +139,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
final int level = rs.getInt("level");
final long expiration = rs.getLong("expiration");
final ResidenceFunction func = new ResidenceFunction(id, level, expiration, this);
- if ((expiration <= System.currentTimeMillis()) && !func.reactivate())
+ if ((expiration <= Chronos.currentTimeMillis()) && !func.reactivate())
{
removeFunction(func);
continue;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
index a292c439e5..d81d7f08af 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanHallGrade;
import org.l2jmobius.gameserver.enums.ClanHallType;
@@ -265,7 +266,7 @@ public class ClanHall extends AbstractResidence
final int failDays = getCostFailDay();
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : _paidUntil;
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - Chronos.currentTimeMillis());
}
else
{
@@ -310,7 +311,7 @@ public class ClanHall extends AbstractResidence
*/
public long getNextPayment()
{
- return (_checkPaymentTask != null) ? System.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
+ return (_checkPaymentTask != null) ? Chronos.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
}
public Location getOwnerLocation()
@@ -382,7 +383,7 @@ public class ClanHall extends AbstractResidence
{
_owner.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, _lease, null, null);
setPaidUntil(Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(7)).toEpochMilli());
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - Chronos.currentTimeMillis());
updateDB();
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
index 2fa683814d..faac3921be 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
@@ -30,6 +30,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
@@ -85,7 +86,7 @@ public class ClanHallAuction
public void addBid(Clan clan, long bid)
{
- addBid(clan, bid, System.currentTimeMillis());
+ addBid(clan, bid, Chronos.currentTimeMillis());
}
public void addBid(Clan clan, long bid, long bidTime)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index c71380874f..841d3b180c 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -20,6 +20,7 @@ import java.time.Instant;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ResidenceFunctionsData;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -63,9 +64,9 @@ public class ResidenceFunction
private void init()
{
final ResidenceFunctionTemplate template = getTemplate();
- if ((template != null) && (_expiration > System.currentTimeMillis()))
+ if ((template != null) && (_expiration > Chronos.currentTimeMillis()))
{
- _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
+ _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - Chronos.currentTimeMillis());
}
}
@@ -170,7 +171,7 @@ public class ResidenceFunction
if (wh.destroyItem("FunctionFee", item, template.getCost().getCount(), null, this) != null)
{
- _expiration = System.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
+ _expiration = Chronos.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
init();
}
return true;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
index 3a425c9b03..af7fd2e85e 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.shuttle;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Location;
/**
@@ -29,7 +30,7 @@ public class ShuttleStop
private final int _id;
private boolean _isOpen = true;
private final List _dimensions = new ArrayList<>(3);
- private long _lastDoorStatusChanges = System.currentTimeMillis();
+ private long _lastDoorStatusChanges = Chronos.currentTimeMillis();
public ShuttleStop(int id)
{
@@ -64,7 +65,7 @@ public class ShuttleStop
}
_isOpen = true;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public void closeDoor()
@@ -75,11 +76,11 @@ public class ShuttleStop
}
_isOpen = false;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public boolean hasDoorChanged()
{
- return (System.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
+ return (Chronos.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Castle.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Castle.java
index 1ee2ffa27b..41cd50499c 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Castle.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Castle.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.CastleData;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -160,7 +161,7 @@ public class Castle extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -195,7 +196,7 @@ public class Castle extends AbstractResidence
fee = _tempFee;
}
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Fort.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Fort.java
index 95839a8065..de66de79ed 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Fort.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Fort.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.FortUpdater;
import org.l2jmobius.gameserver.FortUpdater.UpdaterType;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -163,7 +164,7 @@ public class Fort extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -193,7 +194,7 @@ public class Fort extends AbstractResidence
if ((_fortOwner.getWarehouse().getAdena() >= _fee) || !_cwh)
{
final int fee = _endDate == -1 ? _tempFee : _fee;
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
@@ -580,7 +581,7 @@ public class Fort extends AbstractResidence
clan.setFortId(getResidenceId());
setOwnerClan(clan);
final int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
- long initial = System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
+ long initial = Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
while (initial > (Config.FS_UPDATE_FRQ * 60000))
{
initial -= Config.FS_UPDATE_FRQ * 60000;
@@ -786,7 +787,7 @@ public class Fort extends AbstractResidence
if (clan != null)
{
clanId = clan.getId();
- _lastOwnedTime.setTimeInMillis(System.currentTimeMillis());
+ _lastOwnedTime.setTimeInMillis(Chronos.currentTimeMillis());
}
else
{
@@ -920,12 +921,12 @@ public class Fort extends AbstractResidence
public int getOwnedTime()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
}
public int getTimeTillRebelArmy()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - System.currentTimeMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - Chronos.currentTimeMillis()) / 1000);
}
public long getTimeTillNextFortUpdate()
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Siege.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Siege.java
index 4b708d7885..9ce3c7e625 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Siege.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/siege/Siege.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SiegeScheduleData;
import org.l2jmobius.gameserver.enums.SiegeClanType;
@@ -1434,9 +1435,9 @@ public class Siege implements Siegable
}
final Calendar calendar = _castle.getSiegeDate();
- if (calendar.getTimeInMillis() < System.currentTimeMillis())
+ if (calendar.getTimeInMillis() < Chronos.currentTimeMillis())
{
- calendar.setTimeInMillis(System.currentTimeMillis());
+ calendar.setTimeInMillis(Chronos.currentTimeMillis());
}
calendar.set(Calendar.DAY_OF_WEEK, holder.getDay());
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
index c7b80987c7..77396cff6d 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
@@ -32,10 +32,10 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
+import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
import org.l2jmobius.gameserver.model.stats.Stat;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
index c3ac06e1fc..18161a6c75 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
@@ -30,8 +30,8 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
index 5428c6f7dd..497f4e7247 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.zone.type;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -99,7 +100,7 @@ public class NoRestartZone extends ZoneType
return;
}
- if (((System.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
+ if (((Chronos.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
{
player.teleToLocation(TeleportWhereType.TOWN);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/GameClient.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/GameClient.java
index badd7b05a1..99c66513d8 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/GameClient.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/GameClient.java
@@ -30,6 +30,7 @@ import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.ICrypt;
import org.l2jmobius.commons.network.IIncomingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -341,7 +342,7 @@ public class GameClient extends ChannelInboundHandler
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps2 = con.prepareStatement("UPDATE characters SET deletetime=? WHERE charId=?"))
{
- ps2.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ ps2.setLong(1, Chronos.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
ps2.setInt(2, objectId);
ps2.execute();
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
index bf151234da..cf2986ced6 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -81,7 +82,7 @@ public class AllyDismiss implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000), Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
leaderClan.updateClanInDB();
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
index 3d5c508a4c..7cc2fa0c1f 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class AllyLeave implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
clan.setAllyId(0);
clan.setAllyName(null);
clan.changeAllyCrest(0, true);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 584a2744c5..e37e4099bf 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
@@ -540,7 +541,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_RECENTLY_BEEN_DISMISSED_FROM_A_CLAN_YOU_ARE_NOT_ALLOWED_TO_JOIN_ANOTHER_CLAN_FOR_24_HOURS);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
index c63a8bfcf4..854d89da8d 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.AdminTeleportType;
@@ -74,7 +75,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
player.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
index 54c3fc6029..d3dee51253 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
@@ -20,6 +20,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.enums.ItemSkillType;
@@ -126,7 +127,7 @@ public class RequestEnchantItem implements IClientIncomingPacket
}
// fast auto-enchant cheat check
- if ((request.getTimestamp() == 0) || ((System.currentTimeMillis() - request.getTimestamp()) < 2000))
+ if ((request.getTimestamp() == 0) || ((Chronos.currentTimeMillis() - request.getTimestamp()) < 2000))
{
Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " use autoenchant program ", Config.DEFAULT_PUNISH);
player.removeRequest(request.getClass());
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
index b8a07b77e8..bad73f8c28 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -82,7 +83,7 @@ public class RequestExAddEnchantScrollItem implements IClientIncomingPacket
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantScrollItemResult(_scrollObjectId));
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
index db4db5e742..b004d448e0 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -55,7 +56,7 @@ public class RequestExRemoveEnchantSupportItem implements IClientIncomingPacket
request.setSupportItem(PlayerInstance.ID_NONE);
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(ExRemoveEnchantSupportItemResult.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
index 92018f3a8d..035cf151b6 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -69,7 +70,7 @@ public class RequestExSetPledgeCrestLarge implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
index c9e0cf1be8..7a2a1c706a 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -85,7 +86,7 @@ public class RequestExTryToPutEnchantSupportItem implements IClientIncomingPacke
}
request.setSupportItem(support.getObjectId());
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantSupportItemResult(_supportObjectId));
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
index cdf3996711..4b04a3965e 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -76,7 +77,7 @@ public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
}
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
client.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
index 715be58f93..cd86a6542c 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -69,7 +70,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
{
if (_isJoining == 1)
{
- if (System.currentTimeMillis() < clan.getDissolvingExpiryTime())
+ if (Chronos.currentTimeMillis() < clan.getDissolvingExpiryTime())
{
client.sendPacket(SystemMessageId.YOUR_CLAN_MAY_NOT_REGISTER_TO_PARTICIPATE_IN_A_SIEGE_WHILE_UNDER_A_GRACE_PERIOD_OF_THE_CLAN_S_DISSOLUTION);
return;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
index 9e74ccac1a..6c52234804 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.BoatManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.instance.BoatInstance;
@@ -61,7 +62,7 @@ public class RequestMoveToLocationInVehicle implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
client.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
index af3723c7f8..54ec6ddd78 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
@@ -80,8 +81,8 @@ public class RequestOustPledgeMember implements IClientIncomingPacket
}
// this also updates the database
- clan.removeClanMember(member.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
- clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(member.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setCharPenaltyExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_BEEN_DISMISSED);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
index 0bf1ebf5ec..a61cc79835 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
@@ -22,6 +22,7 @@ import java.sql.SQLException;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -68,7 +69,7 @@ public class RequestPetitionFeedback implements IClientIncomingPacket
statement.setString(2, player.getLastPetitionGmName());
statement.setInt(3, _rate);
statement.setString(4, _message);
- statement.setLong(5, System.currentTimeMillis());
+ statement.setLong(5, Chronos.currentTimeMillis());
statement.execute();
}
catch (SQLException e)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
index ba7a5bab88..0a24a0e492 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanLevelData;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.ClanEntryManager;
@@ -63,12 +64,12 @@ public class RequestPledgeSignInForOpenJoiningMethod implements IClientIncomingP
final Clan clan = pledgeRecruitInfo.getClan();
if ((clan != null) && (player.getClan() == null))
{
- if (clan.getCharPenaltyExpiryTime() > System.currentTimeMillis())
+ if (clan.getCharPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return;
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 30e0b1b097..9c606fc9fe 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -34,8 +34,8 @@ import org.l2jmobius.gameserver.model.quest.Event;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.network.GameClient;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
index d415106f6a..d21279f5be 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -74,7 +75,7 @@ public class RequestSetPledgeCrest implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
index 16f6b732ba..f1d9597133 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.enums.UserInfoType;
@@ -101,7 +102,7 @@ public class RequestStartPledgeWar implements IClientIncomingPacket
client.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
- else if (clanDeclaredWar.getDissolvingExpiryTime() > System.currentTimeMillis())
+ else if (clanDeclaredWar.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(new SystemMessage(SystemMessageId.A_CLAN_WAR_CAN_NOT_BE_DECLARED_AGAINST_A_CLAN_THAT_IS_BEING_DISSOLVED));
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
index 5fdcb9b32f..60793f38b5 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class RequestWithdrawalPledge implements IClientIncomingPacket
}
final Clan clan = player.getClan();
- clan.removeClanMember(player.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(player.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
index 64714a4976..949dba2b59 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlEvent;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.NextAction;
@@ -264,7 +265,7 @@ public class UseItem implements IClientIncomingPacket
else if (player.isAttackingNow())
{
// Equip or unEquip.
- ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
+ ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
index aef68ac971..96ce901338 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.appearance;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.enums.InventorySlot;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -252,7 +253,7 @@ public class RequestShapeShiftingItem implements IClientIncomingPacket
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getLifeTime() > 0))
{
- targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, System.currentTimeMillis() + appearanceStone.getLifeTime());
+ targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, Chronos.currentTimeMillis() + appearanceStone.getLifeTime());
targetItem.scheduleVisualLifeTime();
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
index 2aa7eeeeac..d6bbe9b766 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,9 +119,9 @@ public class ConfirmMenteeAdd implements IClientIncomingPacket
mentor.sendPacket(SystemMessageId.YOU_MUST_AWAKEN_IN_ORDER_TO_BECOME_A_MENTOR);
return false;
}
- else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > System.currentTimeMillis())
+ else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > Chronos.currentTimeMillis())
{
- long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - System.currentTimeMillis()) / 1000;
+ long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - Chronos.currentTimeMillis()) / 1000;
final int days = (int) (remainingTime / 86400);
remainingTime = remainingTime % 86400;
final int hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
index e06cd9048d..1e8aba6d16 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
@@ -119,7 +120,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
index f6702caa41..9c076a29a5 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.enums.MailType;
@@ -140,7 +141,7 @@ public class RequestBRPresentBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
index c3faad961a..138ed60513 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.training;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.TrainingHolder;
import org.l2jmobius.gameserver.network.GameClient;
@@ -52,7 +53,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
if (holder.isTraining())
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
@@ -60,7 +61,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
player.setImmobilized(false);
player.teleToLocation(player.getLastLocation());
player.sendPacket(ExTrainingZone_Leaving.STATIC_PACKET);
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
index ee1c787150..3f1213f2ee 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.loginserverpackets.game;
import org.l2jmobius.commons.network.BaseSendablePacket;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author mrTJO
@@ -28,7 +29,7 @@ public class TempBan extends BaseSendablePacket
writeC(0x0A);
writeS(accountName);
writeS(ip);
- writeQ(System.currentTimeMillis() + (time * 60000));
+ writeQ(Chronos.currentTimeMillis() + (time * 60000));
// if (reason != null)
// {
// writeC(0x01);
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
index c721fa30d9..24af521ca5 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
@@ -277,7 +278,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP
packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP
- packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
+ packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0);
packet.writeD(charInfoPackage.getClassId());
packet.writeD(i == _activeId ? 1 : 0);
@@ -372,7 +373,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
// See if the char must be deleted
final long deletetime = chardata.getLong("deletetime");
- if ((deletetime > 0) && (System.currentTimeMillis() > deletetime))
+ if ((deletetime > 0) && (Chronos.currentTimeMillis() > deletetime))
{
final Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
if (clan != null)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
index 57dd77c3f1..6cbf9639e3 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
@@ -53,7 +54,7 @@ public class ExInzoneWaiting implements IClientOutgoingPacket
packet.writeD(_instanceTimes.size());
for (Entry entry : _instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
index a40690e845..6f7b5f8735 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MatchingRoomManager;
@@ -73,7 +74,7 @@ public class ExListPartyMatchingWaitingRoom implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
index d455d825fd..5921d44781 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MatchingMemberType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -61,7 +62,7 @@ public class ExPartyRoomMember implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
index 3656ddbc4e..ab85228caf 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MailType;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
@@ -45,7 +46,7 @@ public class ExShowReceivedPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_RECEIVED_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_inbox != null) && !_inbox.isEmpty())
{
packet.writeD(_inbox.size());
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
index 2ae09181a7..db4bccc928 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -40,7 +41,7 @@ public class ExShowSentPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_SENT_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_outbox != null) && !_outbox.isEmpty())
{
packet.writeD(_outbox.size());
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
index db2091ad54..4403da53fe 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.items.Henna;
import org.l2jmobius.gameserver.model.stats.BaseStat;
@@ -73,7 +74,7 @@ public class HennaInfo implements IClientOutgoingPacket
int duration = premium.getDuration();
if (duration > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
duration = (int) Math.max(0, _player.getVariables().getLong("HennaDuration4", currentTime) - currentTime) / 1000;
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
index 5ed678042b..caed96260b 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -88,7 +89,7 @@ public class SiegeInfo implements IClientOutgoingPacket
packet.writeS(""); // Ally Name
}
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if (!_castle.isTimeRegistrationOver() && _player.isClanLeader() && (_player.getClanId() == _castle.getOwnerId()))
{
final Calendar cal = Calendar.getInstance();
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
index 5871334785..c6de3ccd8b 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.TimeStamp;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -36,7 +37,7 @@ public class SkillCoolTime implements IClientOutgoingPacket
public SkillCoolTime(PlayerInstance player)
{
- _currentTime = System.currentTimeMillis();
+ _currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : player.getSkillReuseTimeStamps().values())
{
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel()).isNotBroadcastable())
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
index 74955d8a26..2ffa34919b 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets.friend;
import java.util.Calendar;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -39,7 +40,7 @@ public class ExFriendDetailInfo implements IClientOutgoingPacket
_objectId = player.getObjectId();
_name = name;
_friend = World.getInstance().getPlayer(_name);
- _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) System.currentTimeMillis() : (int) (System.currentTimeMillis() - _friend.getLastAccess()) / 1000;
+ _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) Chronos.currentTimeMillis() : (int) (Chronos.currentTimeMillis() - _friend.getLastAccess()) / 1000;
}
@Override
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/scripting/ManagedScript.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
index 00235baa25..9d206480d8 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
@@ -20,6 +20,8 @@ import java.nio.file.Path;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* Abstract class for classes that are meant to be implemented by scripts.
* @author KenM
@@ -35,7 +37,7 @@ public abstract class ManagedScript
public ManagedScript()
{
_scriptFile = getScriptPath();
- setLastLoadTime(System.currentTimeMillis());
+ setLastLoadTime(Chronos.currentTimeMillis());
}
public abstract Path getScriptPath();
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9c8c4bb5dd..b5a2e04233 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -54,7 +55,7 @@ public class AttackStanceTaskManager
}
_working = true;
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
try
{
final Iterator> iterator = _attackStanceTasks.entrySet().iterator();
@@ -105,7 +106,7 @@ public class AttackStanceTaskManager
return;
}
- _attackStanceTasks.put(creature, System.currentTimeMillis());
+ _attackStanceTasks.put(creature, Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
index 8ab6c99d28..d56e0b8a23 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.buylist.Product;
/**
@@ -45,7 +46,7 @@ public class BuyListTaskManager
}
_workingProducts = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : PRODUCTS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 8b4a7db319..f8218055f3 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@@ -44,7 +45,7 @@ public class DecayTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -87,7 +88,7 @@ public class DecayTaskManager
}
// Add to decay schedules.
- DECAY_SCHEDULES.put(creature, System.currentTimeMillis() + (delay * 1000));
+ DECAY_SCHEDULES.put(creature, Chronos.currentTimeMillis() + (delay * 1000));
}
/**
@@ -107,7 +108,7 @@ public class DecayTaskManager
public long getRemainingTime(Creature creature)
{
final Long time = DECAY_SCHEDULES.get(creature);
- return time != null ? time.longValue() - System.currentTimeMillis() : Long.MAX_VALUE;
+ return time != null ? time.longValue() - Chronos.currentTimeMillis() : Long.MAX_VALUE;
}
@Override
@@ -122,7 +123,7 @@ public class DecayTaskManager
ret.append("Tasks dump:");
ret.append(Config.EOL);
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
ret.append("Class/Name: ");
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
index c3834ecbb9..e0f823bef4 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemAppearanceTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
index 27f0273802..de10959db8 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemLifeTimeTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 396633692c..160debb492 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -42,7 +43,7 @@ public class ItemManaTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
@@ -61,7 +62,7 @@ public class ItemManaTaskManager
{
if (!ITEMS.containsKey(item))
{
- ITEMS.put(item, System.currentTimeMillis() + MANA_CONSUMPTION_RATE);
+ ITEMS.put(item, Chronos.currentTimeMillis() + MANA_CONSUMPTION_RATE);
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
index eb0dd7a59f..a2f0dc5563 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.model.World;
@@ -48,7 +49,7 @@ public class MessageDeletionTaskManager
Integer msgId;
Message msg;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_MESSAGES.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
index 2f270649fb..82483a498a 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PlayerAutoSaveTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SEARCH: for (Entry entry : PLAYER_TIMES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -63,7 +64,7 @@ public class PlayerAutoSaveTaskManager
public void add(PlayerInstance player)
{
- PLAYER_TIMES.put(player, System.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
+ PLAYER_TIMES.put(player, Chronos.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
}
public void remove(PlayerInstance player)
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
index 6a406a9591..3a812e2fcb 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PvpFlagTaskManager
if (!PLAYERS.isEmpty())
{
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (PlayerInstance player : PLAYERS)
{
if (time > player.getPvpFlagLasts())
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
index 5473f21a8f..b8135996f8 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -43,7 +44,7 @@ public class RandomAnimationTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_ANIMATIONS.entrySet())
{
if (time > entry.getValue().longValue())
@@ -65,7 +66,7 @@ public class RandomAnimationTaskManager
{
if (npc.hasRandomAnimation())
{
- PENDING_ANIMATIONS.putIfAbsent(npc, System.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
+ PENDING_ANIMATIONS.putIfAbsent(npc, Chronos.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
index 8e8e818908..debb0d68e6 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Spawn;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -42,7 +43,7 @@ public class RespawnTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_RESPAWNS.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
index 990efb8b45..d1946b860a 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -36,6 +36,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskBirthday;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskRecom;
@@ -94,7 +95,7 @@ public class TaskManager
public void run()
{
task.onTimeElapsed(this);
- lastActivation = System.currentTimeMillis();
+ lastActivation = Chronos.currentTimeMillis();
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement statement = con.prepareStatement(SQL_STATEMENTS[1]))
{
@@ -242,7 +243,7 @@ public class TaskManager
try
{
final Date desired = DateFormat.getInstance().parse(task.getParams()[0]);
- final long diff = desired.getTime() - System.currentTimeMillis();
+ final long diff = desired.getTime() - Chronos.currentTimeMillis();
if (diff >= 0)
{
task.scheduled = ThreadPool.schedule(task, diff);
@@ -293,7 +294,7 @@ public class TaskManager
return false;
}
- delay = min.getTimeInMillis() - System.currentTimeMillis();
+ delay = min.getTimeInMillis() - Chronos.currentTimeMillis();
if (check.after(min) || (delay < 0))
{
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ui/SystemPanel.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ui/SystemPanel.java
index 8c01c1f8fe..a19a873bfe 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ui/SystemPanel.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ui/SystemPanel.java
@@ -31,6 +31,7 @@ import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.util.Locator;
@@ -42,7 +43,7 @@ public class SystemPanel extends JPanel
{
protected static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
- protected static final long START_TIME = System.currentTimeMillis();
+ protected static final long START_TIME = Chronos.currentTimeMillis();
public SystemPanel()
{
@@ -136,7 +137,7 @@ public class SystemPanel extends JPanel
lblConnected.setText("Connected: " + playerCount);
lblMaxConnected.setText("Max connected: " + World.MAX_CONNECTED_COUNT);
lblOfflineShops.setText("Offline trade: " + World.OFFLINE_TRADE_COUNT);
- lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - START_TIME));
+ lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(Chronos.currentTimeMillis() - START_TIME));
}
}, 1000, 1000);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
index ec95816f82..cc8059f91a 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.PlayerCondOverride;
@@ -151,7 +152,7 @@ public class FloodProtectorAction
*/
private void banAccount()
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
if (LOGGER.isLoggable(Level.WARNING))
{
log(" banned for flooding ", _config.PUNISHMENT_TIME <= 0 ? "forever" : "for " + (_config.PUNISHMENT_TIME / 60000) + " mins");
@@ -171,7 +172,7 @@ public class FloodProtectorAction
final int charId = _client.getPlayer().getObjectId();
if (charId > 0)
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
}
if (LOGGER.isLoggable(Level.WARNING))
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
index e5912dd51b..d6580161c7 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World;
@@ -143,7 +144,7 @@ public class OfflineTradeUtil
if (player.getOfflineStartTime() == 0)
{
- player.setOfflineStartTime(System.currentTimeMillis());
+ player.setOfflineStartTime(Chronos.currentTimeMillis());
}
// Store trade on exit, if realtime saving is enabled.
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/FloodProtectedListener.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/FloodProtectedListener.java
index ba2fc6536a..e2bbcc1aa3 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/FloodProtectedListener.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/FloodProtectedListener.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author -Wooden-
@@ -63,9 +64,9 @@ public abstract class FloodProtectedListener extends Thread
if (fConnection != null)
{
fConnection.connectionNumber += 1;
- if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((System.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((System.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
+ if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
{
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
connection.close();
fConnection.connectionNumber -= 1;
if (!fConnection.isFlooding)
@@ -80,11 +81,11 @@ public abstract class FloodProtectedListener extends Thread
fConnection.isFlooding = false;
LOGGER.info(connection.getInetAddress().getHostAddress() + " is not considered as flooding anymore.");
}
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
}
else
{
- fConnection = new ForeignConnection(System.currentTimeMillis());
+ fConnection = new ForeignConnection(Chronos.currentTimeMillis());
_floodProtection.put(connection.getInetAddress().getHostAddress(), fConnection);
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/LoginController.java
index 189b90e2ee..9d382c646b 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/LoginController.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/LoginController.java
@@ -41,6 +41,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.GameServerTable.GameServerInfo;
@@ -176,7 +177,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(USER_INFO_SELECT))
{
- ps.setString(1, Long.toString(System.currentTimeMillis()));
+ ps.setString(1, Long.toString(Chronos.currentTimeMillis()));
ps.setString(2, login);
try (ResultSet rset = ps.executeQuery())
{
@@ -208,7 +209,7 @@ public class LoginController
{
ps.setString(1, login);
ps.setString(2, hashBase64);
- ps.setLong(3, System.currentTimeMillis());
+ ps.setLong(3, Chronos.currentTimeMillis());
ps.setInt(4, 0);
ps.setString(5, addr.getHostAddress());
ps.execute();
@@ -273,7 +274,7 @@ public class LoginController
*/
public void addBanForAddress(InetAddress address, long duration)
{
- _bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
+ _bannedIps.putIfAbsent(address, Chronos.currentTimeMillis() + duration);
}
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
@@ -294,7 +295,7 @@ public class LoginController
}
if (bi != null)
{
- if ((bi > 0) && (bi < System.currentTimeMillis()))
+ if ((bi > 0) && (bi < Chronos.currentTimeMillis()))
{
_bannedIps.remove(address);
LOGGER.info("Removed expired ip address ban " + address.getHostAddress() + ".");
@@ -541,7 +542,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(ACCOUNT_INFO_UPDATE))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.setString(2, address.getHostAddress());
ps.setString(3, info.getLogin());
ps.execute();
@@ -613,7 +614,7 @@ public class LoginController
{
continue;
}
- if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < System.currentTimeMillis())
+ if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < Chronos.currentTimeMillis())
{
client.close(LoginFailReason.REASON_ACCESS_FAILED);
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/network/LoginClient.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/network/LoginClient.java
index 04455664e2..93194a11c0 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/network/LoginClient.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/network/LoginClient.java
@@ -27,6 +27,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.IIncomingPacket;
import org.l2jmobius.commons.network.IOutgoingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.LoginController;
@@ -82,14 +83,14 @@ public class LoginClient extends ChannelInboundHandler
_addr = address.getAddress();
_channel = ctx.channel();
_sessionId = Rnd.nextInt();
- _connectionStartTime = System.currentTimeMillis();
+ _connectionStartTime = Chronos.currentTimeMillis();
sendPacket(new Init(_scrambledPair.getScrambledModulus(), _blowfishKey.getEncoded(), _sessionId));
}
@Override
public void channelInactive(ChannelHandlerContext ctx)
{
- if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < System.currentTimeMillis()))
+ if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < Chronos.currentTimeMillis()))
{
LoginController.getInstance().removeAuthedLoginClient(getAccount());
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
index 801bc957ae..875759b72a 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
@@ -24,6 +24,8 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* IPv4 filter.
* @author Forsaiken
@@ -59,7 +61,7 @@ public class IPv4Filter implements Runnable
Flood()
{
- lastAccess = System.currentTimeMillis();
+ lastAccess = Chronos.currentTimeMillis();
trys = 0;
}
}
@@ -74,7 +76,7 @@ public class IPv4Filter implements Runnable
}
final int h = hash(addr.getAddress());
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
Flood f;
synchronized (_ipFloodMap)
{
@@ -120,7 +122,7 @@ public class IPv4Filter implements Runnable
{
while (true)
{
- final long reference = System.currentTimeMillis() - (1000 * 300);
+ final long reference = Chronos.currentTimeMillis() - (1000 * 300);
synchronized (_ipFloodMap)
{
final Iterator> it = _ipFloodMap.entrySet().iterator();
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
index e66362d6c0..86b46f1919 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.model.Location;
@@ -137,7 +138,7 @@ public class Parade extends AbstractNpcAI
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
- LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
+ LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
}
void load()
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
index c91b42bb26..7757d82c61 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -304,7 +305,7 @@ public class TalentShow extends AbstractNpcAI
hourDiff *= 3600000;
minDiff *= 60000;
diff = hourDiff + minDiff;
- LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
+ LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
startQuestTimer("Start", diff, null, null); // first start
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
index 940193f4fc..32c8b9f9f1 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
@@ -16,6 +16,7 @@
*/
package ai.areas.GainakUnderground.Lailly;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -64,7 +65,7 @@ public class Lailly extends AbstractNpcAI
case "okay":
{
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
- if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis()))
+ if ((instance != null) && (instance.getEndTime() > Chronos.currentTimeMillis()))
{
switch (instance.getTemplateId())
{
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
index 9118e046f7..60cfac5c02 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
@@ -29,6 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -516,7 +517,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
final GlobalVariablesManager vars = GlobalVariablesManager.getInstance();
final long var = vars.getLong("FourSepulchers" + npcId, 0) + (TIME_ATTACK * 60 * 1000);
- if (var > System.currentTimeMillis())
+ if (var > Chronos.currentTimeMillis())
{
showHtmlFile(player, npcId + "-NE.html", npc, null);
return;
@@ -581,7 +582,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
ThreadPool.schedule(() -> ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers(), TIME_ATTACK * 60 * 1000);
// Save attack time
- vars.set("FourSepulchers" + npcId, System.currentTimeMillis());
+ vars.set("FourSepulchers" + npcId, Chronos.currentTimeMillis());
// Init progress
STORED_PROGRESS.put(sepulcherId, 1); // start from 1
// Start
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
index 244867b7c6..ded5cf9a43 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
@@ -19,6 +19,7 @@ package ai.areas.KeucereusAllianceBase;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
@@ -109,7 +110,7 @@ public class LindviorScene extends AbstractNpcAI
final GregorianCalendar date = new GregorianCalendar();
date.set(Calendar.MINUTE, RESET_MIN);
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
- if (System.currentTimeMillis() >= date.getTimeInMillis())
+ if (Chronos.currentTimeMillis() >= date.getTimeInMillis())
{
date.add(Calendar.DAY_OF_WEEK, 1);
}
@@ -135,7 +136,7 @@ public class LindviorScene extends AbstractNpcAI
{
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
}
- return date.getTimeInMillis() - System.currentTimeMillis();
+ return date.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
index 80dffe38b2..de8ea0aea9 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
@@ -19,6 +19,7 @@ package ai.areas.Rune.RuneCastle.Venom;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -111,7 +112,7 @@ public class Venom extends AbstractNpcAI
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
index a7d7250e8b..c42186c0d0 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -229,7 +230,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
int buffsNow = 0;
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
- if (var < System.currentTimeMillis())
+ if (var < Chronos.currentTimeMillis())
{
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
@@ -254,7 +255,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
reenter.set(Calendar.MINUTE, 0);
reenter.set(Calendar.HOUR_OF_DAY, 13);
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
- if (reenter.getTimeInMillis() <= System.currentTimeMillis())
+ if (reenter.getTimeInMillis() <= Chronos.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 7);
}
@@ -272,7 +273,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
}
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
private void spawnGroupOfMinion(MonsterInstance npc, int[] mobIds)
@@ -317,7 +318,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
zone.clearSkills();
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
else if (event.equalsIgnoreCase("transform"))
{
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
index dd240473aa..19f709d566 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -94,7 +95,7 @@ public class Anakim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ANAKIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_anakim", time, null, null);
@@ -128,7 +129,7 @@ public class Anakim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(ANAKIM, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -268,7 +269,7 @@ public class Anakim extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid())// Anakim and minions
{
// Anti BUGGERS
@@ -300,7 +301,7 @@ public class Anakim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ANAKIM, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(ANAKIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ANAKIM, info);
startQuestTimer("unlock_anakim", respawnTime, null, null);
@@ -360,7 +361,7 @@ public class Anakim extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
index 4a77fb6bfd..fe808aef25 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.MountType;
@@ -169,14 +170,14 @@ public class Antharas extends AbstractNpcAI
_antharas = (GrandBossInstance) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
_antharas.setCurrentHpMp(curr_hp, curr_mp);
addBoss(_antharas);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
break;
}
case DEAD:
{
- final long remain = respawnTime - System.currentTimeMillis();
+ final long remain = respawnTime - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -272,7 +273,7 @@ public class Antharas extends AbstractNpcAI
_antharas.setRandomWalking(false);
_antharas.teleToLocation(181323, 114850, -7623, 32542);
setStatus(IN_FIGHT);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
zone.broadcastPacket(new PlaySound("BS02_A"));
startQuestTimer("CAMERA_1", 23, _antharas, null);
break;
@@ -367,7 +368,7 @@ public class Antharas extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 900000) < Chronos.currentTimeMillis()))
{
setStatus(ALIVE);
for (Creature creature : zone.getCharactersInside())
@@ -619,7 +620,7 @@ public class Antharas extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BOMBER)
{
if (npc.calculateDistance3D(attacker) < 230)
@@ -765,7 +766,7 @@ public class Antharas extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
+ GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
}
private final void refreshAiParams(PlayerInstance attacker, int damage)
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Baium/Baium.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Baium/Baium.java
index faca4576a8..44b37b992a 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Baium/Baium.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Baium/Baium.java
@@ -17,6 +17,7 @@
package ai.bosses.Baium;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.CategoryType;
@@ -136,7 +137,7 @@ public class Baium extends AbstractNpcAI
final int heading = info.getInt("heading");
_baium = (GrandBossInstance) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
_baium.setCurrentHpMp(curr_hp, curr_mp);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
addBoss(_baium);
for (Location loc : ARCHANGEL_LOC)
@@ -149,7 +150,7 @@ public class Baium extends AbstractNpcAI
}
case DEAD:
{
- final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -209,7 +210,7 @@ public class Baium extends AbstractNpcAI
_baium.disableCoreAI(true);
_baium.setRandomWalking(false);
addBoss(_baium);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
@@ -375,7 +376,7 @@ public class Baium extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
{
notifyEvent("CLEAR_ZONE", null, null);
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
@@ -383,7 +384,7 @@ public class Baium extends AbstractNpcAI
}
else if (npc != null)
{
- if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
+ if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
{
npc.setTarget(npc);
npc.doCast(HEAL_OF_BAIUM.getSkill());
@@ -484,7 +485,7 @@ public class Baium extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BAIUM)
{
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
@@ -663,7 +664,7 @@ public class Baium extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
+ GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
}
private void manageSkills(Npc npc)
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
index aa8528926d..dfce75d90b 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -108,7 +109,7 @@ public class Beleth extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("BELETH_UNLOCK", time, null, null);
@@ -349,7 +350,7 @@ public class Beleth extends AbstractNpcAI
c.setImmobilized(false);
}
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, null, null);
startQuestTimer("SPAWN25", 60000, null, null);
break;
@@ -507,7 +508,7 @@ public class Beleth extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((_lastAttack + 900000) < System.currentTimeMillis())
+ if ((_lastAttack + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -708,7 +709,7 @@ public class Beleth extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(REAL_BELETH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
deleteAll();
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Core/Core.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Core/Core.java
index 969bb08788..69dc20dc5d 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Core/Core.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Core/Core.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -89,7 +90,7 @@ public class Core extends AbstractNpcAI
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
@@ -206,7 +207,7 @@ public class Core extends AbstractNpcAI
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
index 5570d66bbc..2357d9625e 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -331,7 +332,7 @@ public class EtisVanEtina extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ETIS_VAN_ETINA1);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_etina", time, null, null);
@@ -359,7 +360,7 @@ public class EtisVanEtina extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
if (GrandBossManager.getInstance().getBossStatus(ETIS_VAN_ETINA1) != ALIVE)
{
@@ -514,7 +515,7 @@ public class EtisVanEtina extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
// Anti BUGGERS
if (!BOSS_ZONE.isInsideZone(attacker))
{
@@ -697,7 +698,7 @@ public class EtisVanEtina extends AbstractNpcAI
_paragon.setInvul(true);
BOSS_ZONE.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_CAN_T_DEFEAT_PARAGON_WHILE_PARAGON_S_MINIONS_ARE_ALIVE, ExShowScreenMessage.TOP_CENTER, 7000, true)));
GrandBossManager.getInstance().setBossStatus(ETIS_VAN_ETINA1, FIGHTING);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
}
}
@@ -738,7 +739,7 @@ public class EtisVanEtina extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ETIS_VAN_ETINA1, DEAD);
final long respawnTime = (Config.ETINA_SPAWN_INTERVAL + getRandom(-Config.ETINA_SPAWN_RANDOM, Config.ETINA_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(ETIS_VAN_ETINA1);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ETIS_VAN_ETINA1, info);
startQuestTimer("unlock_etina", respawnTime, null, null);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java
index 1f6f5e14d5..e0764d2c51 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java
@@ -20,6 +20,7 @@ package ai.bosses.Fafurion;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -84,7 +85,7 @@ public class Fafurion extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(FAFURION_GRANDBOSS_ID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_fafurion", time, null, null);
@@ -449,7 +450,7 @@ public class Fafurion extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(FAFURION_GRANDBOSS_ID, DEAD);
final long respawnTime = (Config.FAFURION_SPAWN_INTERVAL + getRandom(-Config.FAFURION_SPAWN_RANDOM, Config.FAFURION_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(FAFURION_GRANDBOSS_ID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(FAFURION_GRANDBOSS_ID, info);
startQuestTimer("unlock_fafurion", respawnTime, null, null);
if (_stage < 7)
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
index 3ed92d8f08..b499a47575 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.MountType;
@@ -295,7 +296,7 @@ public class IceQueensCastleBattle extends AbstractInstance
{
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
- controller.getVariables().set("TIMER_END", System.currentTimeMillis() + 360000);
+ controller.getVariables().set("TIMER_END", Chronos.currentTimeMillis() + 360000);
}
break;
}
@@ -688,7 +689,7 @@ public class IceQueensCastleBattle extends AbstractInstance
}
case "SHOW_GLAKIAS_TIMER":
{
- final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - System.currentTimeMillis()) / 1000);
+ final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - Chronos.currentTimeMillis()) / 1000);
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
break;
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
index acbc2c3094..6023594423 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
@@ -23,6 +23,7 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -143,11 +144,11 @@ public class ScarletVanHalisha extends AbstractNpcAI
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
}
@@ -248,7 +249,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
case FRINTEZZA_DAEMON_MORPH:
case FRINTEZZA_DAEMON_FIELD:
{
- _lastRangedSkillTime = System.currentTimeMillis();
+ _lastRangedSkillTime = Chronos.currentTimeMillis();
skillRange = 550;
break;
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Helios/Helios.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Helios/Helios.java
index af4d5b4e8e..7e5c37bf69 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Helios/Helios.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Helios/Helios.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +151,7 @@ public class Helios extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(HELIOS3);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_helios", time, null, null);
@@ -496,7 +497,7 @@ public class Helios extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(HELIOS3, DEAD);
final long respawnTime = (Config.HELIOS_SPAWN_INTERVAL + getRandom(-Config.HELIOS_SPAWN_RANDOM, Config.HELIOS_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(HELIOS3);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(HELIOS3, info);
startQuestTimer("unlock_helios", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
index 81fd9ae6e8..9c32d36ecf 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.Movie;
@@ -121,7 +122,7 @@ public class Kelbim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(KELBIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_kelbim", time, null, null);
@@ -156,7 +157,7 @@ public class Kelbim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(KELBIM, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -193,7 +194,7 @@ public class Kelbim extends AbstractNpcAI
{
_kelbimBoss = (GrandBossInstance) addSpawn(KELBIM, -56340, 60801, -269, 54262, false, 0);
GrandBossManager.getInstance().addBoss(_kelbimBoss);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
startQuestTimer("stage_all_random_area_attack", Rnd.get(2, 3) * 60000, null, null);
break;
@@ -369,7 +370,7 @@ public class Kelbim extends AbstractNpcAI
{
if (npc.getId() == KELBIM)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
switch (_bossStage)
{
@@ -434,7 +435,7 @@ public class Kelbim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(KELBIM, DEAD);
final long respawnTime = (Config.KELBIM_SPAWN_INTERVAL + getRandom(-Config.KELBIM_SPAWN_RANDOM, Config.KELBIM_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(KELBIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(KELBIM, info);
startQuestTimer("unlock_kelbim", respawnTime, null, null);
startQuestTimer("end_kelbim", 1800000, null, null);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
index 4bbabf6033..5baa3831ec 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -93,7 +94,7 @@ public class Lilith extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LILITH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lilith", time, null, null);
@@ -127,7 +128,7 @@ public class Lilith extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(LILITH, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -251,7 +252,7 @@ public class Lilith extends AbstractNpcAI
// Spawn the rb
_lilithBoss = addSpawn(LILITH, 185062, -9605, -5499, 15640, false, 0);
GrandBossManager.getInstance().addBoss((GrandBossInstance) _lilithBoss);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
startQuestTimer("end_lilith", 60 * 60000, null, null); // 1h
}
@@ -261,7 +262,7 @@ public class Lilith extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid()) // Lilith and minions
{
// Anti BUGGERS
@@ -293,7 +294,7 @@ public class Lilith extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LILITH, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(LILITH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LILITH, info);
startQuestTimer("unlock_lilith", respawnTime, null, null);
@@ -353,7 +354,7 @@ public class Lilith extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
@Override
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
index 6b02643bc0..63811284a1 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -213,7 +214,7 @@ public class Lindvior extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lindvior", time, null, null);
@@ -863,7 +864,7 @@ public class Lindvior extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
final long respawnTime = (Config.LINDVIOR_SPAWN_INTERVAL + getRandom(-Config.LINDVIOR_SPAWN_RANDOM, Config.LINDVIOR_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
startQuestTimer("unlock_lindvior", respawnTime, null, null);
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
index 8f5d996e6c..5108b80c03 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -88,7 +89,7 @@ public class Orfen extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for Orfen from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if Orfen is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -309,7 +310,7 @@ public class Orfen extends AbstractNpcAI
startQuestTimer("orfen_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ORFEN, info);
cancelQuestTimer("check_minion_loc", npc, null);
startQuestTimer("despawn_minions", 20000, null, null);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index f2869a3fe9..c00a82fb97 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -96,7 +97,7 @@ public class QueenAnt extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for queen ant from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if queen ant is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -367,7 +368,7 @@ public class QueenAnt extends AbstractNpcAI
cancelQuestTimer("heal", null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(QUEEN, info);
_nurses.clear();
_larva.deleteMe();
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
index eda49595a1..fd26faf27c 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.QueenShyeed;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -87,7 +88,7 @@ public class QueenShyeed extends AbstractNpcAI
private void spawnShyeed()
{
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
- final long remain = respawn != 0 ? respawn - System.currentTimeMillis() : 0;
+ final long remain = respawn != 0 ? respawn - Chronos.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("respawn", remain, null, null);
@@ -103,7 +104,7 @@ public class QueenShyeed extends AbstractNpcAI
private void startRespawn()
{
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
- GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(System.currentTimeMillis() + respawnTime));
+ GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(Chronos.currentTimeMillis() + respawnTime));
startQuestTimer("respawn", respawnTime, null, null);
// MOB_BUFF_ZONE.setEnabled(false);
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
index e6cd81dbf4..b02a51942f 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -137,7 +138,7 @@ public class Ramona extends AbstractNpcAI
addAttackId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3);
addSpawnId(RAMONA_1, RAMONA_2, RAMONA_3);
- final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - System.currentTimeMillis();
+ final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - Chronos.currentTimeMillis();
if (temp > 0)
{
_boss = Status.DEAD;
@@ -167,7 +168,7 @@ public class Ramona extends AbstractNpcAI
npc.setInvul(false);
cancelQuestTimers("SPAWN_MS");
startQuestTimer("CHECK_ACTIVITY_TASK", 5000, null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
}
break;
}
@@ -186,7 +187,7 @@ public class Ramona extends AbstractNpcAI
startQuestTimer("GENERATOR_2", getRandom(900000, 1200000), null, null);
startQuestTimer("GENERATOR_3", getRandom(1500000, 1800000), null, null);
startQuestTimer("GENERATOR_4", getRandom(2100000, 2400000), null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("RAMONA1_SKILL", 6000, _ramona1, null);
break;
}
@@ -300,7 +301,7 @@ public class Ramona extends AbstractNpcAI
}
case "CHECK_ACTIVITY_TASK":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
for (Creature creature : ZONE.getCharactersInside())
{
@@ -396,17 +397,17 @@ public class Ramona extends AbstractNpcAI
}
case RAMONA_1:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
@@ -540,7 +541,7 @@ public class Ramona extends AbstractNpcAI
{
_boss = Status.DEAD;
final long respawnTime = (Config.RAMONA_SPAWN_INTERVAL + getRandom(-Config.RAMONA_SPAWN_RANDOM, Config.RAMONA_SPAWN_RANDOM)) * 3600000;
- GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, Chronos.currentTimeMillis() + respawnTime);
startQuestTimer("RAMONA_UNLOCK", respawnTime, null, null);
startQuestTimer("END_RAMONA", 90000, null, null);
break;
@@ -568,13 +569,13 @@ public class Ramona extends AbstractNpcAI
case RAMONA_1:
{
_boss = Status.IN_FIGHT;
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
index 4d4eb8653a..be58208558 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.Sailren;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -71,7 +72,7 @@ public class Sailren extends AbstractNpcAI
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
- final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
+ final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - Chronos.currentTimeMillis();
if (remain > 0)
{
STATUS = Status.DEAD;
@@ -118,7 +119,7 @@ public class Sailren extends AbstractNpcAI
{
takeItems(player, GAZKH, 1);
STATUS = Status.IN_FIGHT;
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
for (PlayerInstance member : player.getParty().getMembers())
{
if (member.isInsideRadius3D(npc, 1000))
@@ -237,7 +238,7 @@ public class Sailren extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
+ if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < Chronos.currentTimeMillis()))
{
cancelQuestTimer("TIME_OUT", null, null);
notifyEvent("TIME_OUT", null, null);
@@ -257,7 +258,7 @@ public class Sailren extends AbstractNpcAI
{
if (zone.isCharacterInZone(attacker))
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -274,7 +275,7 @@ public class Sailren extends AbstractNpcAI
STATUS = Status.DEAD;
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
final long respawnTime = RESPAWN * 3600000;
- GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set("SailrenRespawn", Chronos.currentTimeMillis() + respawnTime);
cancelQuestTimer("CHECK_ATTACK", null, null);
cancelQuestTimer("TIME_OUT", null, null);
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
index 0c824fd3b2..523f53e898 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -326,7 +327,7 @@ public class Trasken extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_trasken", time, null, null);
@@ -604,7 +605,7 @@ public class Trasken extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
startQuestTimer("unlock_trasken", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
index 94d29e346e..c8e0f497af 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.MountType;
@@ -129,7 +130,7 @@ public class Valakas extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for valakas from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (temp > 0)
{
// The time has not yet expired. Mark Valakas as currently locked (dead).
@@ -168,7 +169,7 @@ public class Valakas extends AbstractNpcAI
if (status == FIGHTING)
{
// stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
startQuestTimer("regen_task", 60000, valakas, null, true);
startQuestTimer("skill_task", 2000, valakas, null, true);
@@ -196,7 +197,7 @@ public class Valakas extends AbstractNpcAI
if (event.equalsIgnoreCase("beginning"))
{
// Stores current time
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
// Teleport Valakas to his lair.
npc.teleToLocation(VALAKAS_LAIR);
@@ -220,7 +221,7 @@ public class Valakas extends AbstractNpcAI
else if (event.equalsIgnoreCase("regen_task"))
{
// Inactivity task - 15min
- if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
+ if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < Chronos.currentTimeMillis()))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
@@ -416,7 +417,7 @@ public class Valakas extends AbstractNpcAI
npc.setTarget(attacker);
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
}
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -447,7 +448,7 @@ public class Valakas extends AbstractNpcAI
startQuestTimer("valakas_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
return super.onKill(npc, killer, isSummon);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
index ddc6ff9e74..40bd1cf6c2 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
@@ -46,8 +46,8 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcManorBypass;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.teleporter.TeleportHolder;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index 7278c7327f..e1575721d3 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -26,6 +26,7 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -153,7 +154,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -189,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
@@ -247,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
@@ -296,7 +297,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0]");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
sb.append(" | ");
sb.append(auction.getHighestBid());
sb.append(" | ");
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
index f469c39159..2362aa9446 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -21,6 +21,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.Location;
@@ -73,7 +74,7 @@ public class ProvisionalHalls extends AbstractNpcAI
if (resetTime > 0)
{
cancelQuestTimers(HALL_RESET_VAR + id);
- startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
}
}
}
@@ -126,7 +127,7 @@ public class ProvisionalHalls extends AbstractNpcAI
for (int id : CLAN_HALLS.keySet())
{
- if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < Chronos.currentTimeMillis()))
{
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
@@ -137,7 +138,7 @@ public class ProvisionalHalls extends AbstractNpcAI
clanHall.setOwner(player.getClan());
}
player.sendMessage("Congratulations! You now own a provisional clan hall!");
- startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
return null;
}
}
@@ -177,7 +178,7 @@ public class ProvisionalHalls extends AbstractNpcAI
else if (event.startsWith(HALL_RESET_VAR))
{
final String id = event.replace(HALL_RESET_VAR, "");
- if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
{
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
if (clanId > 0)
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index 18f813b1a2..a3c74220a9 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -19,6 +19,7 @@ package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -111,7 +112,7 @@ public class TrainingCamp extends AbstractNpcAI
player.teleToLocation(TRAINING_LOCATION);
player.setImmobilized(true);
// @Sdw: Here we are supposed to send ExUserInfoEquipSlot with a fake equip of a SLS, feels ugly to me, not doing it.
- player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
+ player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), Chronos.currentTimeMillis(), -1));
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
@@ -203,7 +204,7 @@ public class TrainingCamp extends AbstractNpcAI
final TrainingHolder holder = player.getTraingCampInfo();
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
index 49dfa6b963..6140daa716 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
@@ -16,6 +16,7 @@
*/
package events.FreyaCelebration;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -79,7 +80,7 @@ public class FreyaCelebration extends LongTimeEvent
{
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
if (currentTime > reuseTime)
{
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
index cce5b52533..d97b3c74db 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
@@ -16,6 +16,7 @@
*/
package events.GiftOfVitality;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -94,9 +95,9 @@ public class GiftOfVitality extends LongTimeEvent
case "vitality":
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -110,7 +111,7 @@ public class GiftOfVitality extends LongTimeEvent
{
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
htmltext = "4306-okvitality.htm";
}
break;
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/HappyHours/HappyHours.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/HappyHours/HappyHours.java
index 536ed53fe2..2d3261f1c3 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/HappyHours/HappyHours.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/HappyHours/HappyHours.java
@@ -16,6 +16,7 @@
*/
package events.HappyHours;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -39,7 +40,7 @@ public class HappyHours extends LongTimeEvent
// Other
private static final int MIN_LEVEL = 20;
private static final int REWARD_INTERVAL = 60 * 60 * 1000; // 1 hour
- private static long _lastRewardTime = System.currentTimeMillis();
+ private static long _lastRewardTime = Chronos.currentTimeMillis();
private HappyHours()
{
@@ -76,9 +77,9 @@ public class HappyHours extends LongTimeEvent
{
if (isEventPeriod())
{
- if ((System.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
+ if ((Chronos.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
{
- _lastRewardTime = System.currentTimeMillis();
+ _lastRewardTime = Chronos.currentTimeMillis();
final ExShowScreenMessage screenMsg = new ExShowScreenMessage("You obtained 20 Sibi's coins.", ExShowScreenMessage.TOP_CENTER, 7000, 0, true, true);
final SystemMessage systemMsg = new SystemMessage(SystemMessageId.YOU_HAVE_OBTAINED_S1_SIBI_S_COINS);
systemMsg.addInt(20);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
index 038d7883b0..7fb3b481dd 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
@@ -16,6 +16,7 @@
*/
package events.LoveYourGatekeeper;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -58,9 +59,9 @@ public class LoveYourGatekeeper extends LongTimeEvent
if (player.getAdena() >= PRICE)
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -73,7 +74,7 @@ public class LoveYourGatekeeper extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, PRICE);
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
}
}
else
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
index 48a2a27c8d..12d453b3a0 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
@@ -16,6 +16,7 @@
*/
package events.MasterOfEnchanting;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -86,7 +87,7 @@ public class MasterOfEnchanting extends LongTimeEvent
}
else if (event.equalsIgnoreCase("buy_scroll_24"))
{
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
final String value = player.getVariables().getString("MasterOfEnchanting", "");
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
@@ -100,7 +101,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
@@ -134,7 +135,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/SavingSanta/SavingSanta.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
index 4f95514f8c..b6900127dc 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -324,7 +325,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_rewardedPlayers.containsKey(pl.getAccountName()))
{
- final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
+ final long elapsedTimeSinceLastRewarded = Chronos.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
{
continue;
@@ -333,7 +334,7 @@ public class SavingSanta extends LongTimeEvent
else
{
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
- if ((System.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
+ if ((Chronos.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
{
_rewardedPlayers.put(pl.getAccountName(), time);
continue;
@@ -343,8 +344,8 @@ public class SavingSanta extends LongTimeEvent
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
- _rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
- player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
+ _rewardedPlayers.put(pl.getAccountName(), Chronos.currentTimeMillis());
+ player.getVariables().set("LAST_SANTA_REWARD", Chronos.currentTimeMillis());
startQuestTimer("SantaRewarding0", 500, santa, pl);
}
}
@@ -437,7 +438,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
{
startQuestTimer("SantaBlessings", 15000, null, null);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Npc santaHelper1 : _santaHelpers)
{
for (PlayerInstance plb : World.getInstance().getVisibleObjects(santaHelper1, PlayerInstance.class))
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java
index 5c332ec4ee..4e185fe8e2 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java
@@ -18,6 +18,7 @@ package events.TrainingWithDandy;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -66,7 +67,7 @@ public class TrainingWithDandy extends LongTimeEvent
{
npc.setTarget(player);
npc.doCast(DANDY_CH.getSkill());
- player.getVariables().set(GIVE_DANDI_BUFF_VAR, System.currentTimeMillis());
+ player.getVariables().set(GIVE_DANDI_BUFF_VAR, Chronos.currentTimeMillis());
player.broadcastStatusUpdate();
htmltext = "33894-2.htm";
break;
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
index 64d4112e1f..729838d853 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Collection;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.CursedWeapon;
@@ -209,7 +210,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
}
- cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
+ cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
cw.reActivate();
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
index 9801093a20..0e4285c8e3 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Calendar;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -66,7 +67,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
{
final Calendar nextChangeDate = Calendar.getInstance();
- nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
+ nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
html.replace("%sodtime%", nextChangeDate.getTime().toString());
}
else
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
index 72117290b3..6855d75da1 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.World;
@@ -117,7 +118,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
int hours = 0;
int minutes = 0;
final int id = entry.getKey();
- final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
if (remainingTime > 0)
{
hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
index 5fffc77ae3..8c3faede2d 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -233,7 +234,7 @@ public class AdminPunishment implements IAdminCommandHandler
long expirationTime = Integer.parseInt(exp);
if (expirationTime > 0)
{
- expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
+ expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
}
final PunishmentAffect affect = PunishmentAffect.getByName(af);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
index aa1d6dd435..ae1bb4e0b2 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -60,7 +61,7 @@ public class AdminServerInfo implements IAdminCommandHandler
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
- html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
+ html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
html.replace("%serverUpTime%", getServerUpTime());
html.replace("%onlineAll%", getPlayersCount("ALL"));
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
@@ -76,7 +77,7 @@ public class AdminServerInfo implements IAdminCommandHandler
private String getServerUpTime()
{
- long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
+ long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
final long days = TimeUnit.MILLISECONDS.toDays(time);
time -= TimeUnit.DAYS.toMillis(days);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
index ff3b82a10f..21489c89f6 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IBypassHandler;
@@ -133,7 +134,7 @@ public class FindPvP implements IBypassHandler
player.setSpawnProtection(true);
if (!player.isGM())
{
- player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
player.startPvPFlag();
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
index a81161c50a..adb3c27701 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.dailymissionhandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -61,9 +62,9 @@ public class LoginMonthDailyMissionHandler extends AbstractDailyMissionHandler
final long lastCompleted = entry.getLastCompleted();
if (lastCompleted == 0) // Initial entry.
{
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
}
- else if ((System.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
+ else if ((Chronos.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
index 9fee9dd50e..0322107487 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
@@ -18,6 +18,7 @@ package handlers.dailymissionhandlers;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -63,7 +64,7 @@ public class LoginWeekendDailyMissionHandler extends AbstractDailyMissionHandler
final int currentDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
final long lastCompleted = entry.getLastCompleted();
if (((currentDay == Calendar.SATURDAY) || (currentDay == Calendar.SUNDAY)) // Reward only on weekend.
- && ((lastCompleted == 0) || ((System.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
+ && ((lastCompleted == 0) || ((Chronos.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
index 71928b144a..c2ea6f7a5a 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.punishmenthandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.model.World;
@@ -126,7 +127,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 245af11bfa..2abbe8e8e8 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -17,6 +17,7 @@
package handlers.punishmenthandlers;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
@@ -180,7 +181,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
index 3dd1cdc97d..fd92c92ed9 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Ban implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
index f653561c0d..85b92a163b 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class BanChat implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
index cf3736fc0e..c21718ad0c 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Jail implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
index 43b6df41dc..a57194664d 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
@@ -18,6 +18,7 @@ package handlers.usercommandhandlers;
import java.text.SimpleDateFormat;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -46,7 +47,7 @@ public class ClanPenalty implements IUserCommandHandler
final StringBuilder htmlContent = new StringBuilder(500);
htmlContent.append("");
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append("Unable to join a clan. | ");
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
@@ -54,7 +55,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append(" | Unable to create a clan. | ");
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
@@ -62,7 +63,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
+ if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
{
htmlContent.append(" | Unable to invite a clan member. | ");
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/usercommandhandlers/Time.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
index 530047a4f2..57bd48cd81 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Time implements IUserCommandHandler
player.sendPacket(sm);
if (Config.DISPLAY_SERVER_TIME)
{
- player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
+ player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
}
return true;
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
index a2eab150c7..f727b3518f 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
@@ -18,6 +18,7 @@ package handlers.voicedcommandhandlers;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
@@ -103,7 +104,7 @@ public class ChatAdmin implements IVoicedCommandHandler
return false;
}
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
if (expirationTime > 0)
{
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
index 213e03e20a..5bf36c47d0 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
@@ -19,6 +19,7 @@ package handlers.voicedcommandhandlers;
import java.text.SimpleDateFormat;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Premium implements IVoicedCommandHandler
html.append(" |
Spoil Chance: x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " |
");
html.append("Spoil Amount: x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " |
");
html.append("Expires: " + format.format(endDate) + " |
");
- html.append("Current Date: " + format.format(System.currentTimeMillis()) + "
|
");
+ html.append("Current Date: " + format.format(Chronos.currentTimeMillis()) + "
|
");
html.append("Premium Info & Rules
|
");
html.append("1. Premium accounts CAN NOT BE TRANSFERED. |
");
html.append("2. Premium does not effect party members. |
");
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
index 4dedee6473..6a07191990 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -156,7 +157,7 @@ public class CastleDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -174,7 +175,7 @@ public class CastleDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
index 686b01379b..ea8ca11b83 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -169,7 +170,7 @@ public class FortressDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -197,7 +198,7 @@ public class FortressDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
index 727b183de9..c33d4de70c 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
@@ -469,7 +470,7 @@ public class Kamaloka extends AbstractInstance
continue;
}
// if found instance still can't be reentered - exit
- if (System.currentTimeMillis() < entry.getValue().longValue())
+ if (Chronos.currentTimeMillis() < entry.getValue().longValue())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
sm.addPcName(partyMember);
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
index b3de2f227a..31fa72d28c 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
@@ -260,7 +261,7 @@ public class PailakaRuneCastle extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first wave
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
}
@@ -280,7 +281,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
@@ -309,7 +310,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/Chronos.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/Chronos.java
new file mode 100644
index 0000000000..a4d15f77e5
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/Chronos.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2021 Pantelis Andrianakis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.l2jmobius.commons.util;
+
+/**
+ * Chronos updates an internal long value with System.currentTimeMillis() approximately every 1 millisecond.
+ * To get the current time in milliseconds use Chronos.currentTimeMillis()
+ * @author Pantelis Andrianakis
+ * @version February 3rd 2021
+ */
+public class Chronos extends Thread
+{
+ private long _currentTimeMillis = System.currentTimeMillis();
+
+ public Chronos()
+ {
+ super.setName("Chronos");
+ super.setPriority(MAX_PRIORITY);
+ super.setDaemon(true);
+ super.start();
+ }
+
+ @Override
+ public void run()
+ {
+ while (true)
+ {
+ _currentTimeMillis = System.currentTimeMillis();
+
+ // Sleep for approximately 1 millisecond.
+ try
+ {
+ Thread.sleep(1);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /**
+ * Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond,the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
+ *
+ * See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).
+ * @return the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+ */
+ public static long currentTimeMillis()
+ {
+ return getInstance()._currentTimeMillis;
+ }
+
+ public static Chronos getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final Chronos INSTANCE = new Chronos();
+ }
+}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java
index 6d14177052..681efa0e52 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java
@@ -32,6 +32,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.enums.ServerMode;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.DeadLockDetector;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.BotReportTable;
@@ -183,7 +184,7 @@ public class GameServer
public GameServer() throws Exception
{
- final long serverLoadStart = System.currentTimeMillis();
+ final long serverLoadStart = Chronos.currentTimeMillis();
// GUI
if (!GraphicsEnvironment.isHeadless())
@@ -467,7 +468,7 @@ public class GameServer
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
- LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
+ LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
ClientNetworkManager.getInstance().start();
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameTimeController.java
index aa4d359090..48391b466d 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameTimeController.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange;
@@ -97,7 +98,7 @@ public class GameTimeController extends Thread
*/
public int getGameTicks()
{
- return (int) ((System.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
+ return (int) ((Chronos.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
}
/**
@@ -155,7 +156,7 @@ public class GameTimeController extends Thread
while (true)
{
- nextTickTime = ((System.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
+ nextTickTime = ((Chronos.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
try
{
@@ -166,7 +167,7 @@ public class GameTimeController extends Thread
LOGGER.log(Level.WARNING, getClass().getSimpleName(), e);
}
- sleepTime = nextTickTime - System.currentTimeMillis();
+ sleepTime = nextTickTime - Chronos.currentTimeMillis();
if (sleepTime > 0)
{
try
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
index 2fcae24603..cfb16ebb07 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -42,7 +43,7 @@ public class ItemsAutoDestroy
public synchronized void addItem(ItemInstance item)
{
- item.setDropTime(System.currentTimeMillis());
+ item.setDropTime(Chronos.currentTimeMillis());
_items.add(item);
}
@@ -53,7 +54,7 @@ public class ItemsAutoDestroy
return;
}
- final long curtime = System.currentTimeMillis();
+ final long curtime = Chronos.currentTimeMillis();
final Iterator itemIterator = _items.iterator();
while (itemIterator.hasNext())
{
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/Shutdown.java
index 5279bac36d..d7328247aa 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/Shutdown.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseBackup;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
@@ -529,19 +530,19 @@ public class Shutdown extends Thread
protected void restartCounter()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
}
protected long getEstimatedTimeAndRestartCounter()
{
- final long toReturn = System.currentTimeMillis() - _startTime;
+ final long toReturn = Chronos.currentTimeMillis() - _startTime;
restartCounter();
return toReturn;
}
protected long getEstimatedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/CreatureAI.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/CreatureAI.java
index 22de59f51a..e03e0463be 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/CreatureAI.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/CreatureAI.java
@@ -33,6 +33,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -308,7 +309,7 @@ public class CreatureAI extends AbstractAI
if (_actor.isAttackingNow())
{
- ThreadPool.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(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index fa5cca3384..26734231aa 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -39,7 +40,7 @@ public class WarehouseCacheManager
public void addCacheTask(PlayerInstance pc)
{
- CACHED_WH.put(pc, System.currentTimeMillis());
+ CACHED_WH.put(pc, Chronos.currentTimeMillis());
}
public void remCacheTask(PlayerInstance pc)
@@ -56,7 +57,7 @@ public class WarehouseCacheManager
@Override
public void run()
{
- final long cTime = System.currentTimeMillis();
+ final long cTime = Chronos.currentTimeMillis();
for (Entry entry : CACHED_WH.entrySet())
{
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/BotReportTable.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/BotReportTable.java
index 0e2f9777b7..46e025bd3d 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/BotReportTable.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/BotReportTable.java
@@ -39,6 +39,7 @@ import org.xml.sax.helpers.DefaultHandler;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -124,7 +125,7 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() < c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() < c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
}
@@ -290,7 +291,7 @@ public class BotReportTable
return false;
}
- final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
+ final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
@@ -301,7 +302,7 @@ public class BotReportTable
}
}
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
if (rcd == null)
{
rcd = new ReportedCharData();
@@ -418,12 +419,12 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() > c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() > c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
}
- ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
+ ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - Chronos.currentTimeMillis());
}
catch (Exception e)
{
@@ -464,7 +465,7 @@ public class BotReportTable
{
if (map.containsKey(objectId))
{
- return (System.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
+ return (Chronos.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
}
return true;
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/sql/ClanTable.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
index 4e4da8df06..10f7e0b311 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.enums.ClanWarState;
@@ -171,7 +172,7 @@ public class ClanTable
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
return null;
}
- if (System.currentTimeMillis() < player.getClanCreateExpiryTime())
+ if (Chronos.currentTimeMillis() < player.getClanCreateExpiryTime())
{
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
return null;
@@ -346,7 +347,7 @@ public class ClanTable
{
destroyClan(clanId);
}
- }, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
+ }, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
}
public boolean isAllyExists(String allyName)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index 49b0381c91..c3ab796fbf 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World;
@@ -185,7 +186,7 @@ public class OfflineTraderTable
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- if (cal.getTimeInMillis() <= System.currentTimeMillis())
+ if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
{
continue;
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
index 771af1a0a5..8f51b3f599 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.enums.SpecialItemType;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -114,7 +115,7 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
final DailyMissionPlayerEntry entry = getPlayerEntry(player.getObjectId(), true);
entry.setStatus(DailyMissionStatus.COMPLETED);
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
entry.setRecentlyCompleted(true);
storePlayerEntry(entry);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
index 025c3208e6..ecb5b8dc95 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.enums.PlayerAction;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -115,7 +116,7 @@ public class AdminCommandHandler implements IHandler
{
- final long begin = System.currentTimeMillis();
+ final long begin = Chronos.currentTimeMillis();
try
{
if (Config.GMAUDIT)
@@ -133,7 +134,7 @@ public class AdminCommandHandler implements IHandler 5000)
{
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
index fedf7cd9dc..ee7642eca5 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -48,7 +49,7 @@ public class AntiFeedManager
*/
public void setLastDeathTime(int objectId)
{
- _lastDeathTimes.put(objectId, System.currentTimeMillis());
+ _lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
}
/**
@@ -81,7 +82,7 @@ public class AntiFeedManager
return false;
}
- if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
+ if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((Chronos.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
{
return false;
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index 3d8c1f50e4..301806d976 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ManorMode;
@@ -276,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
- ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
+ ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
}
public void changeMode()
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
index 4a91b5c214..64143c7c65 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.model.CursedWeapon;
import org.l2jmobius.gameserver.model.actor.Attackable;
@@ -313,7 +314,7 @@ public class CursedWeaponsManager implements IXmlReader
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING);
sm.addString(cw.getName());
// sm.addItemName(cw.getItemId());
- sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
+ sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
player.sendPacket(sm);
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index 72602e0968..babf2e1476 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -193,7 +194,7 @@ public class DBSpawnManager
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
- final long respawnTime = System.currentTimeMillis() + respawnDelay;
+ final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
info.set("currentHP", npc.getMaxHp());
info.set("currentMP", npc.getMaxMp());
info.set("respawnTime", respawnTime);
@@ -235,7 +236,7 @@ public class DBSpawnManager
}
final int npcId = spawn.getId();
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SpawnTable.getInstance().addNewSpawn(spawn, false);
if ((respawnTime == 0) || (time > respawnTime))
{
@@ -257,7 +258,7 @@ public class DBSpawnManager
}
else
{
- final long spawnTime = respawnTime - System.currentTimeMillis();
+ final long spawnTime = respawnTime - Chronos.currentTimeMillis();
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index 60a818cab6..06cce0d3a3 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -21,6 +21,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -104,7 +105,7 @@ public class GraciaSeedsManager
case 2:
{
// Conquest Complete state, if too much time is passed than change to defense state
- final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
+ final long timePast = Chronos.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
if (timePast >= Config.SOD_STAGE_2_LENGTH)
{
// change to Attack state because Defend statet is not implemented
@@ -172,7 +173,7 @@ public class GraciaSeedsManager
public void setSoDState(int value, boolean doSave)
{
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
- _SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
+ _SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
_SoDState = value;
// reset number of Tiat kills
if (_SoDState == 1)
@@ -198,7 +199,7 @@ public class GraciaSeedsManager
}
case 2:
{
- return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
+ return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
}
case 3:
{
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index d595a5befa..052f8984d2 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.util.PrimeFinder;
/**
@@ -85,7 +86,7 @@ public class IdManager
try (Connection con = DatabaseFactory.getConnection();
Statement statement = con.createStatement())
{
- final long cleanupStart = System.currentTimeMillis();
+ final long cleanupStart = Chronos.currentTimeMillis();
int cleanCount = 0;
// Characters
@@ -157,7 +158,7 @@ public class IdManager
statement.executeUpdate("UPDATE characters SET clanid=0, clan_privs=0, wantspeace=0, subpledge=0, lvl_joined_academy=0, apprentice=0, sponsor=0, clan_join_expiry_time=0, clan_create_expiry_time=0 WHERE characters.clanid > 0 AND characters.clanid NOT IN (SELECT clan_id FROM clan_data);");
statement.executeUpdate("UPDATE fort SET owner=0 WHERE owner NOT IN (SELECT clan_id FROM clan_data);");
- LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((System.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
+ LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((Chronos.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
}
catch (Exception e)
{
@@ -173,7 +174,7 @@ public class IdManager
{
try (PreparedStatement statement = con.prepareStatement(line))
{
- statement.setLong(1, System.currentTimeMillis());
+ statement.setLong(1, Chronos.currentTimeMillis());
cleanCount += statement.executeUpdate();
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
index d47e436ace..d1f8cd35e2 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
@@ -40,6 +40,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.data.xml.SpawnData;
@@ -521,7 +522,7 @@ public class InstanceManager implements IXmlReader
{
// Check if instance penalty passed
final long time = rs.getLong("time");
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
// Load params
final int charId = rs.getInt("charId");
@@ -556,7 +557,7 @@ public class InstanceManager implements IXmlReader
final List invalidPenalty = new ArrayList<>(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- if (entry.getValue() <= System.currentTimeMillis())
+ if (entry.getValue() <= Chronos.currentTimeMillis())
{
invalidPenalty.add(entry.getKey());
}
@@ -615,7 +616,7 @@ public class InstanceManager implements IXmlReader
// If reenter time is higher then current, delete it
final long time = playerData.get(id);
- if (time <= System.currentTimeMillis())
+ if (time <= Chronos.currentTimeMillis())
{
deleteInstanceTime(player, id);
return -1;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 739f67e9a9..dfb4734ca5 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -83,7 +84,7 @@ public class ItemsOnGroundManager implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(str))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.execute();
}
catch (Exception e)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
index df45860d40..d429a2f8c9 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Mentee;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -145,7 +146,7 @@ public class MentorManager
{
final PlayerInstance player = World.getInstance().getPlayer(mentorId);
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
- vars.set("Mentor-Penalty-" + mentorId, String.valueOf(System.currentTimeMillis() + penalty));
+ vars.set("Mentor-Penalty-" + mentorId, String.valueOf(Chronos.currentTimeMillis() + penalty));
}
public long getMentorPenalty(int mentorId)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
index b6c44953b1..80bfff5fdb 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.Containers;
@@ -79,7 +80,7 @@ public class PremiumManager
final PlayerInstance player = event.getPlayer();
final String accountName = player.getAccountName();
loadPremiumData(accountName);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
final long premiumExpiration = getPremiumExpiration(accountName);
player.setPremiumStatus(premiumExpiration > now);
if (player.hasPremiumStatus())
@@ -153,7 +154,7 @@ public class PremiumManager
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
{
final long addTime = timeUnit.toMillis(timeValue);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
// new premium task at least from now
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
final long newPremiumExpiration = oldPremiumExpiration + addTime;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
index 9617f26e43..08193f9c5b 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
@@ -71,7 +72,7 @@ public class PunishmentManager
final String punishedBy = rset.getString("punishedBy");
if ((type != null) && (affect != null))
{
- if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
+ if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
{
expired++;
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
index 687d1288b9..ab73056bb1 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -424,7 +425,7 @@ public class BlockChecker
// Start up player parameters
setUpPlayers();
// Set the started time
- _startedTime = System.currentTimeMillis() + 300000;
+ _startedTime = Chronos.currentTimeMillis() + 300000;
}
}
@@ -524,7 +525,7 @@ public class BlockChecker
_redPoints += _numOfBoxes / 2;
_bluePoints += _numOfBoxes / 2;
- final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((_startedTime - Chronos.currentTimeMillis()) / 1000);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
_holder.broadCastPacketToTeam(changePoints);
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/CursedWeapon.java
index 9d28f739b9..e8356c8e45 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/CursedWeapon.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
@@ -237,7 +238,7 @@ public class CursedWeapon implements INamable
@Override
public void run()
{
- if (System.currentTimeMillis() >= _endTime)
+ if (Chronos.currentTimeMillis() >= _endTime)
{
endOfLife();
}
@@ -366,7 +367,7 @@ public class CursedWeapon implements INamable
public void reActivate()
{
_isActivated = true;
- if ((_endTime - System.currentTimeMillis()) <= 0)
+ if ((_endTime - Chronos.currentTimeMillis()) <= 0)
{
endOfLife();
}
@@ -384,7 +385,7 @@ public class CursedWeapon implements INamable
dropIt(attackable, player);
// Start the Life Task
- _endTime = System.currentTimeMillis() + (_duration * 60000);
+ _endTime = Chronos.currentTimeMillis() + (_duration * 60000);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
return true;
}
@@ -678,7 +679,7 @@ public class CursedWeapon implements INamable
public long getTimeLeft()
{
- return _endTime - System.currentTimeMillis();
+ return _endTime - Chronos.currentTimeMillis();
}
public void goTo(PlayerInstance player)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/ItemInfo.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/ItemInfo.java
index 9ea4c13763..16f3dfe23e 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/ItemInfo.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/ItemInfo.java
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.model.buylist.Product;
import org.l2jmobius.gameserver.model.ensoul.EnsoulOption;
@@ -151,14 +152,14 @@ public class ItemInfo
_soulCrystalOptions = item.getSpecialAbilities();
_soulCrystalSpecialOptions = item.getAdditionalSpecialAbilities();
_visualId = item.getVisualId();
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(ItemInstance item, int change)
{
this(item);
_change = change;
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(TradeItem item)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Message.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Message.java
index e6b1c31d32..53d2f20768 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Message.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Message.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.enums.MailType;
@@ -104,7 +105,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = text;
- _expiration = (isCod ? System.currentTimeMillis() + (COD_EXPIRATION * 3600000) : System.currentTimeMillis() + (EXPIRATION * 3600000));
+ _expiration = (isCod ? Chronos.currentTimeMillis() + (COD_EXPIRATION * 3600000) : Chronos.currentTimeMillis() + (EXPIRATION * 3600000));
_hasAttachments = false;
_unread = true;
_deletedBySender = false;
@@ -123,7 +124,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_reqAdena = 0;
_hasAttachments = false;
_unread = true;
@@ -143,7 +144,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_hasAttachments = false;
_unread = true;
_deletedBySender = true;
@@ -162,7 +163,7 @@ public class Message
_receiverId = msg.getSenderId();
_subject = "";
_content = "";
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_deletedByReceiver = false;
@@ -182,7 +183,7 @@ public class Message
_receiverId = receiverId;
_subject = "";
_content = item.getName();
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_messageType = mailType;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Petition.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Petition.java
index b19b6f9025..d3f95461ac 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Petition.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Petition.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PetitionState;
import org.l2jmobius.gameserver.enums.PetitionType;
import org.l2jmobius.gameserver.instancemanager.IdManager;
@@ -36,7 +37,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class Petition
{
- private final long _submitTime = System.currentTimeMillis();
+ private final long _submitTime = Chronos.currentTimeMillis();
private final int _id;
private final PetitionType _type;
private PetitionState _state = PetitionState.PENDING;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Spawn.java
index 4a1a2926b3..eb57e4e69b 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -258,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
_scheduledCount++;
// Schedule the next respawn.
- RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
+ RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/TimeStamp.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/TimeStamp.java
index 8c232969e0..9bdb39d293 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/TimeStamp.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/TimeStamp.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -52,7 +53,7 @@ public class TimeStamp
_id2 = skill.getLevel();
_id3 = skill.getSubLevel();
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = -1;
}
@@ -68,7 +69,7 @@ public class TimeStamp
_id2 = item.getObjectId();
_id3 = 0;
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = item.getSharedReuseGroup();
}
@@ -155,7 +156,7 @@ public class TimeStamp
{
return 0;
}
- final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
+ final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
if (remainingTime == 0)
{
_stamp = 0;
@@ -173,7 +174,7 @@ public class TimeStamp
{
return false;
}
- final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
+ final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
if (!hasNotPassed)
{
_stamp = 0;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java
index 134a095206..43fe92a776 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.AttackableAI;
import org.l2jmobius.gameserver.ai.CreatureAI;
@@ -215,7 +216,7 @@ public class Attackable extends Npc
if (_firstCommandChannelAttacked != null)
{
_commandChannelTimer = new CommandChannelTimer(this);
- _commandChannelLastAttack = System.currentTimeMillis();
+ _commandChannelLastAttack = Chronos.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
@@ -224,7 +225,7 @@ public class Attackable extends Npc
}
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
{
- _commandChannelLastAttack = System.currentTimeMillis(); // update last attack time
+ _commandChannelLastAttack = Chronos.currentTimeMillis(); // update last attack time
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 321f95d137..c44bdcf809 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -41,6 +41,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.EmptyQueue;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -1393,7 +1394,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : _reuseTimeStampsItems.values())
{
if (ts.getSharedReuseGroup() == group)
@@ -1523,7 +1524,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return;
}
- _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? System.currentTimeMillis() + delay : Long.MAX_VALUE);
+ _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? Chronos.currentTimeMillis() + delay : Long.MAX_VALUE);
}
/**
@@ -1571,7 +1572,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return false;
}
- if (stamp < System.currentTimeMillis())
+ if (stamp < Chronos.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java
index 62f1d1049f..d288fe8816 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -203,7 +204,7 @@ public class Npc extends Creature
public void onRandomAnimation(int animationId)
{
// Send a packet SocialAction to all PlayerInstance in the _KnownPlayers of the NpcInstance
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
{
_lastSocialBroadcast = now;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
index 7eacda4aa1..c87a2006a9 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.actor.instance;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
@@ -141,7 +142,7 @@ public class BlockInstance extends MonsterInstance
{
eng.increasePlayerPoints(player, team);
- final int timeLeft = (int) ((eng.getStarterTime() - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((eng.getStarterTime() - Chronos.currentTimeMillis()) / 1000);
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints());
final ExCubeGameExtendedChangePoints secretPoints = new ExCubeGameExtendedChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints(), isRed, player, eng.getPlayerPoints(player, isRed));
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index fc230d3d25..7e6f3c67d6 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -45,6 +45,7 @@ import java.util.stream.Collectors;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -2830,7 +2831,7 @@ public class PlayerInstance extends Playable
public void setOnlineTime(long time)
{
_onlineTime = time;
- _onlineBeginTime = System.currentTimeMillis();
+ _onlineBeginTime = Chronos.currentTimeMillis();
}
/**
@@ -3875,22 +3876,22 @@ public class PlayerInstance extends Playable
public boolean isSpawnProtected()
{
- return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
+ return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
}
public boolean isTeleportProtected()
{
- return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
+ return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
}
public void setSpawnProtection(boolean protect)
{
- _spawnProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
+ _spawnProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
}
public void setTeleportProtection(boolean protect)
{
- _teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
+ _teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
}
/**
@@ -5216,7 +5217,7 @@ public class PlayerInstance extends Playable
{
return;
}
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
if (_pvpFlag == 0)
{
startPvPFlag();
@@ -5249,11 +5250,11 @@ public class PlayerInstance extends Playable
{
if (checkIfPvP(targetPlayer))
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
}
else
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
}
if (_pvpFlag == 0)
{
@@ -6130,7 +6131,7 @@ public class PlayerInstance extends Playable
public long getUptime()
{
- return System.currentTimeMillis() - _uptime;
+ return Chronos.currentTimeMillis() - _uptime;
}
/**
@@ -6374,7 +6375,7 @@ public class PlayerInstance extends Playable
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
{
statement.setInt(1, isOnlineInt());
- statement.setLong(2, System.currentTimeMillis());
+ statement.setLong(2, Chronos.currentTimeMillis());
statement.setInt(3, getObjectId());
statement.execute();
}
@@ -6500,12 +6501,12 @@ public class PlayerInstance extends Playable
}
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
- if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanJoinExpiryTime(0);
}
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
- if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanCreateExpiryTime(0);
}
@@ -6567,7 +6568,7 @@ public class PlayerInstance extends Playable
player.getAppearance().setTitleColor(titleColor);
}
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
- player.setUptime(System.currentTimeMillis());
+ player.setUptime(Chronos.currentTimeMillis());
currentHp = rset.getDouble("curHp");
currentCp = rset.getDouble("curCp");
@@ -7083,7 +7084,7 @@ public class PlayerInstance extends Playable
long totalOnlineTime = _onlineTime;
if (_onlineBeginTime > 0)
{
- totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
+ totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
}
statement.setLong(34, totalOnlineTime);
@@ -7169,7 +7170,7 @@ public class PlayerInstance extends Playable
int buffIndex = 0;
final List storedSkills = new ArrayList<>();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
// Store all effect data along with calulated remaining
// reuse delays for matching skills. 'restore_type'= 0.
@@ -7284,7 +7285,7 @@ public class PlayerInstance extends Playable
ps1.setInt(1, getObjectId());
ps1.execute();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : getItemReuseTimeStamps().values())
{
if ((ts != null) && (currentTime < ts.getStamp()))
@@ -7607,7 +7608,7 @@ public class PlayerInstance extends Playable
statement.setInt(2, _classIndex);
try (ResultSet rset = statement.executeQuery())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
final int remainingTime = rset.getInt("remaining_time");
@@ -7669,7 +7670,7 @@ public class PlayerInstance extends Playable
long systime;
boolean isInInventory;
long remainingTime;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
itemId = rset.getInt("itemId");
@@ -7744,7 +7745,7 @@ public class PlayerInstance extends Playable
{
int slot;
int symbolId;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
slot = rset.getInt("slot");
@@ -7867,7 +7868,7 @@ public class PlayerInstance extends Playable
// Send Server->Client UserInfo packet to this PlayerInstance
broadcastUserInfo(UserInfoType.BASE_STATS, UserInfoType.MAX_HPCPMP, UserInfoType.STATS, UserInfoType.SPEED);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long timeLeft = getVariables().getLong("HennaDuration" + slot, currentTime) - currentTime;
if ((henna.getDuration() < 0) || (timeLeft > 0))
{
@@ -7958,7 +7959,7 @@ public class PlayerInstance extends Playable
// Task for henna duration
if (henna.getDuration() > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
@@ -12422,7 +12423,7 @@ public class PlayerInstance extends Playable
public int getBirthdays()
{
- long time = (System.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
+ long time = (Chronos.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
time /= TimeUnit.DAYS.toMillis(365);
return (int) time;
}
@@ -12662,7 +12663,7 @@ public class PlayerInstance extends Playable
return false;
}
- if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
+ if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@@ -12722,7 +12723,7 @@ public class PlayerInstance extends Playable
*/
public void setFalling()
{
- _fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
+ _fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
}
/**
@@ -12743,7 +12744,7 @@ public class PlayerInstance extends Playable
*/
public void updateLastItemAuctionRequest()
{
- _lastItemAuctionInfoRequest = System.currentTimeMillis();
+ _lastItemAuctionInfoRequest = Chronos.currentTimeMillis();
}
/**
@@ -12752,7 +12753,7 @@ public class PlayerInstance extends Playable
*/
public boolean isItemAuctionPolling()
{
- return (System.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
+ return (Chronos.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
}
@Override
@@ -13136,7 +13137,7 @@ public class PlayerInstance extends Playable
public void updateNotMoveUntil()
{
- _notMoveUntil = System.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
+ _notMoveUntil = Chronos.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
}
@Override
@@ -14183,7 +14184,7 @@ public class PlayerInstance extends Playable
public boolean isInTraingCamp()
{
final TrainingHolder trainingHolder = getTraingCampInfo();
- return (trainingHolder != null) && (trainingHolder.getEndTime() > System.currentTimeMillis());
+ return (trainingHolder != null) && (trainingHolder.getEndTime() > Chronos.currentTimeMillis());
}
public AttendanceInfoHolder getAttendanceInfo()
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
index ac089b7e91..bf4cea7560 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
@@ -21,6 +21,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.InstanceType;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
@@ -280,13 +281,13 @@ public class VillageMasterInstance extends NpcInstance
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
return;
}
- clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setDissolvingExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
// The clan leader should take the XP penalty of a full death.
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 843165d245..18d77105c7 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.attackable;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
/**
@@ -40,7 +41,7 @@ public class CommandChannelTimer implements Runnable
return;
}
- if ((System.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
+ if ((Chronos.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
{
_attackable.setCommandChannelTimer(null);
_attackable.setFirstCommandChannelAttacked(null);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
index e2130407ac..290e49a99f 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.player;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -92,12 +93,12 @@ public class IllegalPlayerActionTask implements Runnable
}
case KICKBAN:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
case JAIL:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/buylist/Product.java
index 0782846eba..3fc18a73e3 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/buylist/Product.java
@@ -25,6 +25,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.type.EtcItemType;
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
@@ -134,7 +135,7 @@ public class Product
public void restartRestockTask(long nextRestockTime)
{
- final long remainTime = nextRestockTime - System.currentTimeMillis();
+ final long remainTime = nextRestockTime - Chronos.currentTimeMillis();
if (remainTime > 0)
{
BuyListTaskManager.getInstance().update(this, remainTime);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
index 1ccabadff3..1355481e68 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
import org.l2jmobius.gameserver.enums.QuestSound;
@@ -278,7 +279,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
});
}
}
- _battleStartTime = System.currentTimeMillis();
+ _battleStartTime = Chronos.currentTimeMillis();
getTimers().addRepeatingTimer("update", 1000, null, null);
}
@@ -505,7 +506,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
private void updateLifeTime(CeremonyOfChaosMember member)
{
- member.setLifeTime(((int) (System.currentTimeMillis() - _battleStartTime) / 1000));
+ member.setLifeTime(((int) (Chronos.currentTimeMillis() - _battleStartTime) / 1000));
}
public List getWinners()
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/clan/Clan.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/clan/Clan.java
index fd7c721083..d3f28a8c3f 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/clan/Clan.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/clan/Clan.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -505,7 +506,7 @@ public class Clan implements IIdentifiable, INamable
if (player.isClanLeader())
{
SiegeManager.getInstance().removeSiegeSkills(player);
- player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ player.setClanCreateExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
}
// remove Clan skills from Player
@@ -537,7 +538,7 @@ public class Clan implements IIdentifiable, INamable
}
else
{
- removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
+ removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
}
// Notify to scripts
@@ -1002,12 +1003,12 @@ public class Clan implements IIdentifiable, INamable
setAllyId(clanData.getInt("ally_id"));
setAllyName(clanData.getString("ally_name"));
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
- if (_allyPenaltyExpiryTime < System.currentTimeMillis())
+ if (_allyPenaltyExpiryTime < Chronos.currentTimeMillis())
{
setAllyPenaltyExpiryTime(0, 0);
}
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
- if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
+ if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < Chronos.currentTimeMillis()) // 24*60*60*1000 = 86400000
{
setCharPenaltyExpiryTime(0);
}
@@ -2048,7 +2049,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
return false;
}
- if (_charPenaltyExpiryTime > System.currentTimeMillis())
+ if (_charPenaltyExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return false;
@@ -2060,7 +2061,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (target.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (target.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(target.getName());
@@ -2102,7 +2103,7 @@ public class Clan implements IIdentifiable, INamable
return false;
}
final Clan leaderClan = player.getClan();
- if ((leaderClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis()) && (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN))
+ if ((leaderClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis()) && (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN))
{
player.sendPacket(SystemMessageId.YOU_MAY_NOT_ACCEPT_ANY_CLAN_WITHIN_A_DAY_AFTER_EXPELLING_ANOTHER_CLAN);
return false;
@@ -2138,7 +2139,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
{
@@ -2232,12 +2233,12 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
return;
}
- if ((_allyPenaltyExpiryTime > System.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
+ if ((_allyPenaltyExpiryTime > Chronos.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
return;
}
- if (_dissolvingExpiryTime > System.currentTimeMillis())
+ if (_dissolvingExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
return;
@@ -2289,7 +2290,7 @@ public class Clan implements IIdentifiable, INamable
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
{
if (clan.getId() != getId())
@@ -2315,7 +2316,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
return false;
}
- if (System.currentTimeMillis() < _dissolvingExpiryTime)
+ if (Chronos.currentTimeMillis() < _dissolvingExpiryTime)
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
return false;
@@ -2700,7 +2701,7 @@ public class Clan implements IIdentifiable, INamable
public void addMasterySkill(int id)
{
- getVariables().set(ClanVariables.CLAN_MASTERY_SKILL_TIME + id, System.currentTimeMillis() + 1296000000);
+ getVariables().set(ClanVariables.CLAN_MASTERY_SKILL_TIME + id, Chronos.currentTimeMillis() + 1296000000);
final ScheduledFuture> task = ThreadPool.schedule(() -> removeMasterySkill(id), 1296000000); // 1296000000 = 15 days
masterySkillTasks.add(task);
addNewSkill(SkillData.getInstance().getSkill(id, 1));
@@ -2719,7 +2720,7 @@ public class Clan implements IIdentifiable, INamable
{
return -1;
}
- return (int) (endTime - System.currentTimeMillis());
+ return (int) (endTime - Chronos.currentTimeMillis());
}
public void setDevelopmentPoints(int count)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/clan/ClanWar.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
index d4049e1da3..545f226e2c 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -54,9 +55,9 @@ public class ClanWar
{
_attackerClanId = attacker.getId();
_attackedClanId = attacked.getId();
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_state = ClanWarState.BLOOD_DECLARATION;
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
attacker.addWar(attacked.getId(), this);
attacked.addWar(attacker.getId(), this);
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
@@ -79,15 +80,15 @@ public class ClanWar
_attackerKillCount.set(attackerKillCount);
_attackedKillCount.set(attackedKillCount);
_winnerClanId = winnerClan;
- if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > System.currentTimeMillis())
+ if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > Chronos.currentTimeMillis())
{
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
}
if (_endTime > 0)
{
final long endTimePeriod = _endTime + (_state == ClanWarState.TIE ? TIME_TO_DELETION_AFTER_CANCELLATION : TIME_TO_DELETION_AFTER_DEFEAT);
- if (endTimePeriod > System.currentTimeMillis())
+ if (endTimePeriod > Chronos.currentTimeMillis())
{
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(_attackerClanId, _attackedClanId), 10000);
}
@@ -177,8 +178,8 @@ public class ClanWar
winnerClan.broadcastToOnlineMembers(sm);
_winnerClanId = winnerClan.getId();
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - Chronos.currentTimeMillis());
}
public void clanWarTimeout()
@@ -196,8 +197,8 @@ public class ClanWar
attackerClan.broadcastToOnlineMembers(sm);
_state = ClanWarState.TIE;
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - Chronos.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index f150ec3238..b1b3a83fd1 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.StatSet;
import it.sauronsoftware.cron4j.PastPredictor;
@@ -112,7 +113,7 @@ public class EventScheduler
final Predictor predictor = new Predictor(_pattern);
final long nextSchedule = predictor.nextMatchingTime();
- final long timeSchedule = nextSchedule - System.currentTimeMillis();
+ final long timeSchedule = nextSchedule - Chronos.currentTimeMillis();
if (timeSchedule <= (30 * 1000))
{
LOGGER.warning("Wrong reschedule for " + _eventManager.getClass().getSimpleName() + " end up run in " + (timeSchedule / 1000) + " seconds!");
@@ -144,10 +145,10 @@ public class EventScheduler
{
ps.setString(1, _eventManager.getName());
ps.setString(2, _name);
- ps.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(3, new Timestamp(Chronos.currentTimeMillis()));
ps.setString(4, _eventManager.getName());
ps.setString(5, _name);
- ps.setTimestamp(6, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(6, new Timestamp(Chronos.currentTimeMillis()));
ps.execute();
return true;
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/events/EventType.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/events/EventType.java
index 99875a73cf..f266ac008b 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/events/EventType.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/events/EventType.java
@@ -76,7 +76,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
@@ -84,8 +83,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaR
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemAdd;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDestroy;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDrop;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemTransfer;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
@@ -114,7 +115,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
index 77e7205bfa..6139454534 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -85,7 +86,7 @@ public class TrainingHolder implements Serializable
public long getElapsedTime()
{
- return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
+ return TimeUnit.SECONDS.convert(Chronos.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
index 6c9ca907b7..62649739ea 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -39,6 +39,7 @@ import java.util.stream.Stream;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -105,7 +106,7 @@ public class Instance implements IIdentifiable, INamable
// Set basic instance info
_id = id;
_template = template;
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_spawns = new ArrayList<>(template.getSpawns().size());
// Clone and add the spawn templates
@@ -755,7 +756,7 @@ public class Instance implements IIdentifiable, INamable
}
// Set new cleanup task
- _endTime = System.currentTimeMillis() + millis;
+ _endTime = Chronos.currentTimeMillis() + millis;
if (minutes < 1) // Destroy instance
{
destroy();
@@ -858,7 +859,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getElapsedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
/**
@@ -867,7 +868,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getRemainingTime()
{
- return (_endTime == -1) ? -1 : (_endTime - System.currentTimeMillis());
+ return (_endTime == -1) ? -1 : (_endTime - Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
index 973dab1661..84466d8e0a 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.GroupType;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -547,7 +548,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
{
if (data.getTime() > 0)
{
- time = System.currentTimeMillis() + data.getTime();
+ time = Chronos.currentTimeMillis() + data.getTime();
break;
}
@@ -557,7 +558,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
calendar.set(Calendar.SECOND, 0);
// If calendar time is lower than current, add one more day
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
@@ -574,7 +575,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Set exact day. If modified date is before current, add one more week.
calendar.set(Calendar.DAY_OF_WEEK, day);
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.WEEK_OF_MONTH, 1);
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
index 1850d30783..07ce5a3538 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.instancezone.conditions;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -39,6 +40,6 @@ public class ConditionReenter extends Condition
protected boolean test(PlayerInstance player, Npc npc)
{
final int instanceId = getParameters().getInt("instanceId", getInstanceTemplate().getId());
- return System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
+ return Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index fbe1e21414..a1b1f40b26 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.ItemInfo;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -181,12 +182,12 @@ public class ItemAuction
public long getStartingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public long getFinishingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public void storeMe()
@@ -339,7 +340,7 @@ public class ItemAuction
_highestBid = bid;
}
- if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
+ if ((_endingTime - Chronos.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
{
switch (_auctionEndingExtendState)
{
@@ -426,7 +427,7 @@ public class ItemAuction
}
case FINISHED:
{
- if (_startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
+ if (_startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
{
return false;
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 8d81451dc9..f14581064a 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -243,7 +244,7 @@ public class ItemAuctionInstance
{
case 0:
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
case 1:
@@ -252,10 +253,10 @@ public class ItemAuctionInstance
{
case CREATED:
{
- if (auctions[0].getStartingTime() < (System.currentTimeMillis() + START_TIME_SPACE))
+ if (auctions[0].getStartingTime() < (Chronos.currentTimeMillis() + START_TIME_SPACE))
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
else
{
@@ -266,13 +267,13 @@ public class ItemAuctionInstance
case STARTED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, System.currentTimeMillis() + START_TIME_SPACE));
+ nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, Chronos.currentTimeMillis() + START_TIME_SPACE));
break;
}
case FINISHED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
default:
@@ -287,7 +288,7 @@ public class ItemAuctionInstance
{
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
// just to make sure we won't skip any auction because of little different times
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (ItemAuction auction : auctions)
{
if (auction.getAuctionState() == ItemAuctionState.STARTED)
@@ -311,7 +312,7 @@ public class ItemAuctionInstance
}
if (nextAuction == null)
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
break;
}
@@ -326,17 +327,17 @@ public class ItemAuctionInstance
{
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
}
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
}
}
@@ -422,7 +423,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -432,7 +433,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -442,7 +443,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -452,7 +453,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
}
@@ -577,7 +578,7 @@ public class ItemAuctionInstance
return null;
}
- if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
+ if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
{
LOGGER.info(getClass().getSimpleName() + ": Clearing expired auction: " + auctionId);
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
index beae6e0db1..abbe632775 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.AgathionData;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
@@ -206,7 +207,7 @@ public class ItemInstance extends WorldObject
_type2 = 0;
_dropTime = 0;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -229,7 +230,7 @@ public class ItemInstance extends WorldObject
super.setName(_item.getName());
_loc = ItemLocation.VOID;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -1583,7 +1584,7 @@ public class ItemInstance extends WorldObject
setSpawned(true);
setXYZ(x, y, z);
- setDropTime(System.currentTimeMillis());
+ setDropTime(Chronos.currentTimeMillis());
setDropperObjectId(dropper != null ? dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
// Add the ItemInstance dropped in the world as a visible object
@@ -1862,7 +1863,7 @@ public class ItemInstance extends WorldObject
public long getRemainingTime()
{
- return _time - System.currentTimeMillis();
+ return _time - Chronos.currentTimeMillis();
}
public void endOfLife()
@@ -2520,7 +2521,7 @@ public class ItemInstance extends WorldObject
if (getVisualLifeTime() > 0)
{
final long endTime = getVisualLifeTime();
- if ((endTime - System.currentTimeMillis()) > 0)
+ if ((endTime - Chronos.currentTimeMillis()) > 0)
{
ItemAppearanceTaskManager.getInstance().add(this, endTime);
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index e6e471cce5..09adeca7a9 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -21,6 +21,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
@@ -84,7 +85,7 @@ public abstract class AbstractOlympiadGame
protected boolean makeCompetitionStart()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
return !_aborted;
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 8f929acb1e..cf96eac121 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
@@ -765,7 +766,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", template.getName() + " was defeated");
@@ -786,7 +787,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", castle.getName() + " Castle was successfuly taken");
@@ -800,7 +801,7 @@ public class Hero
PreparedStatement ps = con.prepareStatement("INSERT INTO heroes_diary (charId, time, action, param) values(?,?,?,?)"))
{
ps.setInt(1, charId);
- ps.setLong(2, System.currentTimeMillis());
+ ps.setLong(2, Chronos.currentTimeMillis());
ps.setInt(3, action);
ps.setInt(4, param);
ps.execute();
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index 2a54d83dc7..0427829eb2 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,6 +27,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
@@ -546,7 +547,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
String winner = "draw";
// Calculate Fight time
- final long _fightTime = (System.currentTimeMillis() - _startTime);
+ final long _fightTime = (Chronos.currentTimeMillis() - _startTime);
double playerOneHp = 0;
if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index 119e447b15..4bb2fc156e 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.handler.PunishmentHandler;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
@@ -133,7 +134,7 @@ public class PunishmentTask implements Runnable
*/
public boolean isExpired()
{
- return (_expirationTime > 0) && (System.currentTimeMillis() > _expirationTime);
+ return (_expirationTime > 0) && (Chronos.currentTimeMillis() > _expirationTime);
}
/**
@@ -149,7 +150,7 @@ public class PunishmentTask implements Runnable
onStart();
if (_expirationTime > 0) // Has expiration?
{
- _task = ThreadPool.schedule(this, (_expirationTime - System.currentTimeMillis()));
+ _task = ThreadPool.schedule(this, (_expirationTime - Chronos.currentTimeMillis()));
}
}
@@ -226,7 +227,7 @@ public class PunishmentTask implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement st = con.prepareStatement(UPDATE_QUERY))
{
- st.setLong(1, System.currentTimeMillis());
+ st.setLong(1, Chronos.currentTimeMillis());
st.setLong(2, _id);
st.execute();
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 7c2d57fdc6..2e36bece7c 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -32,6 +32,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.EventDroplist;
import org.l2jmobius.gameserver.data.ItemTable;
@@ -100,7 +101,7 @@ public class LongTimeEvent extends Quest
}
else if (_eventPeriod.getStartDate().after(new Date()))
{
- final long delay = _eventPeriod.getStartDate().getTime() - System.currentTimeMillis();
+ final long delay = _eventPeriod.getStartDate().getTime() - Chronos.currentTimeMillis();
ThreadPool.schedule(new ScheduleStart(), delay);
LOGGER.info("Event " + _eventName + " will be started at " + _eventPeriod.getStartDate());
}
@@ -323,7 +324,7 @@ public class LongTimeEvent extends Quest
}
// Add spawns.
- final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - System.currentTimeMillis();
+ final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - Chronos.currentTimeMillis();
for (NpcSpawn spawn : _spawnList)
{
addSpawn(spawn.npcId, spawn.loc.getX(), spawn.loc.getY(), spawn.loc.getZ(), spawn.loc.getHeading(), false, millisToEventEnd, false);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 1218569d81..4264d72834 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.enums.QuestType;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
@@ -785,7 +786,7 @@ public class QuestState
public boolean isNowAvailable()
{
final String val = get("restartTime");
- return (val != null) && (Long.parseLong(val) <= System.currentTimeMillis());
+ return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
public void setSimulated(boolean simulated)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
index cf665da8f8..b4d0d36648 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.SocialClass;
@@ -138,7 +139,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
final int level = rs.getInt("level");
final long expiration = rs.getLong("expiration");
final ResidenceFunction func = new ResidenceFunction(id, level, expiration, this);
- if ((expiration <= System.currentTimeMillis()) && !func.reactivate())
+ if ((expiration <= Chronos.currentTimeMillis()) && !func.reactivate())
{
removeFunction(func);
continue;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
index a292c439e5..d81d7f08af 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanHallGrade;
import org.l2jmobius.gameserver.enums.ClanHallType;
@@ -265,7 +266,7 @@ public class ClanHall extends AbstractResidence
final int failDays = getCostFailDay();
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : _paidUntil;
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - Chronos.currentTimeMillis());
}
else
{
@@ -310,7 +311,7 @@ public class ClanHall extends AbstractResidence
*/
public long getNextPayment()
{
- return (_checkPaymentTask != null) ? System.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
+ return (_checkPaymentTask != null) ? Chronos.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
}
public Location getOwnerLocation()
@@ -382,7 +383,7 @@ public class ClanHall extends AbstractResidence
{
_owner.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, _lease, null, null);
setPaidUntil(Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(7)).toEpochMilli());
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - Chronos.currentTimeMillis());
updateDB();
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
index 2fa683814d..faac3921be 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
@@ -30,6 +30,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
@@ -85,7 +86,7 @@ public class ClanHallAuction
public void addBid(Clan clan, long bid)
{
- addBid(clan, bid, System.currentTimeMillis());
+ addBid(clan, bid, Chronos.currentTimeMillis());
}
public void addBid(Clan clan, long bid, long bidTime)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index c71380874f..841d3b180c 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -20,6 +20,7 @@ import java.time.Instant;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ResidenceFunctionsData;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -63,9 +64,9 @@ public class ResidenceFunction
private void init()
{
final ResidenceFunctionTemplate template = getTemplate();
- if ((template != null) && (_expiration > System.currentTimeMillis()))
+ if ((template != null) && (_expiration > Chronos.currentTimeMillis()))
{
- _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
+ _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - Chronos.currentTimeMillis());
}
}
@@ -170,7 +171,7 @@ public class ResidenceFunction
if (wh.destroyItem("FunctionFee", item, template.getCost().getCount(), null, this) != null)
{
- _expiration = System.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
+ _expiration = Chronos.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
init();
}
return true;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
index 3a425c9b03..af7fd2e85e 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.shuttle;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Location;
/**
@@ -29,7 +30,7 @@ public class ShuttleStop
private final int _id;
private boolean _isOpen = true;
private final List _dimensions = new ArrayList<>(3);
- private long _lastDoorStatusChanges = System.currentTimeMillis();
+ private long _lastDoorStatusChanges = Chronos.currentTimeMillis();
public ShuttleStop(int id)
{
@@ -64,7 +65,7 @@ public class ShuttleStop
}
_isOpen = true;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public void closeDoor()
@@ -75,11 +76,11 @@ public class ShuttleStop
}
_isOpen = false;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public boolean hasDoorChanged()
{
- return (System.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
+ return (Chronos.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Castle.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Castle.java
index 1ee2ffa27b..41cd50499c 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Castle.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Castle.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.CastleData;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -160,7 +161,7 @@ public class Castle extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -195,7 +196,7 @@ public class Castle extends AbstractResidence
fee = _tempFee;
}
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Fort.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Fort.java
index 95839a8065..de66de79ed 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Fort.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Fort.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.FortUpdater;
import org.l2jmobius.gameserver.FortUpdater.UpdaterType;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -163,7 +164,7 @@ public class Fort extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -193,7 +194,7 @@ public class Fort extends AbstractResidence
if ((_fortOwner.getWarehouse().getAdena() >= _fee) || !_cwh)
{
final int fee = _endDate == -1 ? _tempFee : _fee;
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
@@ -580,7 +581,7 @@ public class Fort extends AbstractResidence
clan.setFortId(getResidenceId());
setOwnerClan(clan);
final int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
- long initial = System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
+ long initial = Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
while (initial > (Config.FS_UPDATE_FRQ * 60000))
{
initial -= Config.FS_UPDATE_FRQ * 60000;
@@ -786,7 +787,7 @@ public class Fort extends AbstractResidence
if (clan != null)
{
clanId = clan.getId();
- _lastOwnedTime.setTimeInMillis(System.currentTimeMillis());
+ _lastOwnedTime.setTimeInMillis(Chronos.currentTimeMillis());
}
else
{
@@ -920,12 +921,12 @@ public class Fort extends AbstractResidence
public int getOwnedTime()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
}
public int getTimeTillRebelArmy()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - System.currentTimeMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - Chronos.currentTimeMillis()) / 1000);
}
public long getTimeTillNextFortUpdate()
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Siege.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Siege.java
index 4b708d7885..9ce3c7e625 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Siege.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/siege/Siege.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SiegeScheduleData;
import org.l2jmobius.gameserver.enums.SiegeClanType;
@@ -1434,9 +1435,9 @@ public class Siege implements Siegable
}
final Calendar calendar = _castle.getSiegeDate();
- if (calendar.getTimeInMillis() < System.currentTimeMillis())
+ if (calendar.getTimeInMillis() < Chronos.currentTimeMillis())
{
- calendar.setTimeInMillis(System.currentTimeMillis());
+ calendar.setTimeInMillis(Chronos.currentTimeMillis());
}
calendar.set(Calendar.DAY_OF_WEEK, holder.getDay());
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
index c7b80987c7..77396cff6d 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
@@ -32,10 +32,10 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
+import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
import org.l2jmobius.gameserver.model.stats.Stat;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
index c3ac06e1fc..18161a6c75 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
@@ -30,8 +30,8 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
index 5428c6f7dd..497f4e7247 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.zone.type;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -99,7 +100,7 @@ public class NoRestartZone extends ZoneType
return;
}
- if (((System.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
+ if (((Chronos.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
{
player.teleToLocation(TeleportWhereType.TOWN);
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/GameClient.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/GameClient.java
index badd7b05a1..99c66513d8 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/GameClient.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/GameClient.java
@@ -30,6 +30,7 @@ import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.ICrypt;
import org.l2jmobius.commons.network.IIncomingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -341,7 +342,7 @@ public class GameClient extends ChannelInboundHandler
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps2 = con.prepareStatement("UPDATE characters SET deletetime=? WHERE charId=?"))
{
- ps2.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ ps2.setLong(1, Chronos.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
ps2.setInt(2, objectId);
ps2.execute();
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
index bf151234da..cf2986ced6 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -81,7 +82,7 @@ public class AllyDismiss implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000), Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
leaderClan.updateClanInDB();
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
index 3d5c508a4c..7cc2fa0c1f 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class AllyLeave implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
clan.setAllyId(0);
clan.setAllyName(null);
clan.changeAllyCrest(0, true);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 584a2744c5..e37e4099bf 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
@@ -540,7 +541,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_RECENTLY_BEEN_DISMISSED_FROM_A_CLAN_YOU_ARE_NOT_ALLOWED_TO_JOIN_ANOTHER_CLAN_FOR_24_HOURS);
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
index c63a8bfcf4..854d89da8d 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.AdminTeleportType;
@@ -74,7 +75,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
player.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
index 7121e926a7..4c71064b0b 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
@@ -20,6 +20,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.enums.ItemSkillType;
@@ -128,7 +129,7 @@ public class RequestEnchantItem implements IClientIncomingPacket
}
// fast auto-enchant cheat check
- if ((request.getTimestamp() == 0) || ((System.currentTimeMillis() - request.getTimestamp()) < 2000))
+ if ((request.getTimestamp() == 0) || ((Chronos.currentTimeMillis() - request.getTimestamp()) < 2000))
{
Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " use autoenchant program ", Config.DEFAULT_PUNISH);
player.removeRequest(request.getClass());
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
index b8a07b77e8..bad73f8c28 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -82,7 +83,7 @@ public class RequestExAddEnchantScrollItem implements IClientIncomingPacket
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantScrollItemResult(_scrollObjectId));
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
index db4db5e742..b004d448e0 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -55,7 +56,7 @@ public class RequestExRemoveEnchantSupportItem implements IClientIncomingPacket
request.setSupportItem(PlayerInstance.ID_NONE);
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(ExRemoveEnchantSupportItemResult.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
index 92018f3a8d..035cf151b6 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -69,7 +70,7 @@ public class RequestExSetPledgeCrestLarge implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
index c9e0cf1be8..7a2a1c706a 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -85,7 +86,7 @@ public class RequestExTryToPutEnchantSupportItem implements IClientIncomingPacke
}
request.setSupportItem(support.getObjectId());
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantSupportItemResult(_supportObjectId));
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
index cdf3996711..4b04a3965e 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -76,7 +77,7 @@ public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
}
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
client.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
index 715be58f93..cd86a6542c 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -69,7 +70,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
{
if (_isJoining == 1)
{
- if (System.currentTimeMillis() < clan.getDissolvingExpiryTime())
+ if (Chronos.currentTimeMillis() < clan.getDissolvingExpiryTime())
{
client.sendPacket(SystemMessageId.YOUR_CLAN_MAY_NOT_REGISTER_TO_PARTICIPATE_IN_A_SIEGE_WHILE_UNDER_A_GRACE_PERIOD_OF_THE_CLAN_S_DISSOLUTION);
return;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
index 9e74ccac1a..6c52234804 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.BoatManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.instance.BoatInstance;
@@ -61,7 +62,7 @@ public class RequestMoveToLocationInVehicle implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
client.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
index af3723c7f8..54ec6ddd78 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
@@ -80,8 +81,8 @@ public class RequestOustPledgeMember implements IClientIncomingPacket
}
// this also updates the database
- clan.removeClanMember(member.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
- clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(member.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setCharPenaltyExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_BEEN_DISMISSED);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
index 0bf1ebf5ec..a61cc79835 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
@@ -22,6 +22,7 @@ import java.sql.SQLException;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -68,7 +69,7 @@ public class RequestPetitionFeedback implements IClientIncomingPacket
statement.setString(2, player.getLastPetitionGmName());
statement.setInt(3, _rate);
statement.setString(4, _message);
- statement.setLong(5, System.currentTimeMillis());
+ statement.setLong(5, Chronos.currentTimeMillis());
statement.execute();
}
catch (SQLException e)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
index ba7a5bab88..0a24a0e492 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanLevelData;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.ClanEntryManager;
@@ -63,12 +64,12 @@ public class RequestPledgeSignInForOpenJoiningMethod implements IClientIncomingP
final Clan clan = pledgeRecruitInfo.getClan();
if ((clan != null) && (player.getClan() == null))
{
- if (clan.getCharPenaltyExpiryTime() > System.currentTimeMillis())
+ if (clan.getCharPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return;
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 30e0b1b097..9c606fc9fe 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -34,8 +34,8 @@ import org.l2jmobius.gameserver.model.quest.Event;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.network.GameClient;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
index d415106f6a..d21279f5be 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -74,7 +75,7 @@ public class RequestSetPledgeCrest implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
index 16f6b732ba..f1d9597133 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.enums.UserInfoType;
@@ -101,7 +102,7 @@ public class RequestStartPledgeWar implements IClientIncomingPacket
client.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
- else if (clanDeclaredWar.getDissolvingExpiryTime() > System.currentTimeMillis())
+ else if (clanDeclaredWar.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(new SystemMessage(SystemMessageId.A_CLAN_WAR_CAN_NOT_BE_DECLARED_AGAINST_A_CLAN_THAT_IS_BEING_DISSOLVED));
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
index 5fdcb9b32f..60793f38b5 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class RequestWithdrawalPledge implements IClientIncomingPacket
}
final Clan clan = player.getClan();
- clan.removeClanMember(player.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(player.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
index 64714a4976..949dba2b59 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlEvent;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.NextAction;
@@ -264,7 +265,7 @@ public class UseItem implements IClientIncomingPacket
else if (player.isAttackingNow())
{
// Equip or unEquip.
- ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
+ ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
index aef68ac971..96ce901338 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.appearance;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.enums.InventorySlot;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -252,7 +253,7 @@ public class RequestShapeShiftingItem implements IClientIncomingPacket
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getLifeTime() > 0))
{
- targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, System.currentTimeMillis() + appearanceStone.getLifeTime());
+ targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, Chronos.currentTimeMillis() + appearanceStone.getLifeTime());
targetItem.scheduleVisualLifeTime();
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
index 2aa7eeeeac..d6bbe9b766 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,9 +119,9 @@ public class ConfirmMenteeAdd implements IClientIncomingPacket
mentor.sendPacket(SystemMessageId.YOU_MUST_AWAKEN_IN_ORDER_TO_BECOME_A_MENTOR);
return false;
}
- else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > System.currentTimeMillis())
+ else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > Chronos.currentTimeMillis())
{
- long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - System.currentTimeMillis()) / 1000;
+ long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - Chronos.currentTimeMillis()) / 1000;
final int days = (int) (remainingTime / 86400);
remainingTime = remainingTime % 86400;
final int hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
index e06cd9048d..1e8aba6d16 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
@@ -119,7 +120,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
index f6702caa41..9c076a29a5 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.enums.MailType;
@@ -140,7 +141,7 @@ public class RequestBRPresentBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
index c3faad961a..138ed60513 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.training;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.TrainingHolder;
import org.l2jmobius.gameserver.network.GameClient;
@@ -52,7 +53,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
if (holder.isTraining())
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
@@ -60,7 +61,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
player.setImmobilized(false);
player.teleToLocation(player.getLastLocation());
player.sendPacket(ExTrainingZone_Leaving.STATIC_PACKET);
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
index ee1c787150..3f1213f2ee 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.loginserverpackets.game;
import org.l2jmobius.commons.network.BaseSendablePacket;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author mrTJO
@@ -28,7 +29,7 @@ public class TempBan extends BaseSendablePacket
writeC(0x0A);
writeS(accountName);
writeS(ip);
- writeQ(System.currentTimeMillis() + (time * 60000));
+ writeQ(Chronos.currentTimeMillis() + (time * 60000));
// if (reason != null)
// {
// writeC(0x01);
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
index c721fa30d9..24af521ca5 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
@@ -277,7 +278,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP
packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP
- packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
+ packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0);
packet.writeD(charInfoPackage.getClassId());
packet.writeD(i == _activeId ? 1 : 0);
@@ -372,7 +373,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
// See if the char must be deleted
final long deletetime = chardata.getLong("deletetime");
- if ((deletetime > 0) && (System.currentTimeMillis() > deletetime))
+ if ((deletetime > 0) && (Chronos.currentTimeMillis() > deletetime))
{
final Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
if (clan != null)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
index 57dd77c3f1..6cbf9639e3 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
@@ -53,7 +54,7 @@ public class ExInzoneWaiting implements IClientOutgoingPacket
packet.writeD(_instanceTimes.size());
for (Entry entry : _instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
index a40690e845..6f7b5f8735 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MatchingRoomManager;
@@ -73,7 +74,7 @@ public class ExListPartyMatchingWaitingRoom implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
index d455d825fd..5921d44781 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MatchingMemberType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -61,7 +62,7 @@ public class ExPartyRoomMember implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
index 3656ddbc4e..ab85228caf 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MailType;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
@@ -45,7 +46,7 @@ public class ExShowReceivedPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_RECEIVED_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_inbox != null) && !_inbox.isEmpty())
{
packet.writeD(_inbox.size());
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
index 2ae09181a7..db4bccc928 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -40,7 +41,7 @@ public class ExShowSentPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_SENT_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_outbox != null) && !_outbox.isEmpty())
{
packet.writeD(_outbox.size());
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
index db2091ad54..4403da53fe 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.items.Henna;
import org.l2jmobius.gameserver.model.stats.BaseStat;
@@ -73,7 +74,7 @@ public class HennaInfo implements IClientOutgoingPacket
int duration = premium.getDuration();
if (duration > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
duration = (int) Math.max(0, _player.getVariables().getLong("HennaDuration4", currentTime) - currentTime) / 1000;
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
index 5ed678042b..caed96260b 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -88,7 +89,7 @@ public class SiegeInfo implements IClientOutgoingPacket
packet.writeS(""); // Ally Name
}
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if (!_castle.isTimeRegistrationOver() && _player.isClanLeader() && (_player.getClanId() == _castle.getOwnerId()))
{
final Calendar cal = Calendar.getInstance();
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
index 5871334785..c6de3ccd8b 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.TimeStamp;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -36,7 +37,7 @@ public class SkillCoolTime implements IClientOutgoingPacket
public SkillCoolTime(PlayerInstance player)
{
- _currentTime = System.currentTimeMillis();
+ _currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : player.getSkillReuseTimeStamps().values())
{
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel()).isNotBroadcastable())
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
index 74955d8a26..2ffa34919b 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets.friend;
import java.util.Calendar;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -39,7 +40,7 @@ public class ExFriendDetailInfo implements IClientOutgoingPacket
_objectId = player.getObjectId();
_name = name;
_friend = World.getInstance().getPlayer(_name);
- _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) System.currentTimeMillis() : (int) (System.currentTimeMillis() - _friend.getLastAccess()) / 1000;
+ _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) Chronos.currentTimeMillis() : (int) (Chronos.currentTimeMillis() - _friend.getLastAccess()) / 1000;
}
@Override
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/scripting/ManagedScript.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
index 00235baa25..9d206480d8 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
@@ -20,6 +20,8 @@ import java.nio.file.Path;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* Abstract class for classes that are meant to be implemented by scripts.
* @author KenM
@@ -35,7 +37,7 @@ public abstract class ManagedScript
public ManagedScript()
{
_scriptFile = getScriptPath();
- setLastLoadTime(System.currentTimeMillis());
+ setLastLoadTime(Chronos.currentTimeMillis());
}
public abstract Path getScriptPath();
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index 9c8c4bb5dd..b5a2e04233 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -54,7 +55,7 @@ public class AttackStanceTaskManager
}
_working = true;
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
try
{
final Iterator> iterator = _attackStanceTasks.entrySet().iterator();
@@ -105,7 +106,7 @@ public class AttackStanceTaskManager
return;
}
- _attackStanceTasks.put(creature, System.currentTimeMillis());
+ _attackStanceTasks.put(creature, Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
index 8ab6c99d28..d56e0b8a23 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.buylist.Product;
/**
@@ -45,7 +46,7 @@ public class BuyListTaskManager
}
_workingProducts = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : PRODUCTS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 8b4a7db319..f8218055f3 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@@ -44,7 +45,7 @@ public class DecayTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -87,7 +88,7 @@ public class DecayTaskManager
}
// Add to decay schedules.
- DECAY_SCHEDULES.put(creature, System.currentTimeMillis() + (delay * 1000));
+ DECAY_SCHEDULES.put(creature, Chronos.currentTimeMillis() + (delay * 1000));
}
/**
@@ -107,7 +108,7 @@ public class DecayTaskManager
public long getRemainingTime(Creature creature)
{
final Long time = DECAY_SCHEDULES.get(creature);
- return time != null ? time.longValue() - System.currentTimeMillis() : Long.MAX_VALUE;
+ return time != null ? time.longValue() - Chronos.currentTimeMillis() : Long.MAX_VALUE;
}
@Override
@@ -122,7 +123,7 @@ public class DecayTaskManager
ret.append("Tasks dump:");
ret.append(Config.EOL);
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
ret.append("Class/Name: ");
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
index c3834ecbb9..e0f823bef4 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemAppearanceTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
index 27f0273802..de10959db8 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemLifeTimeTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 396633692c..160debb492 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -42,7 +43,7 @@ public class ItemManaTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
@@ -61,7 +62,7 @@ public class ItemManaTaskManager
{
if (!ITEMS.containsKey(item))
{
- ITEMS.put(item, System.currentTimeMillis() + MANA_CONSUMPTION_RATE);
+ ITEMS.put(item, Chronos.currentTimeMillis() + MANA_CONSUMPTION_RATE);
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
index eb0dd7a59f..a2f0dc5563 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.model.World;
@@ -48,7 +49,7 @@ public class MessageDeletionTaskManager
Integer msgId;
Message msg;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_MESSAGES.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
index 2f270649fb..82483a498a 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PlayerAutoSaveTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SEARCH: for (Entry entry : PLAYER_TIMES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -63,7 +64,7 @@ public class PlayerAutoSaveTaskManager
public void add(PlayerInstance player)
{
- PLAYER_TIMES.put(player, System.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
+ PLAYER_TIMES.put(player, Chronos.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
}
public void remove(PlayerInstance player)
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
index 6a406a9591..3a812e2fcb 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PvpFlagTaskManager
if (!PLAYERS.isEmpty())
{
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (PlayerInstance player : PLAYERS)
{
if (time > player.getPvpFlagLasts())
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
index 5473f21a8f..b8135996f8 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -43,7 +44,7 @@ public class RandomAnimationTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_ANIMATIONS.entrySet())
{
if (time > entry.getValue().longValue())
@@ -65,7 +66,7 @@ public class RandomAnimationTaskManager
{
if (npc.hasRandomAnimation())
{
- PENDING_ANIMATIONS.putIfAbsent(npc, System.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
+ PENDING_ANIMATIONS.putIfAbsent(npc, Chronos.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
index 8e8e818908..debb0d68e6 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Spawn;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -42,7 +43,7 @@ public class RespawnTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_RESPAWNS.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
index 990efb8b45..d1946b860a 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -36,6 +36,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskBirthday;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskRecom;
@@ -94,7 +95,7 @@ public class TaskManager
public void run()
{
task.onTimeElapsed(this);
- lastActivation = System.currentTimeMillis();
+ lastActivation = Chronos.currentTimeMillis();
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement statement = con.prepareStatement(SQL_STATEMENTS[1]))
{
@@ -242,7 +243,7 @@ public class TaskManager
try
{
final Date desired = DateFormat.getInstance().parse(task.getParams()[0]);
- final long diff = desired.getTime() - System.currentTimeMillis();
+ final long diff = desired.getTime() - Chronos.currentTimeMillis();
if (diff >= 0)
{
task.scheduled = ThreadPool.schedule(task, diff);
@@ -293,7 +294,7 @@ public class TaskManager
return false;
}
- delay = min.getTimeInMillis() - System.currentTimeMillis();
+ delay = min.getTimeInMillis() - Chronos.currentTimeMillis();
if (check.after(min) || (delay < 0))
{
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ui/SystemPanel.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ui/SystemPanel.java
index 8c01c1f8fe..a19a873bfe 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ui/SystemPanel.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ui/SystemPanel.java
@@ -31,6 +31,7 @@ import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.util.Locator;
@@ -42,7 +43,7 @@ public class SystemPanel extends JPanel
{
protected static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
- protected static final long START_TIME = System.currentTimeMillis();
+ protected static final long START_TIME = Chronos.currentTimeMillis();
public SystemPanel()
{
@@ -136,7 +137,7 @@ public class SystemPanel extends JPanel
lblConnected.setText("Connected: " + playerCount);
lblMaxConnected.setText("Max connected: " + World.MAX_CONNECTED_COUNT);
lblOfflineShops.setText("Offline trade: " + World.OFFLINE_TRADE_COUNT);
- lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - START_TIME));
+ lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(Chronos.currentTimeMillis() - START_TIME));
}
}, 1000, 1000);
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
index ec95816f82..cc8059f91a 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.PlayerCondOverride;
@@ -151,7 +152,7 @@ public class FloodProtectorAction
*/
private void banAccount()
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
if (LOGGER.isLoggable(Level.WARNING))
{
log(" banned for flooding ", _config.PUNISHMENT_TIME <= 0 ? "forever" : "for " + (_config.PUNISHMENT_TIME / 60000) + " mins");
@@ -171,7 +172,7 @@ public class FloodProtectorAction
final int charId = _client.getPlayer().getObjectId();
if (charId > 0)
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
}
if (LOGGER.isLoggable(Level.WARNING))
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
index e5912dd51b..d6580161c7 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World;
@@ -143,7 +144,7 @@ public class OfflineTradeUtil
if (player.getOfflineStartTime() == 0)
{
- player.setOfflineStartTime(System.currentTimeMillis());
+ player.setOfflineStartTime(Chronos.currentTimeMillis());
}
// Store trade on exit, if realtime saving is enabled.
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/FloodProtectedListener.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/FloodProtectedListener.java
index ba2fc6536a..e2bbcc1aa3 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/FloodProtectedListener.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/FloodProtectedListener.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author -Wooden-
@@ -63,9 +64,9 @@ public abstract class FloodProtectedListener extends Thread
if (fConnection != null)
{
fConnection.connectionNumber += 1;
- if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((System.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((System.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
+ if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
{
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
connection.close();
fConnection.connectionNumber -= 1;
if (!fConnection.isFlooding)
@@ -80,11 +81,11 @@ public abstract class FloodProtectedListener extends Thread
fConnection.isFlooding = false;
LOGGER.info(connection.getInetAddress().getHostAddress() + " is not considered as flooding anymore.");
}
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
}
else
{
- fConnection = new ForeignConnection(System.currentTimeMillis());
+ fConnection = new ForeignConnection(Chronos.currentTimeMillis());
_floodProtection.put(connection.getInetAddress().getHostAddress(), fConnection);
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/LoginController.java
index 189b90e2ee..9d382c646b 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/LoginController.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/LoginController.java
@@ -41,6 +41,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.GameServerTable.GameServerInfo;
@@ -176,7 +177,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(USER_INFO_SELECT))
{
- ps.setString(1, Long.toString(System.currentTimeMillis()));
+ ps.setString(1, Long.toString(Chronos.currentTimeMillis()));
ps.setString(2, login);
try (ResultSet rset = ps.executeQuery())
{
@@ -208,7 +209,7 @@ public class LoginController
{
ps.setString(1, login);
ps.setString(2, hashBase64);
- ps.setLong(3, System.currentTimeMillis());
+ ps.setLong(3, Chronos.currentTimeMillis());
ps.setInt(4, 0);
ps.setString(5, addr.getHostAddress());
ps.execute();
@@ -273,7 +274,7 @@ public class LoginController
*/
public void addBanForAddress(InetAddress address, long duration)
{
- _bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
+ _bannedIps.putIfAbsent(address, Chronos.currentTimeMillis() + duration);
}
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
@@ -294,7 +295,7 @@ public class LoginController
}
if (bi != null)
{
- if ((bi > 0) && (bi < System.currentTimeMillis()))
+ if ((bi > 0) && (bi < Chronos.currentTimeMillis()))
{
_bannedIps.remove(address);
LOGGER.info("Removed expired ip address ban " + address.getHostAddress() + ".");
@@ -541,7 +542,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(ACCOUNT_INFO_UPDATE))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.setString(2, address.getHostAddress());
ps.setString(3, info.getLogin());
ps.execute();
@@ -613,7 +614,7 @@ public class LoginController
{
continue;
}
- if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < System.currentTimeMillis())
+ if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < Chronos.currentTimeMillis())
{
client.close(LoginFailReason.REASON_ACCESS_FAILED);
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/network/LoginClient.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/network/LoginClient.java
index 04455664e2..93194a11c0 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/network/LoginClient.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/network/LoginClient.java
@@ -27,6 +27,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.IIncomingPacket;
import org.l2jmobius.commons.network.IOutgoingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.LoginController;
@@ -82,14 +83,14 @@ public class LoginClient extends ChannelInboundHandler
_addr = address.getAddress();
_channel = ctx.channel();
_sessionId = Rnd.nextInt();
- _connectionStartTime = System.currentTimeMillis();
+ _connectionStartTime = Chronos.currentTimeMillis();
sendPacket(new Init(_scrambledPair.getScrambledModulus(), _blowfishKey.getEncoded(), _sessionId));
}
@Override
public void channelInactive(ChannelHandlerContext ctx)
{
- if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < System.currentTimeMillis()))
+ if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < Chronos.currentTimeMillis()))
{
LoginController.getInstance().removeAuthedLoginClient(getAccount());
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
index 801bc957ae..875759b72a 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
@@ -24,6 +24,8 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* IPv4 filter.
* @author Forsaiken
@@ -59,7 +61,7 @@ public class IPv4Filter implements Runnable
Flood()
{
- lastAccess = System.currentTimeMillis();
+ lastAccess = Chronos.currentTimeMillis();
trys = 0;
}
}
@@ -74,7 +76,7 @@ public class IPv4Filter implements Runnable
}
final int h = hash(addr.getAddress());
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
Flood f;
synchronized (_ipFloodMap)
{
@@ -120,7 +122,7 @@ public class IPv4Filter implements Runnable
{
while (true)
{
- final long reference = System.currentTimeMillis() - (1000 * 300);
+ final long reference = Chronos.currentTimeMillis() - (1000 * 300);
synchronized (_ipFloodMap)
{
final Iterator> it = _ipFloodMap.entrySet().iterator();
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
index e66362d6c0..86b46f1919 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.model.Location;
@@ -137,7 +138,7 @@ public class Parade extends AbstractNpcAI
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
- LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
+ LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
}
void load()
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
index c91b42bb26..7757d82c61 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -304,7 +305,7 @@ public class TalentShow extends AbstractNpcAI
hourDiff *= 3600000;
minDiff *= 60000;
diff = hourDiff + minDiff;
- LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
+ LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
startQuestTimer("Start", diff, null, null); // first start
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
index 940193f4fc..32c8b9f9f1 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
@@ -16,6 +16,7 @@
*/
package ai.areas.GainakUnderground.Lailly;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -64,7 +65,7 @@ public class Lailly extends AbstractNpcAI
case "okay":
{
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
- if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis()))
+ if ((instance != null) && (instance.getEndTime() > Chronos.currentTimeMillis()))
{
switch (instance.getTemplateId())
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
index 9118e046f7..60cfac5c02 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java
@@ -29,6 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -516,7 +517,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
final GlobalVariablesManager vars = GlobalVariablesManager.getInstance();
final long var = vars.getLong("FourSepulchers" + npcId, 0) + (TIME_ATTACK * 60 * 1000);
- if (var > System.currentTimeMillis())
+ if (var > Chronos.currentTimeMillis())
{
showHtmlFile(player, npcId + "-NE.html", npc, null);
return;
@@ -581,7 +582,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
ThreadPool.schedule(() -> ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers(), TIME_ATTACK * 60 * 1000);
// Save attack time
- vars.set("FourSepulchers" + npcId, System.currentTimeMillis());
+ vars.set("FourSepulchers" + npcId, Chronos.currentTimeMillis());
// Init progress
STORED_PROGRESS.put(sepulcherId, 1); // start from 1
// Start
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
index 244867b7c6..ded5cf9a43 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
@@ -19,6 +19,7 @@ package ai.areas.KeucereusAllianceBase;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
@@ -109,7 +110,7 @@ public class LindviorScene extends AbstractNpcAI
final GregorianCalendar date = new GregorianCalendar();
date.set(Calendar.MINUTE, RESET_MIN);
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
- if (System.currentTimeMillis() >= date.getTimeInMillis())
+ if (Chronos.currentTimeMillis() >= date.getTimeInMillis())
{
date.add(Calendar.DAY_OF_WEEK, 1);
}
@@ -135,7 +136,7 @@ public class LindviorScene extends AbstractNpcAI
{
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
}
- return date.getTimeInMillis() - System.currentTimeMillis();
+ return date.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
index 80dffe38b2..de8ea0aea9 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
@@ -19,6 +19,7 @@ package ai.areas.Rune.RuneCastle.Venom;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -111,7 +112,7 @@ public class Venom extends AbstractNpcAI
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
index a7d7250e8b..c42186c0d0 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -229,7 +230,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
int buffsNow = 0;
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
- if (var < System.currentTimeMillis())
+ if (var < Chronos.currentTimeMillis())
{
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
@@ -254,7 +255,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
reenter.set(Calendar.MINUTE, 0);
reenter.set(Calendar.HOUR_OF_DAY, 13);
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
- if (reenter.getTimeInMillis() <= System.currentTimeMillis())
+ if (reenter.getTimeInMillis() <= Chronos.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 7);
}
@@ -272,7 +273,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
}
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
private void spawnGroupOfMinion(MonsterInstance npc, int[] mobIds)
@@ -317,7 +318,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
zone.clearSkills();
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
else if (event.equalsIgnoreCase("transform"))
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
index dd240473aa..19f709d566 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Anakim/Anakim.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -94,7 +95,7 @@ public class Anakim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ANAKIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_anakim", time, null, null);
@@ -128,7 +129,7 @@ public class Anakim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(ANAKIM, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -268,7 +269,7 @@ public class Anakim extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid())// Anakim and minions
{
// Anti BUGGERS
@@ -300,7 +301,7 @@ public class Anakim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ANAKIM, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(ANAKIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ANAKIM, info);
startQuestTimer("unlock_anakim", respawnTime, null, null);
@@ -360,7 +361,7 @@ public class Anakim extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
index 4a77fb6bfd..fe808aef25 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Antharas/Antharas.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.MountType;
@@ -169,14 +170,14 @@ public class Antharas extends AbstractNpcAI
_antharas = (GrandBossInstance) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
_antharas.setCurrentHpMp(curr_hp, curr_mp);
addBoss(_antharas);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
break;
}
case DEAD:
{
- final long remain = respawnTime - System.currentTimeMillis();
+ final long remain = respawnTime - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -272,7 +273,7 @@ public class Antharas extends AbstractNpcAI
_antharas.setRandomWalking(false);
_antharas.teleToLocation(181323, 114850, -7623, 32542);
setStatus(IN_FIGHT);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
zone.broadcastPacket(new PlaySound("BS02_A"));
startQuestTimer("CAMERA_1", 23, _antharas, null);
break;
@@ -367,7 +368,7 @@ public class Antharas extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 900000) < Chronos.currentTimeMillis()))
{
setStatus(ALIVE);
for (Creature creature : zone.getCharactersInside())
@@ -619,7 +620,7 @@ public class Antharas extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BOMBER)
{
if (npc.calculateDistance3D(attacker) < 230)
@@ -765,7 +766,7 @@ public class Antharas extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
+ GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
}
private final void refreshAiParams(PlayerInstance attacker, int damage)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Baium/Baium.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Baium/Baium.java
index b6bf605bd9..11c4fff3ef 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Baium/Baium.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Baium/Baium.java
@@ -17,6 +17,7 @@
package ai.bosses.Baium;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.CategoryType;
@@ -134,7 +135,7 @@ public class Baium extends AbstractNpcAI
final int heading = info.getInt("heading");
_baium = (GrandBossInstance) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
_baium.setCurrentHpMp(curr_hp, curr_mp);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
addBoss(_baium);
for (Location loc : ARCHANGEL_LOC)
@@ -147,7 +148,7 @@ public class Baium extends AbstractNpcAI
}
case DEAD:
{
- final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -202,7 +203,7 @@ public class Baium extends AbstractNpcAI
_baium.disableCoreAI(true);
_baium.setRandomWalking(false);
addBoss(_baium);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
@@ -368,7 +369,7 @@ public class Baium extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
{
notifyEvent("CLEAR_ZONE", null, null);
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
@@ -376,7 +377,7 @@ public class Baium extends AbstractNpcAI
}
else if (npc != null)
{
- if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
+ if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
{
npc.setTarget(npc);
npc.doCast(HEAL_OF_BAIUM.getSkill());
@@ -477,7 +478,7 @@ public class Baium extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BAIUM)
{
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
@@ -656,7 +657,7 @@ public class Baium extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
+ GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
}
private void manageSkills(Npc npc)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
index aa8528926d..dfce75d90b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -108,7 +109,7 @@ public class Beleth extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("BELETH_UNLOCK", time, null, null);
@@ -349,7 +350,7 @@ public class Beleth extends AbstractNpcAI
c.setImmobilized(false);
}
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, null, null);
startQuestTimer("SPAWN25", 60000, null, null);
break;
@@ -507,7 +508,7 @@ public class Beleth extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((_lastAttack + 900000) < System.currentTimeMillis())
+ if ((_lastAttack + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -708,7 +709,7 @@ public class Beleth extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(REAL_BELETH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
deleteAll();
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Core/Core.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Core/Core.java
index 969bb08788..69dc20dc5d 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Core/Core.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Core/Core.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -89,7 +90,7 @@ public class Core extends AbstractNpcAI
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
@@ -206,7 +207,7 @@ public class Core extends AbstractNpcAI
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
index 5570d66bbc..2357d9625e 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -331,7 +332,7 @@ public class EtisVanEtina extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ETIS_VAN_ETINA1);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_etina", time, null, null);
@@ -359,7 +360,7 @@ public class EtisVanEtina extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
if (GrandBossManager.getInstance().getBossStatus(ETIS_VAN_ETINA1) != ALIVE)
{
@@ -514,7 +515,7 @@ public class EtisVanEtina extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
// Anti BUGGERS
if (!BOSS_ZONE.isInsideZone(attacker))
{
@@ -697,7 +698,7 @@ public class EtisVanEtina extends AbstractNpcAI
_paragon.setInvul(true);
BOSS_ZONE.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_CAN_T_DEFEAT_PARAGON_WHILE_PARAGON_S_MINIONS_ARE_ALIVE, ExShowScreenMessage.TOP_CENTER, 7000, true)));
GrandBossManager.getInstance().setBossStatus(ETIS_VAN_ETINA1, FIGHTING);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
}
}
@@ -738,7 +739,7 @@ public class EtisVanEtina extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ETIS_VAN_ETINA1, DEAD);
final long respawnTime = (Config.ETINA_SPAWN_INTERVAL + getRandom(-Config.ETINA_SPAWN_RANDOM, Config.ETINA_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(ETIS_VAN_ETINA1);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ETIS_VAN_ETINA1, info);
startQuestTimer("unlock_etina", respawnTime, null, null);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java
index a84a00f051..817641abee 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java
@@ -20,6 +20,7 @@ package ai.bosses.Fafurion;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -84,7 +85,7 @@ public class Fafurion extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(FAFURION_GRANDBOSS_ID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_fafurion", time, null, null);
@@ -449,7 +450,7 @@ public class Fafurion extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(FAFURION_GRANDBOSS_ID, DEAD);
final long respawnTime = (Config.FAFURION_SPAWN_INTERVAL + getRandom(-Config.FAFURION_SPAWN_RANDOM, Config.FAFURION_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(FAFURION_GRANDBOSS_ID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(FAFURION_GRANDBOSS_ID, info);
startQuestTimer("unlock_fafurion", respawnTime, null, null);
if (_stage < 7)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
index 3ed92d8f08..b499a47575 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.MountType;
@@ -295,7 +296,7 @@ public class IceQueensCastleBattle extends AbstractInstance
{
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
- controller.getVariables().set("TIMER_END", System.currentTimeMillis() + 360000);
+ controller.getVariables().set("TIMER_END", Chronos.currentTimeMillis() + 360000);
}
break;
}
@@ -688,7 +689,7 @@ public class IceQueensCastleBattle extends AbstractInstance
}
case "SHOW_GLAKIAS_TIMER":
{
- final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - System.currentTimeMillis()) / 1000);
+ final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - Chronos.currentTimeMillis()) / 1000);
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
break;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
index acbc2c3094..6023594423 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
@@ -23,6 +23,7 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -143,11 +144,11 @@ public class ScarletVanHalisha extends AbstractNpcAI
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
}
@@ -248,7 +249,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
case FRINTEZZA_DAEMON_MORPH:
case FRINTEZZA_DAEMON_FIELD:
{
- _lastRangedSkillTime = System.currentTimeMillis();
+ _lastRangedSkillTime = Chronos.currentTimeMillis();
skillRange = 550;
break;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Helios/Helios.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Helios/Helios.java
index af4d5b4e8e..7e5c37bf69 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Helios/Helios.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Helios/Helios.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +151,7 @@ public class Helios extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(HELIOS3);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_helios", time, null, null);
@@ -496,7 +497,7 @@ public class Helios extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(HELIOS3, DEAD);
final long respawnTime = (Config.HELIOS_SPAWN_INTERVAL + getRandom(-Config.HELIOS_SPAWN_RANDOM, Config.HELIOS_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(HELIOS3);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(HELIOS3, info);
startQuestTimer("unlock_helios", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
index 81fd9ae6e8..9c32d36ecf 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.Movie;
@@ -121,7 +122,7 @@ public class Kelbim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(KELBIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_kelbim", time, null, null);
@@ -156,7 +157,7 @@ public class Kelbim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(KELBIM, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -193,7 +194,7 @@ public class Kelbim extends AbstractNpcAI
{
_kelbimBoss = (GrandBossInstance) addSpawn(KELBIM, -56340, 60801, -269, 54262, false, 0);
GrandBossManager.getInstance().addBoss(_kelbimBoss);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
startQuestTimer("stage_all_random_area_attack", Rnd.get(2, 3) * 60000, null, null);
break;
@@ -369,7 +370,7 @@ public class Kelbim extends AbstractNpcAI
{
if (npc.getId() == KELBIM)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
switch (_bossStage)
{
@@ -434,7 +435,7 @@ public class Kelbim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(KELBIM, DEAD);
final long respawnTime = (Config.KELBIM_SPAWN_INTERVAL + getRandom(-Config.KELBIM_SPAWN_RANDOM, Config.KELBIM_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(KELBIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(KELBIM, info);
startQuestTimer("unlock_kelbim", respawnTime, null, null);
startQuestTimer("end_kelbim", 1800000, null, null);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
index 4bbabf6033..5baa3831ec 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Lilith/Lilith.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
@@ -93,7 +94,7 @@ public class Lilith extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LILITH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lilith", time, null, null);
@@ -127,7 +128,7 @@ public class Lilith extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(LILITH, ALIVE);
for (Creature creature : BOSS_ZONE.getCharactersInside())
@@ -251,7 +252,7 @@ public class Lilith extends AbstractNpcAI
// Spawn the rb
_lilithBoss = addSpawn(LILITH, 185062, -9605, -5499, 15640, false, 0);
GrandBossManager.getInstance().addBoss((GrandBossInstance) _lilithBoss);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null, true);
startQuestTimer("end_lilith", 60 * 60000, null, null); // 1h
}
@@ -261,7 +262,7 @@ public class Lilith extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isPet)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
if (npc.isMinion() || npc.isRaid()) // Lilith and minions
{
// Anti BUGGERS
@@ -293,7 +294,7 @@ public class Lilith extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LILITH, DEAD);
final long respawnTime = getRespawnTime();
final StatSet info = GrandBossManager.getInstance().getStatSet(LILITH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LILITH, info);
startQuestTimer("unlock_lilith", respawnTime, null, null);
@@ -353,7 +354,7 @@ public class Lilith extends AbstractNpcAI
{
reenter = day2;
}
- return reenter.getTimeInMillis() - System.currentTimeMillis();
+ return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
}
@Override
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
index 6b02643bc0..63811284a1 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -213,7 +214,7 @@ public class Lindvior extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lindvior", time, null, null);
@@ -863,7 +864,7 @@ public class Lindvior extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
final long respawnTime = (Config.LINDVIOR_SPAWN_INTERVAL + getRandom(-Config.LINDVIOR_SPAWN_RANDOM, Config.LINDVIOR_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
startQuestTimer("unlock_lindvior", respawnTime, null, null);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
index 8f5d996e6c..5108b80c03 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -88,7 +89,7 @@ public class Orfen extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for Orfen from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if Orfen is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -309,7 +310,7 @@ public class Orfen extends AbstractNpcAI
startQuestTimer("orfen_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ORFEN, info);
cancelQuestTimer("check_minion_loc", npc, null);
startQuestTimer("despawn_minions", 20000, null, null);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index f2869a3fe9..c00a82fb97 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -96,7 +97,7 @@ public class QueenAnt extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for queen ant from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if queen ant is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -367,7 +368,7 @@ public class QueenAnt extends AbstractNpcAI
cancelQuestTimer("heal", null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(QUEEN, info);
_nurses.clear();
_larva.deleteMe();
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
index eda49595a1..fd26faf27c 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.QueenShyeed;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -87,7 +88,7 @@ public class QueenShyeed extends AbstractNpcAI
private void spawnShyeed()
{
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
- final long remain = respawn != 0 ? respawn - System.currentTimeMillis() : 0;
+ final long remain = respawn != 0 ? respawn - Chronos.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("respawn", remain, null, null);
@@ -103,7 +104,7 @@ public class QueenShyeed extends AbstractNpcAI
private void startRespawn()
{
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
- GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(System.currentTimeMillis() + respawnTime));
+ GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(Chronos.currentTimeMillis() + respawnTime));
startQuestTimer("respawn", respawnTime, null, null);
// MOB_BUFF_ZONE.setEnabled(false);
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
index e6cd81dbf4..b02a51942f 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -137,7 +138,7 @@ public class Ramona extends AbstractNpcAI
addAttackId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3);
addSpawnId(RAMONA_1, RAMONA_2, RAMONA_3);
- final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - System.currentTimeMillis();
+ final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - Chronos.currentTimeMillis();
if (temp > 0)
{
_boss = Status.DEAD;
@@ -167,7 +168,7 @@ public class Ramona extends AbstractNpcAI
npc.setInvul(false);
cancelQuestTimers("SPAWN_MS");
startQuestTimer("CHECK_ACTIVITY_TASK", 5000, null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
}
break;
}
@@ -186,7 +187,7 @@ public class Ramona extends AbstractNpcAI
startQuestTimer("GENERATOR_2", getRandom(900000, 1200000), null, null);
startQuestTimer("GENERATOR_3", getRandom(1500000, 1800000), null, null);
startQuestTimer("GENERATOR_4", getRandom(2100000, 2400000), null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("RAMONA1_SKILL", 6000, _ramona1, null);
break;
}
@@ -300,7 +301,7 @@ public class Ramona extends AbstractNpcAI
}
case "CHECK_ACTIVITY_TASK":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
for (Creature creature : ZONE.getCharactersInside())
{
@@ -396,17 +397,17 @@ public class Ramona extends AbstractNpcAI
}
case RAMONA_1:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
@@ -540,7 +541,7 @@ public class Ramona extends AbstractNpcAI
{
_boss = Status.DEAD;
final long respawnTime = (Config.RAMONA_SPAWN_INTERVAL + getRandom(-Config.RAMONA_SPAWN_RANDOM, Config.RAMONA_SPAWN_RANDOM)) * 3600000;
- GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, Chronos.currentTimeMillis() + respawnTime);
startQuestTimer("RAMONA_UNLOCK", respawnTime, null, null);
startQuestTimer("END_RAMONA", 90000, null, null);
break;
@@ -568,13 +569,13 @@ public class Ramona extends AbstractNpcAI
case RAMONA_1:
{
_boss = Status.IN_FIGHT;
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
index 4d4eb8653a..be58208558 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.Sailren;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -71,7 +72,7 @@ public class Sailren extends AbstractNpcAI
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
- final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
+ final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - Chronos.currentTimeMillis();
if (remain > 0)
{
STATUS = Status.DEAD;
@@ -118,7 +119,7 @@ public class Sailren extends AbstractNpcAI
{
takeItems(player, GAZKH, 1);
STATUS = Status.IN_FIGHT;
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
for (PlayerInstance member : player.getParty().getMembers())
{
if (member.isInsideRadius3D(npc, 1000))
@@ -237,7 +238,7 @@ public class Sailren extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
+ if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < Chronos.currentTimeMillis()))
{
cancelQuestTimer("TIME_OUT", null, null);
notifyEvent("TIME_OUT", null, null);
@@ -257,7 +258,7 @@ public class Sailren extends AbstractNpcAI
{
if (zone.isCharacterInZone(attacker))
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -274,7 +275,7 @@ public class Sailren extends AbstractNpcAI
STATUS = Status.DEAD;
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
final long respawnTime = RESPAWN * 3600000;
- GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set("SailrenRespawn", Chronos.currentTimeMillis() + respawnTime);
cancelQuestTimer("CHECK_ATTACK", null, null);
cancelQuestTimer("TIME_OUT", null, null);
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
index 0c824fd3b2..523f53e898 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -326,7 +327,7 @@ public class Trasken extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_trasken", time, null, null);
@@ -604,7 +605,7 @@ public class Trasken extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
startQuestTimer("unlock_trasken", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
index 94d29e346e..c8e0f497af 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.MountType;
@@ -129,7 +130,7 @@ public class Valakas extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for valakas from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (temp > 0)
{
// The time has not yet expired. Mark Valakas as currently locked (dead).
@@ -168,7 +169,7 @@ public class Valakas extends AbstractNpcAI
if (status == FIGHTING)
{
// stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
startQuestTimer("regen_task", 60000, valakas, null, true);
startQuestTimer("skill_task", 2000, valakas, null, true);
@@ -196,7 +197,7 @@ public class Valakas extends AbstractNpcAI
if (event.equalsIgnoreCase("beginning"))
{
// Stores current time
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
// Teleport Valakas to his lair.
npc.teleToLocation(VALAKAS_LAIR);
@@ -220,7 +221,7 @@ public class Valakas extends AbstractNpcAI
else if (event.equalsIgnoreCase("regen_task"))
{
// Inactivity task - 15min
- if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
+ if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < Chronos.currentTimeMillis()))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
@@ -416,7 +417,7 @@ public class Valakas extends AbstractNpcAI
npc.setTarget(attacker);
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
}
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -447,7 +448,7 @@ public class Valakas extends AbstractNpcAI
startQuestTimer("valakas_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
return super.onKill(npc, killer, isSummon);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
index 32f96496cb..1326e0bdab 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
@@ -46,8 +46,8 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcManorBypass;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.teleporter.TeleportHolder;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index 8eb06bae3d..58a1832471 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -26,6 +26,7 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -153,7 +154,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -189,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
@@ -247,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
@@ -296,7 +297,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0]");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
sb.append(" | ");
sb.append(auction.getHighestBid());
sb.append(" | ");
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
index f469c39159..2362aa9446 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -21,6 +21,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.Location;
@@ -73,7 +74,7 @@ public class ProvisionalHalls extends AbstractNpcAI
if (resetTime > 0)
{
cancelQuestTimers(HALL_RESET_VAR + id);
- startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
}
}
}
@@ -126,7 +127,7 @@ public class ProvisionalHalls extends AbstractNpcAI
for (int id : CLAN_HALLS.keySet())
{
- if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < Chronos.currentTimeMillis()))
{
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
@@ -137,7 +138,7 @@ public class ProvisionalHalls extends AbstractNpcAI
clanHall.setOwner(player.getClan());
}
player.sendMessage("Congratulations! You now own a provisional clan hall!");
- startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
return null;
}
}
@@ -177,7 +178,7 @@ public class ProvisionalHalls extends AbstractNpcAI
else if (event.startsWith(HALL_RESET_VAR))
{
final String id = event.replace(HALL_RESET_VAR, "");
- if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
{
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
if (clanId > 0)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index 18f813b1a2..a3c74220a9 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -19,6 +19,7 @@ package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -111,7 +112,7 @@ public class TrainingCamp extends AbstractNpcAI
player.teleToLocation(TRAINING_LOCATION);
player.setImmobilized(true);
// @Sdw: Here we are supposed to send ExUserInfoEquipSlot with a fake equip of a SLS, feels ugly to me, not doing it.
- player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
+ player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), Chronos.currentTimeMillis(), -1));
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
@@ -203,7 +204,7 @@ public class TrainingCamp extends AbstractNpcAI
final TrainingHolder holder = player.getTraingCampInfo();
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
index 49dfa6b963..6140daa716 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
@@ -16,6 +16,7 @@
*/
package events.FreyaCelebration;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -79,7 +80,7 @@ public class FreyaCelebration extends LongTimeEvent
{
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
if (currentTime > reuseTime)
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
index cce5b52533..d97b3c74db 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
@@ -16,6 +16,7 @@
*/
package events.GiftOfVitality;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -94,9 +95,9 @@ public class GiftOfVitality extends LongTimeEvent
case "vitality":
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -110,7 +111,7 @@ public class GiftOfVitality extends LongTimeEvent
{
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
htmltext = "4306-okvitality.htm";
}
break;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/HappyHours/HappyHours.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/HappyHours/HappyHours.java
index edebac38cf..29c8abcbf5 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/HappyHours/HappyHours.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/HappyHours/HappyHours.java
@@ -16,6 +16,7 @@
*/
package events.HappyHours;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -39,7 +40,7 @@ public class HappyHours extends LongTimeEvent
// Other
private static final int MIN_LEVEL = 20;
private static final int REWARD_INTERVAL = 60 * 60 * 1000; // 1 hour
- private static long _lastRewardTime = System.currentTimeMillis();
+ private static long _lastRewardTime = Chronos.currentTimeMillis();
private HappyHours()
{
@@ -76,9 +77,9 @@ public class HappyHours extends LongTimeEvent
{
if (isEventPeriod())
{
- if ((System.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
+ if ((Chronos.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
{
- _lastRewardTime = System.currentTimeMillis();
+ _lastRewardTime = Chronos.currentTimeMillis();
final ExShowScreenMessage screenMsg = new ExShowScreenMessage("You obtained 20 Sibi's coins.", ExShowScreenMessage.TOP_CENTER, 7000, 0, true, true);
final SystemMessage systemMsg = new SystemMessage(SystemMessageId.YOU_VE_OBTAINED_S1_LUCKY_COINS);
systemMsg.addInt(20);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
index 038d7883b0..7fb3b481dd 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
@@ -16,6 +16,7 @@
*/
package events.LoveYourGatekeeper;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -58,9 +59,9 @@ public class LoveYourGatekeeper extends LongTimeEvent
if (player.getAdena() >= PRICE)
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -73,7 +74,7 @@ public class LoveYourGatekeeper extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, PRICE);
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
}
}
else
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
index f7d34dfccd..6615d3e9c8 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
@@ -16,6 +16,7 @@
*/
package events.MasterOfEnchanting;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -86,7 +87,7 @@ public class MasterOfEnchanting extends LongTimeEvent
}
else if (event.equalsIgnoreCase("buy_scroll_24"))
{
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
final String value = player.getVariables().getString("MasterOfEnchanting", "");
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
@@ -100,7 +101,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
@@ -134,7 +135,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/SavingSanta/SavingSanta.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
index cf11305ced..67f5d5b625 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -324,7 +325,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_rewardedPlayers.containsKey(pl.getAccountName()))
{
- final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
+ final long elapsedTimeSinceLastRewarded = Chronos.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
{
continue;
@@ -333,7 +334,7 @@ public class SavingSanta extends LongTimeEvent
else
{
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
- if ((System.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
+ if ((Chronos.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
{
_rewardedPlayers.put(pl.getAccountName(), time);
continue;
@@ -343,8 +344,8 @@ public class SavingSanta extends LongTimeEvent
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
- _rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
- player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
+ _rewardedPlayers.put(pl.getAccountName(), Chronos.currentTimeMillis());
+ player.getVariables().set("LAST_SANTA_REWARD", Chronos.currentTimeMillis());
startQuestTimer("SantaRewarding0", 500, santa, pl);
}
}
@@ -437,7 +438,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
{
startQuestTimer("SantaBlessings", 15000, null, null);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Npc santaHelper1 : _santaHelpers)
{
for (PlayerInstance plb : World.getInstance().getVisibleObjects(santaHelper1, PlayerInstance.class))
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java
index 5c332ec4ee..4e185fe8e2 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java
@@ -18,6 +18,7 @@ package events.TrainingWithDandy;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -66,7 +67,7 @@ public class TrainingWithDandy extends LongTimeEvent
{
npc.setTarget(player);
npc.doCast(DANDY_CH.getSkill());
- player.getVariables().set(GIVE_DANDI_BUFF_VAR, System.currentTimeMillis());
+ player.getVariables().set(GIVE_DANDI_BUFF_VAR, Chronos.currentTimeMillis());
player.broadcastStatusUpdate();
htmltext = "33894-2.htm";
break;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
index 64d4112e1f..729838d853 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Collection;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.CursedWeapon;
@@ -209,7 +210,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
}
- cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
+ cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
cw.reActivate();
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
index 9801093a20..0e4285c8e3 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Calendar;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -66,7 +67,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
{
final Calendar nextChangeDate = Calendar.getInstance();
- nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
+ nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
html.replace("%sodtime%", nextChangeDate.getTime().toString());
}
else
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
index 72117290b3..6855d75da1 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.World;
@@ -117,7 +118,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
int hours = 0;
int minutes = 0;
final int id = entry.getKey();
- final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
if (remainingTime > 0)
{
hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
index 5fffc77ae3..8c3faede2d 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -233,7 +234,7 @@ public class AdminPunishment implements IAdminCommandHandler
long expirationTime = Integer.parseInt(exp);
if (expirationTime > 0)
{
- expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
+ expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
}
final PunishmentAffect affect = PunishmentAffect.getByName(af);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
index aa1d6dd435..ae1bb4e0b2 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -60,7 +61,7 @@ public class AdminServerInfo implements IAdminCommandHandler
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
- html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
+ html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
html.replace("%serverUpTime%", getServerUpTime());
html.replace("%onlineAll%", getPlayersCount("ALL"));
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
@@ -76,7 +77,7 @@ public class AdminServerInfo implements IAdminCommandHandler
private String getServerUpTime()
{
- long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
+ long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
final long days = TimeUnit.MILLISECONDS.toDays(time);
time -= TimeUnit.DAYS.toMillis(days);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
index ff3b82a10f..21489c89f6 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IBypassHandler;
@@ -133,7 +134,7 @@ public class FindPvP implements IBypassHandler
player.setSpawnProtection(true);
if (!player.isGM())
{
- player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
player.startPvPFlag();
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
index a81161c50a..adb3c27701 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.dailymissionhandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -61,9 +62,9 @@ public class LoginMonthDailyMissionHandler extends AbstractDailyMissionHandler
final long lastCompleted = entry.getLastCompleted();
if (lastCompleted == 0) // Initial entry.
{
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
}
- else if ((System.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
+ else if ((Chronos.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
index 9fee9dd50e..0322107487 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
@@ -18,6 +18,7 @@ package handlers.dailymissionhandlers;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -63,7 +64,7 @@ public class LoginWeekendDailyMissionHandler extends AbstractDailyMissionHandler
final int currentDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
final long lastCompleted = entry.getLastCompleted();
if (((currentDay == Calendar.SATURDAY) || (currentDay == Calendar.SUNDAY)) // Reward only on weekend.
- && ((lastCompleted == 0) || ((System.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
+ && ((lastCompleted == 0) || ((Chronos.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
index bfe0c1ce4b..dda4fa4bdb 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
@@ -17,6 +17,7 @@
package handlers.effecthandlers;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -55,7 +56,7 @@ public class AddHuntingTime extends AbstractEffect
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
long endTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, 0);
if ((endTime > currentTime) && (((endTime - currentTime) + _time) >= Config.TIME_LIMITED_MAX_ADDED_TIME))
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
index 71928b144a..c2ea6f7a5a 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.punishmenthandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.model.World;
@@ -126,7 +127,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 245af11bfa..2abbe8e8e8 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -17,6 +17,7 @@
package handlers.punishmenthandlers;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
@@ -180,7 +181,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
index 3dd1cdc97d..fd92c92ed9 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Ban implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
index f653561c0d..85b92a163b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class BanChat implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
index cf3736fc0e..c21718ad0c 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Jail implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
index 43b6df41dc..a57194664d 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
@@ -18,6 +18,7 @@ package handlers.usercommandhandlers;
import java.text.SimpleDateFormat;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -46,7 +47,7 @@ public class ClanPenalty implements IUserCommandHandler
final StringBuilder htmlContent = new StringBuilder(500);
htmlContent.append("");
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append("Unable to join a clan. | ");
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
@@ -54,7 +55,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append(" | Unable to create a clan. | ");
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
@@ -62,7 +63,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
+ if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
{
htmlContent.append(" | Unable to invite a clan member. | ");
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/usercommandhandlers/Time.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
index 530047a4f2..57bd48cd81 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Time implements IUserCommandHandler
player.sendPacket(sm);
if (Config.DISPLAY_SERVER_TIME)
{
- player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
+ player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
}
return true;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
index a2eab150c7..f727b3518f 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
@@ -18,6 +18,7 @@ package handlers.voicedcommandhandlers;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
@@ -103,7 +104,7 @@ public class ChatAdmin implements IVoicedCommandHandler
return false;
}
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
if (expirationTime > 0)
{
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
index 213e03e20a..5bf36c47d0 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
@@ -19,6 +19,7 @@ package handlers.voicedcommandhandlers;
import java.text.SimpleDateFormat;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Premium implements IVoicedCommandHandler
html.append(" |
Spoil Chance: x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " |
");
html.append("Spoil Amount: x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " |
");
html.append("Expires: " + format.format(endDate) + " |
");
- html.append("Current Date: " + format.format(System.currentTimeMillis()) + "
|
");
+ html.append("Current Date: " + format.format(Chronos.currentTimeMillis()) + "
|
");
html.append("Premium Info & Rules
|
");
html.append("1. Premium accounts CAN NOT BE TRANSFERED. |
");
html.append("2. Premium does not effect party members. |
");
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
index 4dedee6473..6a07191990 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -156,7 +157,7 @@ public class CastleDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -174,7 +175,7 @@ public class CastleDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
index 686b01379b..ea8ca11b83 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -169,7 +170,7 @@ public class FortressDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -197,7 +198,7 @@ public class FortressDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
index 45403c411d..48c9f0e21d 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
@@ -469,7 +470,7 @@ public class Kamaloka extends AbstractInstance
continue;
}
// if found instance still can't be reentered - exit
- if (System.currentTimeMillis() < entry.getValue().longValue())
+ if (Chronos.currentTimeMillis() < entry.getValue().longValue())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
sm.addPcName(partyMember);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
index b3de2f227a..31fa72d28c 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
@@ -260,7 +261,7 @@ public class PailakaRuneCastle extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first wave
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
}
@@ -280,7 +281,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
@@ -309,7 +310,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q10825_ForVictory/Q10825_ForVictory.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q10825_ForVictory/Q10825_ForVictory.java
index 1cd05e1498..02f3f30086 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q10825_ForVictory/Q10825_ForVictory.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q10825_ForVictory/Q10825_ForVictory.java
@@ -16,6 +16,7 @@
*/
package quests.Q10825_ForVictory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -138,7 +139,7 @@ public class Q10825_ForVictory extends Quest
case "mark":
{
final long TIME_CHECK = Long.parseLong(qs.get("TimeCheck"));
- final long CURRENT_TIME = System.currentTimeMillis();
+ final long CURRENT_TIME = Chronos.currentTimeMillis();
final long SIEGE_LENGTH = 7200000; // 2 hours in milliseconds
switch (npc.getId())
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/Chronos.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/Chronos.java
new file mode 100644
index 0000000000..a4d15f77e5
--- /dev/null
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/Chronos.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2021 Pantelis Andrianakis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.l2jmobius.commons.util;
+
+/**
+ * Chronos updates an internal long value with System.currentTimeMillis() approximately every 1 millisecond.
+ * To get the current time in milliseconds use Chronos.currentTimeMillis()
+ * @author Pantelis Andrianakis
+ * @version February 3rd 2021
+ */
+public class Chronos extends Thread
+{
+ private long _currentTimeMillis = System.currentTimeMillis();
+
+ public Chronos()
+ {
+ super.setName("Chronos");
+ super.setPriority(MAX_PRIORITY);
+ super.setDaemon(true);
+ super.start();
+ }
+
+ @Override
+ public void run()
+ {
+ while (true)
+ {
+ _currentTimeMillis = System.currentTimeMillis();
+
+ // Sleep for approximately 1 millisecond.
+ try
+ {
+ Thread.sleep(1);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /**
+ * Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond,the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
+ *
+ * See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).
+ * @return the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+ */
+ public static long currentTimeMillis()
+ {
+ return getInstance()._currentTimeMillis;
+ }
+
+ public static Chronos getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final Chronos INSTANCE = new Chronos();
+ }
+}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java
index b5864a1518..665cd5a0f9 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java
@@ -32,6 +32,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.enums.ServerMode;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.DeadLockDetector;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.BotReportTable;
@@ -185,7 +186,7 @@ public class GameServer
public GameServer() throws Exception
{
- final long serverLoadStart = System.currentTimeMillis();
+ final long serverLoadStart = Chronos.currentTimeMillis();
// GUI
if (!GraphicsEnvironment.isHeadless())
@@ -471,7 +472,7 @@ public class GameServer
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
- LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
+ LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
ClientNetworkManager.getInstance().start();
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameTimeController.java
index aa4d359090..48391b466d 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameTimeController.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange;
@@ -97,7 +98,7 @@ public class GameTimeController extends Thread
*/
public int getGameTicks()
{
- return (int) ((System.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
+ return (int) ((Chronos.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
}
/**
@@ -155,7 +156,7 @@ public class GameTimeController extends Thread
while (true)
{
- nextTickTime = ((System.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
+ nextTickTime = ((Chronos.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
try
{
@@ -166,7 +167,7 @@ public class GameTimeController extends Thread
LOGGER.log(Level.WARNING, getClass().getSimpleName(), e);
}
- sleepTime = nextTickTime - System.currentTimeMillis();
+ sleepTime = nextTickTime - Chronos.currentTimeMillis();
if (sleepTime > 0)
{
try
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
index 2fcae24603..cfb16ebb07 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -42,7 +43,7 @@ public class ItemsAutoDestroy
public synchronized void addItem(ItemInstance item)
{
- item.setDropTime(System.currentTimeMillis());
+ item.setDropTime(Chronos.currentTimeMillis());
_items.add(item);
}
@@ -53,7 +54,7 @@ public class ItemsAutoDestroy
return;
}
- final long curtime = System.currentTimeMillis();
+ final long curtime = Chronos.currentTimeMillis();
final Iterator itemIterator = _items.iterator();
while (itemIterator.hasNext())
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/Shutdown.java
index 5279bac36d..d7328247aa 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/Shutdown.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseBackup;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
@@ -529,19 +530,19 @@ public class Shutdown extends Thread
protected void restartCounter()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
}
protected long getEstimatedTimeAndRestartCounter()
{
- final long toReturn = System.currentTimeMillis() - _startTime;
+ final long toReturn = Chronos.currentTimeMillis() - _startTime;
restartCounter();
return toReturn;
}
protected long getEstimatedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/CreatureAI.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/CreatureAI.java
index 22de59f51a..e03e0463be 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/CreatureAI.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/CreatureAI.java
@@ -33,6 +33,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -308,7 +309,7 @@ public class CreatureAI extends AbstractAI
if (_actor.isAttackingNow())
{
- ThreadPool.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(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index fa5cca3384..26734231aa 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -39,7 +40,7 @@ public class WarehouseCacheManager
public void addCacheTask(PlayerInstance pc)
{
- CACHED_WH.put(pc, System.currentTimeMillis());
+ CACHED_WH.put(pc, Chronos.currentTimeMillis());
}
public void remCacheTask(PlayerInstance pc)
@@ -56,7 +57,7 @@ public class WarehouseCacheManager
@Override
public void run()
{
- final long cTime = System.currentTimeMillis();
+ final long cTime = Chronos.currentTimeMillis();
for (Entry entry : CACHED_WH.entrySet())
{
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/BotReportTable.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/BotReportTable.java
index 0e2f9777b7..46e025bd3d 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/BotReportTable.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/BotReportTable.java
@@ -39,6 +39,7 @@ import org.xml.sax.helpers.DefaultHandler;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -124,7 +125,7 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() < c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() < c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
}
@@ -290,7 +291,7 @@ public class BotReportTable
return false;
}
- final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
+ final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
@@ -301,7 +302,7 @@ public class BotReportTable
}
}
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
if (rcd == null)
{
rcd = new ReportedCharData();
@@ -418,12 +419,12 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() > c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() > c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
}
- ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
+ ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - Chronos.currentTimeMillis());
}
catch (Exception e)
{
@@ -464,7 +465,7 @@ public class BotReportTable
{
if (map.containsKey(objectId))
{
- return (System.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
+ return (Chronos.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
}
return true;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/sql/ClanTable.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
index 4e4da8df06..10f7e0b311 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.enums.ClanWarState;
@@ -171,7 +172,7 @@ public class ClanTable
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
return null;
}
- if (System.currentTimeMillis() < player.getClanCreateExpiryTime())
+ if (Chronos.currentTimeMillis() < player.getClanCreateExpiryTime())
{
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
return null;
@@ -346,7 +347,7 @@ public class ClanTable
{
destroyClan(clanId);
}
- }, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
+ }, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
}
public boolean isAllyExists(String allyName)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index 49b0381c91..c3ab796fbf 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World;
@@ -185,7 +186,7 @@ public class OfflineTraderTable
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- if (cal.getTimeInMillis() <= System.currentTimeMillis())
+ if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
{
continue;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
index 771af1a0a5..8f51b3f599 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.enums.SpecialItemType;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -114,7 +115,7 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
final DailyMissionPlayerEntry entry = getPlayerEntry(player.getObjectId(), true);
entry.setStatus(DailyMissionStatus.COMPLETED);
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
entry.setRecentlyCompleted(true);
storePlayerEntry(entry);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
index 025c3208e6..ecb5b8dc95 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.enums.PlayerAction;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -115,7 +116,7 @@ public class AdminCommandHandler implements IHandler
{
- final long begin = System.currentTimeMillis();
+ final long begin = Chronos.currentTimeMillis();
try
{
if (Config.GMAUDIT)
@@ -133,7 +134,7 @@ public class AdminCommandHandler implements IHandler 5000)
{
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
index fedf7cd9dc..ee7642eca5 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -48,7 +49,7 @@ public class AntiFeedManager
*/
public void setLastDeathTime(int objectId)
{
- _lastDeathTimes.put(objectId, System.currentTimeMillis());
+ _lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
}
/**
@@ -81,7 +82,7 @@ public class AntiFeedManager
return false;
}
- if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
+ if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((Chronos.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
{
return false;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index 3d8c1f50e4..301806d976 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ManorMode;
@@ -276,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
- ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
+ ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
}
public void changeMode()
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
index f73777245c..57ff607c72 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.model.CursedWeapon;
import org.l2jmobius.gameserver.model.actor.Attackable;
@@ -313,7 +314,7 @@ public class CursedWeaponsManager implements IXmlReader
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING_TYPE_CURSEDSWORD_TO_CHECK_OTHER_INFORMATION);
sm.addString(cw.getName());
// sm.addItemName(cw.getItemId());
- sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
+ sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
player.sendPacket(sm);
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index 72602e0968..babf2e1476 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -193,7 +194,7 @@ public class DBSpawnManager
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
- final long respawnTime = System.currentTimeMillis() + respawnDelay;
+ final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
info.set("currentHP", npc.getMaxHp());
info.set("currentMP", npc.getMaxMp());
info.set("respawnTime", respawnTime);
@@ -235,7 +236,7 @@ public class DBSpawnManager
}
final int npcId = spawn.getId();
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SpawnTable.getInstance().addNewSpawn(spawn, false);
if ((respawnTime == 0) || (time > respawnTime))
{
@@ -257,7 +258,7 @@ public class DBSpawnManager
}
else
{
- final long spawnTime = respawnTime - System.currentTimeMillis();
+ final long spawnTime = respawnTime - Chronos.currentTimeMillis();
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index 60a818cab6..06cce0d3a3 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -21,6 +21,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -104,7 +105,7 @@ public class GraciaSeedsManager
case 2:
{
// Conquest Complete state, if too much time is passed than change to defense state
- final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
+ final long timePast = Chronos.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
if (timePast >= Config.SOD_STAGE_2_LENGTH)
{
// change to Attack state because Defend statet is not implemented
@@ -172,7 +173,7 @@ public class GraciaSeedsManager
public void setSoDState(int value, boolean doSave)
{
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
- _SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
+ _SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
_SoDState = value;
// reset number of Tiat kills
if (_SoDState == 1)
@@ -198,7 +199,7 @@ public class GraciaSeedsManager
}
case 2:
{
- return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
+ return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
}
case 3:
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index d595a5befa..052f8984d2 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.util.PrimeFinder;
/**
@@ -85,7 +86,7 @@ public class IdManager
try (Connection con = DatabaseFactory.getConnection();
Statement statement = con.createStatement())
{
- final long cleanupStart = System.currentTimeMillis();
+ final long cleanupStart = Chronos.currentTimeMillis();
int cleanCount = 0;
// Characters
@@ -157,7 +158,7 @@ public class IdManager
statement.executeUpdate("UPDATE characters SET clanid=0, clan_privs=0, wantspeace=0, subpledge=0, lvl_joined_academy=0, apprentice=0, sponsor=0, clan_join_expiry_time=0, clan_create_expiry_time=0 WHERE characters.clanid > 0 AND characters.clanid NOT IN (SELECT clan_id FROM clan_data);");
statement.executeUpdate("UPDATE fort SET owner=0 WHERE owner NOT IN (SELECT clan_id FROM clan_data);");
- LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((System.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
+ LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((Chronos.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
}
catch (Exception e)
{
@@ -173,7 +174,7 @@ public class IdManager
{
try (PreparedStatement statement = con.prepareStatement(line))
{
- statement.setLong(1, System.currentTimeMillis());
+ statement.setLong(1, Chronos.currentTimeMillis());
cleanCount += statement.executeUpdate();
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
index d47e436ace..d1f8cd35e2 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
@@ -40,6 +40,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.data.xml.SpawnData;
@@ -521,7 +522,7 @@ public class InstanceManager implements IXmlReader
{
// Check if instance penalty passed
final long time = rs.getLong("time");
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
// Load params
final int charId = rs.getInt("charId");
@@ -556,7 +557,7 @@ public class InstanceManager implements IXmlReader
final List invalidPenalty = new ArrayList<>(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- if (entry.getValue() <= System.currentTimeMillis())
+ if (entry.getValue() <= Chronos.currentTimeMillis())
{
invalidPenalty.add(entry.getKey());
}
@@ -615,7 +616,7 @@ public class InstanceManager implements IXmlReader
// If reenter time is higher then current, delete it
final long time = playerData.get(id);
- if (time <= System.currentTimeMillis())
+ if (time <= Chronos.currentTimeMillis())
{
deleteInstanceTime(player, id);
return -1;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 739f67e9a9..dfb4734ca5 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -83,7 +84,7 @@ public class ItemsOnGroundManager implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(str))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.execute();
}
catch (Exception e)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
index df45860d40..d429a2f8c9 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Mentee;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -145,7 +146,7 @@ public class MentorManager
{
final PlayerInstance player = World.getInstance().getPlayer(mentorId);
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
- vars.set("Mentor-Penalty-" + mentorId, String.valueOf(System.currentTimeMillis() + penalty));
+ vars.set("Mentor-Penalty-" + mentorId, String.valueOf(Chronos.currentTimeMillis() + penalty));
}
public long getMentorPenalty(int mentorId)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
index b6c44953b1..80bfff5fdb 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.Containers;
@@ -79,7 +80,7 @@ public class PremiumManager
final PlayerInstance player = event.getPlayer();
final String accountName = player.getAccountName();
loadPremiumData(accountName);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
final long premiumExpiration = getPremiumExpiration(accountName);
player.setPremiumStatus(premiumExpiration > now);
if (player.hasPremiumStatus())
@@ -153,7 +154,7 @@ public class PremiumManager
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
{
final long addTime = timeUnit.toMillis(timeValue);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
// new premium task at least from now
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
final long newPremiumExpiration = oldPremiumExpiration + addTime;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
index 9617f26e43..08193f9c5b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
@@ -71,7 +72,7 @@ public class PunishmentManager
final String punishedBy = rset.getString("punishedBy");
if ((type != null) && (affect != null))
{
- if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
+ if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
{
expired++;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/RankManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/RankManager.java
index 1e820e35dd..f4c53dca15 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/RankManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/RankManager.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -40,7 +41,7 @@ public class RankManager
private static final Logger LOGGER = Logger.getLogger(RankManager.class.getName());
public static final Long TIME_LIMIT = 2592000000L; // 30 days in milliseconds
- public static final long CURRENT_TIME = System.currentTimeMillis();
+ public static final long CURRENT_TIME = Chronos.currentTimeMillis();
public static final int PLAYER_LIMIT = 100;
private static final String SELECT_CHARACTERS = "SELECT charId,char_name,level,race,base_class, clanid FROM characters WHERE (" + CURRENT_TIME + " - cast(lastAccess as signed) < " + TIME_LIMIT + ") AND accesslevel = 0 AND level > 84 ORDER BY exp DESC, onlinetime DESC LIMIT " + PLAYER_LIMIT;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
index 687d1288b9..ab73056bb1 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -424,7 +425,7 @@ public class BlockChecker
// Start up player parameters
setUpPlayers();
// Set the started time
- _startedTime = System.currentTimeMillis() + 300000;
+ _startedTime = Chronos.currentTimeMillis() + 300000;
}
}
@@ -524,7 +525,7 @@ public class BlockChecker
_redPoints += _numOfBoxes / 2;
_bluePoints += _numOfBoxes / 2;
- final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((_startedTime - Chronos.currentTimeMillis()) / 1000);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
_holder.broadCastPacketToTeam(changePoints);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/CursedWeapon.java
index 37db02114d..d5c37da80e 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/CursedWeapon.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
@@ -237,7 +238,7 @@ public class CursedWeapon implements INamable
@Override
public void run()
{
- if (System.currentTimeMillis() >= _endTime)
+ if (Chronos.currentTimeMillis() >= _endTime)
{
endOfLife();
}
@@ -369,7 +370,7 @@ public class CursedWeapon implements INamable
public void reActivate()
{
_isActivated = true;
- if ((_endTime - System.currentTimeMillis()) <= 0)
+ if ((_endTime - Chronos.currentTimeMillis()) <= 0)
{
endOfLife();
}
@@ -387,7 +388,7 @@ public class CursedWeapon implements INamable
dropIt(attackable, player);
// Start the Life Task
- _endTime = System.currentTimeMillis() + (_duration * 60000);
+ _endTime = Chronos.currentTimeMillis() + (_duration * 60000);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
return true;
}
@@ -681,7 +682,7 @@ public class CursedWeapon implements INamable
public long getTimeLeft()
{
- return _endTime - System.currentTimeMillis();
+ return _endTime - Chronos.currentTimeMillis();
}
public void goTo(PlayerInstance player)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/ItemInfo.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/ItemInfo.java
index 9ea4c13763..16f3dfe23e 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/ItemInfo.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/ItemInfo.java
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.model.buylist.Product;
import org.l2jmobius.gameserver.model.ensoul.EnsoulOption;
@@ -151,14 +152,14 @@ public class ItemInfo
_soulCrystalOptions = item.getSpecialAbilities();
_soulCrystalSpecialOptions = item.getAdditionalSpecialAbilities();
_visualId = item.getVisualId();
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(ItemInstance item, int change)
{
this(item);
_change = change;
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(TradeItem item)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Message.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Message.java
index e6b1c31d32..53d2f20768 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Message.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Message.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.enums.MailType;
@@ -104,7 +105,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = text;
- _expiration = (isCod ? System.currentTimeMillis() + (COD_EXPIRATION * 3600000) : System.currentTimeMillis() + (EXPIRATION * 3600000));
+ _expiration = (isCod ? Chronos.currentTimeMillis() + (COD_EXPIRATION * 3600000) : Chronos.currentTimeMillis() + (EXPIRATION * 3600000));
_hasAttachments = false;
_unread = true;
_deletedBySender = false;
@@ -123,7 +124,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_reqAdena = 0;
_hasAttachments = false;
_unread = true;
@@ -143,7 +144,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_hasAttachments = false;
_unread = true;
_deletedBySender = true;
@@ -162,7 +163,7 @@ public class Message
_receiverId = msg.getSenderId();
_subject = "";
_content = "";
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_deletedByReceiver = false;
@@ -182,7 +183,7 @@ public class Message
_receiverId = receiverId;
_subject = "";
_content = item.getName();
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_messageType = mailType;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Petition.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Petition.java
index 06d4fc32b2..adb136407f 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Petition.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Petition.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PetitionState;
import org.l2jmobius.gameserver.enums.PetitionType;
import org.l2jmobius.gameserver.instancemanager.IdManager;
@@ -36,7 +37,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class Petition
{
- private final long _submitTime = System.currentTimeMillis();
+ private final long _submitTime = Chronos.currentTimeMillis();
private final int _id;
private final PetitionType _type;
private PetitionState _state = PetitionState.PENDING;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Spawn.java
index 4a1a2926b3..eb57e4e69b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -258,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
_scheduledCount++;
// Schedule the next respawn.
- RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
+ RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/TimeStamp.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/TimeStamp.java
index 8c232969e0..9bdb39d293 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/TimeStamp.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/TimeStamp.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -52,7 +53,7 @@ public class TimeStamp
_id2 = skill.getLevel();
_id3 = skill.getSubLevel();
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = -1;
}
@@ -68,7 +69,7 @@ public class TimeStamp
_id2 = item.getObjectId();
_id3 = 0;
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = item.getSharedReuseGroup();
}
@@ -155,7 +156,7 @@ public class TimeStamp
{
return 0;
}
- final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
+ final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
if (remainingTime == 0)
{
_stamp = 0;
@@ -173,7 +174,7 @@ public class TimeStamp
{
return false;
}
- final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
+ final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
if (!hasNotPassed)
{
_stamp = 0;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java
index 9289414c7c..121b62df28 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.AttackableAI;
import org.l2jmobius.gameserver.ai.CreatureAI;
@@ -215,7 +216,7 @@ public class Attackable extends Npc
if (_firstCommandChannelAttacked != null)
{
_commandChannelTimer = new CommandChannelTimer(this);
- _commandChannelLastAttack = System.currentTimeMillis();
+ _commandChannelLastAttack = Chronos.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
@@ -224,7 +225,7 @@ public class Attackable extends Npc
}
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
{
- _commandChannelLastAttack = System.currentTimeMillis(); // update last attack time
+ _commandChannelLastAttack = Chronos.currentTimeMillis(); // update last attack time
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java
index ba10981eef..7f0f5757e4 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -41,6 +41,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.EmptyQueue;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -1393,7 +1394,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : _reuseTimeStampsItems.values())
{
if (ts.getSharedReuseGroup() == group)
@@ -1523,7 +1524,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return;
}
- _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? System.currentTimeMillis() + delay : Long.MAX_VALUE);
+ _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? Chronos.currentTimeMillis() + delay : Long.MAX_VALUE);
}
/**
@@ -1571,7 +1572,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return false;
}
- if (stamp < System.currentTimeMillis())
+ if (stamp < Chronos.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java
index 62f1d1049f..d288fe8816 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -203,7 +204,7 @@ public class Npc extends Creature
public void onRandomAnimation(int animationId)
{
// Send a packet SocialAction to all PlayerInstance in the _KnownPlayers of the NpcInstance
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
{
_lastSocialBroadcast = now;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
index 7eacda4aa1..c87a2006a9 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.actor.instance;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
@@ -141,7 +142,7 @@ public class BlockInstance extends MonsterInstance
{
eng.increasePlayerPoints(player, team);
- final int timeLeft = (int) ((eng.getStarterTime() - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((eng.getStarterTime() - Chronos.currentTimeMillis()) / 1000);
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints());
final ExCubeGameExtendedChangePoints secretPoints = new ExCubeGameExtendedChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints(), isRed, player, eng.getPlayerPoints(player, isRed));
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 9c99e3519f..dca4c8cff2 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -46,6 +46,7 @@ import java.util.stream.Collectors;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -2760,7 +2761,7 @@ public class PlayerInstance extends Playable
public void setOnlineTime(long time)
{
_onlineTime = time;
- _onlineBeginTime = System.currentTimeMillis();
+ _onlineBeginTime = Chronos.currentTimeMillis();
}
/**
@@ -3805,22 +3806,22 @@ public class PlayerInstance extends Playable
public boolean isSpawnProtected()
{
- return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
+ return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
}
public boolean isTeleportProtected()
{
- return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
+ return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
}
public void setSpawnProtection(boolean protect)
{
- _spawnProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
+ _spawnProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
}
public void setTeleportProtection(boolean protect)
{
- _teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
+ _teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
}
/**
@@ -5174,7 +5175,7 @@ public class PlayerInstance extends Playable
{
return;
}
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
if (_pvpFlag == 0)
{
startPvPFlag();
@@ -5207,11 +5208,11 @@ public class PlayerInstance extends Playable
{
if (checkIfPvP(targetPlayer))
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
}
else
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
}
if (_pvpFlag == 0)
{
@@ -6088,7 +6089,7 @@ public class PlayerInstance extends Playable
public long getUptime()
{
- return System.currentTimeMillis() - _uptime;
+ return Chronos.currentTimeMillis() - _uptime;
}
/**
@@ -6331,7 +6332,7 @@ public class PlayerInstance extends Playable
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
{
statement.setInt(1, isOnlineInt());
- statement.setLong(2, System.currentTimeMillis());
+ statement.setLong(2, Chronos.currentTimeMillis());
statement.setInt(3, getObjectId());
statement.execute();
}
@@ -6457,12 +6458,12 @@ public class PlayerInstance extends Playable
}
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
- if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanJoinExpiryTime(0);
}
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
- if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanCreateExpiryTime(0);
}
@@ -6524,7 +6525,7 @@ public class PlayerInstance extends Playable
player.getAppearance().setTitleColor(titleColor);
}
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
- player.setUptime(System.currentTimeMillis());
+ player.setUptime(Chronos.currentTimeMillis());
currentHp = rset.getDouble("curHp");
currentCp = rset.getDouble("curCp");
@@ -7091,7 +7092,7 @@ public class PlayerInstance extends Playable
long totalOnlineTime = _onlineTime;
if (_onlineBeginTime > 0)
{
- totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
+ totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
}
statement.setLong(34, totalOnlineTime);
@@ -7177,7 +7178,7 @@ public class PlayerInstance extends Playable
int buffIndex = 0;
final List storedSkills = new ArrayList<>();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
// Store all effect data along with calulated remaining
// reuse delays for matching skills. 'restore_type'= 0.
@@ -7292,7 +7293,7 @@ public class PlayerInstance extends Playable
ps1.setInt(1, getObjectId());
ps1.execute();
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : getItemReuseTimeStamps().values())
{
if ((ts != null) && (currentTime < ts.getStamp()))
@@ -7615,7 +7616,7 @@ public class PlayerInstance extends Playable
statement.setInt(2, _classIndex);
try (ResultSet rset = statement.executeQuery())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
final int remainingTime = rset.getInt("remaining_time");
@@ -7677,7 +7678,7 @@ public class PlayerInstance extends Playable
long systime;
boolean isInInventory;
long remainingTime;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
itemId = rset.getInt("itemId");
@@ -7752,7 +7753,7 @@ public class PlayerInstance extends Playable
{
int slot;
int symbolId;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
while (rset.next())
{
slot = rset.getInt("slot");
@@ -7875,7 +7876,7 @@ public class PlayerInstance extends Playable
// Send Server->Client UserInfo packet to this PlayerInstance
broadcastUserInfo(UserInfoType.BASE_STATS, UserInfoType.MAX_HPCPMP, UserInfoType.STATS, UserInfoType.SPEED);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long timeLeft = getVariables().getLong("HennaDuration" + slot, currentTime) - currentTime;
if ((henna.getDuration() < 0) || (timeLeft > 0))
{
@@ -7966,7 +7967,7 @@ public class PlayerInstance extends Playable
// Task for henna duration
if (henna.getDuration() > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long durationInMillis = henna.getDuration() * 60000;
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
@@ -12430,7 +12431,7 @@ public class PlayerInstance extends Playable
public int getBirthdays()
{
- long time = (System.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
+ long time = (Chronos.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
time /= TimeUnit.DAYS.toMillis(365);
return (int) time;
}
@@ -12670,7 +12671,7 @@ public class PlayerInstance extends Playable
return false;
}
- if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
+ if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@@ -12730,7 +12731,7 @@ public class PlayerInstance extends Playable
*/
public void setFalling()
{
- _fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
+ _fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
}
/**
@@ -12751,7 +12752,7 @@ public class PlayerInstance extends Playable
*/
public void updateLastItemAuctionRequest()
{
- _lastItemAuctionInfoRequest = System.currentTimeMillis();
+ _lastItemAuctionInfoRequest = Chronos.currentTimeMillis();
}
/**
@@ -12760,7 +12761,7 @@ public class PlayerInstance extends Playable
*/
public boolean isItemAuctionPolling()
{
- return (System.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
+ return (Chronos.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
}
@Override
@@ -13144,7 +13145,7 @@ public class PlayerInstance extends Playable
public void updateNotMoveUntil()
{
- _notMoveUntil = System.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
+ _notMoveUntil = Chronos.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
}
@Override
@@ -14196,7 +14197,7 @@ public class PlayerInstance extends Playable
public boolean isInTraingCamp()
{
final TrainingHolder trainingHolder = getTraingCampInfo();
- return (trainingHolder != null) && (trainingHolder.getEndTime() > System.currentTimeMillis());
+ return (trainingHolder != null) && (trainingHolder.getEndTime() > Chronos.currentTimeMillis());
}
public AttendanceInfoHolder getAttendanceInfo()
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
index ac089b7e91..bf4cea7560 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/VillageMasterInstance.java
@@ -21,6 +21,7 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.InstanceType;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
@@ -280,13 +281,13 @@ public class VillageMasterInstance extends NpcInstance
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
return;
}
- clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setDissolvingExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
// The clan leader should take the XP penalty of a full death.
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
index 843165d245..18d77105c7 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/tasks/attackable/CommandChannelTimer.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.attackable;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
/**
@@ -40,7 +41,7 @@ public class CommandChannelTimer implements Runnable
return;
}
- if ((System.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
+ if ((Chronos.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
{
_attackable.setCommandChannelTimer(null);
_attackable.setFirstCommandChannelAttacked(null);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
index e2130407ac..290e49a99f 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/tasks/player/IllegalPlayerActionTask.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.actor.tasks.player;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -92,12 +93,12 @@ public class IllegalPlayerActionTask implements Runnable
}
case KICKBAN:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
case JAIL:
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
break;
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/buylist/Product.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/buylist/Product.java
index 0782846eba..3fc18a73e3 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/buylist/Product.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/buylist/Product.java
@@ -25,6 +25,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.type.EtcItemType;
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
@@ -134,7 +135,7 @@ public class Product
public void restartRestockTask(long nextRestockTime)
{
- final long remainTime = nextRestockTime - System.currentTimeMillis();
+ final long remainTime = nextRestockTime - Chronos.currentTimeMillis();
if (remainTime > 0)
{
BuyListTaskManager.getInstance().update(this, remainTime);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
index 3c36a20d0f..8f971909d8 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/ceremonyofchaos/CeremonyOfChaosEvent.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import java.util.stream.Collectors;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
import org.l2jmobius.gameserver.enums.QuestSound;
@@ -278,7 +279,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
});
}
}
- _battleStartTime = System.currentTimeMillis();
+ _battleStartTime = Chronos.currentTimeMillis();
getTimers().addRepeatingTimer("update", 1000, null, null);
}
@@ -515,7 +516,7 @@ public class CeremonyOfChaosEvent extends AbstractEvent
private void updateLifeTime(CeremonyOfChaosMember member)
{
- member.setLifeTime(((int) (System.currentTimeMillis() - _battleStartTime) / 1000));
+ member.setLifeTime(((int) (Chronos.currentTimeMillis() - _battleStartTime) / 1000));
}
public List getWinners()
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/clan/Clan.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/clan/Clan.java
index 497d2e4ec3..9c70a2b61c 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/clan/Clan.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/clan/Clan.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -504,7 +505,7 @@ public class Clan implements IIdentifiable, INamable
if (player.isClanLeader())
{
SiegeManager.getInstance().removeSiegeSkills(player);
- player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ player.setClanCreateExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
}
// remove Clan skills from Player
@@ -536,7 +537,7 @@ public class Clan implements IIdentifiable, INamable
}
else
{
- removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
+ removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
}
// Notify to scripts
@@ -1001,12 +1002,12 @@ public class Clan implements IIdentifiable, INamable
setAllyId(clanData.getInt("ally_id"));
setAllyName(clanData.getString("ally_name"));
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
- if (_allyPenaltyExpiryTime < System.currentTimeMillis())
+ if (_allyPenaltyExpiryTime < Chronos.currentTimeMillis())
{
setAllyPenaltyExpiryTime(0, 0);
}
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
- if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
+ if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < Chronos.currentTimeMillis()) // 24*60*60*1000 = 86400000
{
setCharPenaltyExpiryTime(0);
}
@@ -2047,7 +2048,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
return false;
}
- if (_charPenaltyExpiryTime > System.currentTimeMillis())
+ if (_charPenaltyExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return false;
@@ -2059,7 +2060,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (target.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (target.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(target.getName());
@@ -2101,7 +2102,7 @@ public class Clan implements IIdentifiable, INamable
return false;
}
final Clan leaderClan = player.getClan();
- if ((leaderClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis()) && (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN))
+ if ((leaderClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis()) && (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN))
{
player.sendPacket(SystemMessageId.YOU_MAY_NOT_ACCEPT_ANY_CLAN_WITHIN_A_DAY_AFTER_EXPELLING_ANOTHER_CLAN);
return false;
@@ -2137,7 +2138,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(sm);
return false;
}
- if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
+ if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
{
@@ -2231,12 +2232,12 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
return;
}
- if ((_allyPenaltyExpiryTime > System.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
+ if ((_allyPenaltyExpiryTime > Chronos.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
return;
}
- if (_dissolvingExpiryTime > System.currentTimeMillis())
+ if (_dissolvingExpiryTime > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
return;
@@ -2288,7 +2289,7 @@ public class Clan implements IIdentifiable, INamable
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
{
if (clan.getId() != getId())
@@ -2314,7 +2315,7 @@ public class Clan implements IIdentifiable, INamable
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
return false;
}
- if (System.currentTimeMillis() < _dissolvingExpiryTime)
+ if (Chronos.currentTimeMillis() < _dissolvingExpiryTime)
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
return false;
@@ -2699,7 +2700,7 @@ public class Clan implements IIdentifiable, INamable
public void addMasterySkill(int id)
{
- getVariables().set(ClanVariables.CLAN_MASTERY_SKILL_TIME + id, System.currentTimeMillis() + 1296000000);
+ getVariables().set(ClanVariables.CLAN_MASTERY_SKILL_TIME + id, Chronos.currentTimeMillis() + 1296000000);
final ScheduledFuture> task = ThreadPool.schedule(() -> removeMasterySkill(id), 1296000000); // 1296000000 = 15 days
masterySkillTasks.add(task);
addNewSkill(SkillData.getInstance().getSkill(id, 1));
@@ -2718,7 +2719,7 @@ public class Clan implements IIdentifiable, INamable
{
return -1;
}
- return (int) (endTime - System.currentTimeMillis());
+ return (int) (endTime - Chronos.currentTimeMillis());
}
public void setDevelopmentPoints(int count)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/clan/ClanWar.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
index ebb2c805d2..f763b5b0fb 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/clan/ClanWar.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -54,9 +55,9 @@ public class ClanWar
{
_attackerClanId = attacker.getId();
_attackedClanId = attacked.getId();
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_state = ClanWarState.BLOOD_DECLARATION;
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
attacker.addWar(attacked.getId(), this);
attacked.addWar(attacker.getId(), this);
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
@@ -79,15 +80,15 @@ public class ClanWar
_attackerKillCount.set(attackerKillCount);
_attackedKillCount.set(attackedKillCount);
_winnerClanId = winnerClan;
- if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > System.currentTimeMillis())
+ if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > Chronos.currentTimeMillis())
{
- _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
+ _cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - Chronos.currentTimeMillis());
}
if (_endTime > 0)
{
final long endTimePeriod = _endTime + (_state == ClanWarState.TIE ? TIME_TO_DELETION_AFTER_CANCELLATION : TIME_TO_DELETION_AFTER_DEFEAT);
- if (endTimePeriod > System.currentTimeMillis())
+ if (endTimePeriod > Chronos.currentTimeMillis())
{
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(_attackerClanId, _attackedClanId), 10000);
}
@@ -177,8 +178,8 @@ public class ClanWar
winnerClan.broadcastToOnlineMembers(sm);
_winnerClanId = winnerClan.getId();
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - Chronos.currentTimeMillis());
}
public void clanWarTimeout()
@@ -196,8 +197,8 @@ public class ClanWar
attackerClan.broadcastToOnlineMembers(sm);
_state = ClanWarState.TIE;
- _endTime = System.currentTimeMillis();
- ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());
+ _endTime = Chronos.currentTimeMillis();
+ ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - Chronos.currentTimeMillis());
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
index f150ec3238..b1b3a83fd1 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/eventengine/EventScheduler.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.StatSet;
import it.sauronsoftware.cron4j.PastPredictor;
@@ -112,7 +113,7 @@ public class EventScheduler
final Predictor predictor = new Predictor(_pattern);
final long nextSchedule = predictor.nextMatchingTime();
- final long timeSchedule = nextSchedule - System.currentTimeMillis();
+ final long timeSchedule = nextSchedule - Chronos.currentTimeMillis();
if (timeSchedule <= (30 * 1000))
{
LOGGER.warning("Wrong reschedule for " + _eventManager.getClass().getSimpleName() + " end up run in " + (timeSchedule / 1000) + " seconds!");
@@ -144,10 +145,10 @@ public class EventScheduler
{
ps.setString(1, _eventManager.getName());
ps.setString(2, _name);
- ps.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(3, new Timestamp(Chronos.currentTimeMillis()));
ps.setString(4, _eventManager.getName());
ps.setString(5, _name);
- ps.setTimestamp(6, new Timestamp(System.currentTimeMillis()));
+ ps.setTimestamp(6, new Timestamp(Chronos.currentTimeMillis()));
ps.execute();
return true;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/events/EventType.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/events/EventType.java
index 99875a73cf..f266ac008b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/events/EventType.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/events/EventType.java
@@ -76,7 +76,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWH
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
@@ -84,8 +83,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaR
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemAdd;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDestroy;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDrop;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemTransfer;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
@@ -114,7 +115,6 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummon
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
-import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
index 77e7205bfa..6139454534 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/TrainingHolder.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -85,7 +86,7 @@ public class TrainingHolder implements Serializable
public long getElapsedTime()
{
- return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
+ return TimeUnit.SECONDS.convert(Chronos.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
index 0687f11896..117cb35c1f 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/Instance.java
@@ -39,6 +39,7 @@ import java.util.stream.Stream;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -105,7 +106,7 @@ public class Instance implements IIdentifiable, INamable
// Set basic instance info
_id = id;
_template = template;
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
_spawns = new ArrayList<>(template.getSpawns().size());
// Clone and add the spawn templates
@@ -755,7 +756,7 @@ public class Instance implements IIdentifiable, INamable
}
// Set new cleanup task
- _endTime = System.currentTimeMillis() + millis;
+ _endTime = Chronos.currentTimeMillis() + millis;
if (minutes < 1) // Destroy instance
{
destroy();
@@ -858,7 +859,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getElapsedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
/**
@@ -867,7 +868,7 @@ public class Instance implements IIdentifiable, INamable
*/
public long getRemainingTime()
{
- return (_endTime == -1) ? -1 : (_endTime - System.currentTimeMillis());
+ return (_endTime == -1) ? -1 : (_endTime - Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
index 973dab1661..84466d8e0a 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/InstanceTemplate.java
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.GroupType;
import org.l2jmobius.gameserver.enums.InstanceReenterType;
@@ -547,7 +548,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
{
if (data.getTime() > 0)
{
- time = System.currentTimeMillis() + data.getTime();
+ time = Chronos.currentTimeMillis() + data.getTime();
break;
}
@@ -557,7 +558,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
calendar.set(Calendar.SECOND, 0);
// If calendar time is lower than current, add one more day
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
@@ -574,7 +575,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Set exact day. If modified date is before current, add one more week.
calendar.set(Calendar.DAY_OF_WEEK, day);
- if (calendar.getTimeInMillis() <= System.currentTimeMillis())
+ if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
{
calendar.add(Calendar.WEEK_OF_MONTH, 1);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
index 1850d30783..07ce5a3538 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionReenter.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.instancezone.conditions;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -39,6 +40,6 @@ public class ConditionReenter extends Condition
protected boolean test(PlayerInstance player, Npc npc)
{
final int instanceId = getParameters().getInt("instanceId", getInstanceTemplate().getId());
- return System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
+ return Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
index fbe1e21414..a1b1f40b26 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemauction/ItemAuction.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.ItemInfo;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -181,12 +182,12 @@ public class ItemAuction
public long getStartingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public long getFinishingTimeRemaining()
{
- return Math.max(_endingTime - System.currentTimeMillis(), 0);
+ return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
}
public void storeMe()
@@ -339,7 +340,7 @@ public class ItemAuction
_highestBid = bid;
}
- if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
+ if ((_endingTime - Chronos.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
{
switch (_auctionEndingExtendState)
{
@@ -426,7 +427,7 @@ public class ItemAuction
}
case FINISHED:
{
- if (_startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
+ if (_startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
{
return false;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
index 8d81451dc9..f14581064a 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -243,7 +244,7 @@ public class ItemAuctionInstance
{
case 0:
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
case 1:
@@ -252,10 +253,10 @@ public class ItemAuctionInstance
{
case CREATED:
{
- if (auctions[0].getStartingTime() < (System.currentTimeMillis() + START_TIME_SPACE))
+ if (auctions[0].getStartingTime() < (Chronos.currentTimeMillis() + START_TIME_SPACE))
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
else
{
@@ -266,13 +267,13 @@ public class ItemAuctionInstance
case STARTED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, System.currentTimeMillis() + START_TIME_SPACE));
+ nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, Chronos.currentTimeMillis() + START_TIME_SPACE));
break;
}
case FINISHED:
{
currentAuction = auctions[0];
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
break;
}
default:
@@ -287,7 +288,7 @@ public class ItemAuctionInstance
{
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
// just to make sure we won't skip any auction because of little different times
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (ItemAuction auction : auctions)
{
if (auction.getAuctionState() == ItemAuctionState.STARTED)
@@ -311,7 +312,7 @@ public class ItemAuctionInstance
}
if (nextAuction == null)
{
- nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
+ nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
}
break;
}
@@ -326,17 +327,17 @@ public class ItemAuctionInstance
{
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
}
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
}
else
{
- setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
}
}
@@ -422,7 +423,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -432,7 +433,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -442,7 +443,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
break;
@@ -452,7 +453,7 @@ public class ItemAuctionInstance
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
{
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
- setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
+ setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
return;
}
}
@@ -577,7 +578,7 @@ public class ItemAuctionInstance
return null;
}
- if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
+ if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
{
LOGGER.info(getClass().getSimpleName() + ": Clearing expired auction: " + auctionId);
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
index beae6e0db1..abbe632775 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.AgathionData;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
@@ -206,7 +207,7 @@ public class ItemInstance extends WorldObject
_type2 = 0;
_dropTime = 0;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -229,7 +230,7 @@ public class ItemInstance extends WorldObject
super.setName(_item.getName());
_loc = ItemLocation.VOID;
_mana = _item.getDuration();
- _time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
+ _time = _item.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
scheduleVisualLifeTime();
}
@@ -1583,7 +1584,7 @@ public class ItemInstance extends WorldObject
setSpawned(true);
setXYZ(x, y, z);
- setDropTime(System.currentTimeMillis());
+ setDropTime(Chronos.currentTimeMillis());
setDropperObjectId(dropper != null ? dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
// Add the ItemInstance dropped in the world as a visible object
@@ -1862,7 +1863,7 @@ public class ItemInstance extends WorldObject
public long getRemainingTime()
{
- return _time - System.currentTimeMillis();
+ return _time - Chronos.currentTimeMillis();
}
public void endOfLife()
@@ -2520,7 +2521,7 @@ public class ItemInstance extends WorldObject
if (getVisualLifeTime() > 0)
{
final long endTime = getVisualLifeTime();
- if ((endTime - System.currentTimeMillis()) > 0)
+ if ((endTime - Chronos.currentTimeMillis()) > 0)
{
ItemAppearanceTaskManager.getInstance().add(this, endTime);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index b143026636..d749b8c792 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -21,6 +21,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
@@ -84,7 +85,7 @@ public abstract class AbstractOlympiadGame
protected boolean makeCompetitionStart()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
return !_aborted;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 2995f9243f..afdbe5903c 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
@@ -790,7 +791,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", template.getName() + " was defeated");
@@ -811,7 +812,7 @@ public class Hero
// Prepare new data
final StatSet diaryEntry = new StatSet();
- final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
+ final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
diaryEntry.set("date", date);
diaryEntry.set("action", castle.getName() + " Castle was successfuly taken");
@@ -825,7 +826,7 @@ public class Hero
PreparedStatement ps = con.prepareStatement("INSERT INTO heroes_diary (charId, time, action, param) values(?,?,?,?)"))
{
ps.setInt(1, charId);
- ps.setLong(2, System.currentTimeMillis());
+ ps.setLong(2, Chronos.currentTimeMillis());
ps.setInt(3, action);
ps.setInt(4, param);
ps.execute();
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index 2a54d83dc7..0427829eb2 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,6 +27,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
@@ -546,7 +547,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
String winner = "draw";
// Calculate Fight time
- final long _fightTime = (System.currentTimeMillis() - _startTime);
+ final long _fightTime = (Chronos.currentTimeMillis() - _startTime);
double playerOneHp = 0;
if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
index 119e447b15..4bb2fc156e 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/punishment/PunishmentTask.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.handler.PunishmentHandler;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
@@ -133,7 +134,7 @@ public class PunishmentTask implements Runnable
*/
public boolean isExpired()
{
- return (_expirationTime > 0) && (System.currentTimeMillis() > _expirationTime);
+ return (_expirationTime > 0) && (Chronos.currentTimeMillis() > _expirationTime);
}
/**
@@ -149,7 +150,7 @@ public class PunishmentTask implements Runnable
onStart();
if (_expirationTime > 0) // Has expiration?
{
- _task = ThreadPool.schedule(this, (_expirationTime - System.currentTimeMillis()));
+ _task = ThreadPool.schedule(this, (_expirationTime - Chronos.currentTimeMillis()));
}
}
@@ -226,7 +227,7 @@ public class PunishmentTask implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement st = con.prepareStatement(UPDATE_QUERY))
{
- st.setLong(1, System.currentTimeMillis());
+ st.setLong(1, Chronos.currentTimeMillis());
st.setLong(2, _id);
st.execute();
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
index 7c2d57fdc6..2e36bece7c 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/LongTimeEvent.java
@@ -32,6 +32,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.EventDroplist;
import org.l2jmobius.gameserver.data.ItemTable;
@@ -100,7 +101,7 @@ public class LongTimeEvent extends Quest
}
else if (_eventPeriod.getStartDate().after(new Date()))
{
- final long delay = _eventPeriod.getStartDate().getTime() - System.currentTimeMillis();
+ final long delay = _eventPeriod.getStartDate().getTime() - Chronos.currentTimeMillis();
ThreadPool.schedule(new ScheduleStart(), delay);
LOGGER.info("Event " + _eventName + " will be started at " + _eventPeriod.getStartDate());
}
@@ -323,7 +324,7 @@ public class LongTimeEvent extends Quest
}
// Add spawns.
- final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - System.currentTimeMillis();
+ final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - Chronos.currentTimeMillis();
for (NpcSpawn spawn : _spawnList)
{
addSpawn(spawn.npcId, spawn.loc.getX(), spawn.loc.getY(), spawn.loc.getZ(), spawn.loc.getHeading(), false, millisToEventEnd, false);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 1218569d81..4264d72834 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.enums.QuestType;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
@@ -785,7 +786,7 @@ public class QuestState
public boolean isNowAvailable()
{
final String val = get("restartTime");
- return (val != null) && (Long.parseLong(val) <= System.currentTimeMillis());
+ return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
public void setSimulated(boolean simulated)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
index cf665da8f8..b4d0d36648 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.SocialClass;
@@ -138,7 +139,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
final int level = rs.getInt("level");
final long expiration = rs.getLong("expiration");
final ResidenceFunction func = new ResidenceFunction(id, level, expiration, this);
- if ((expiration <= System.currentTimeMillis()) && !func.reactivate())
+ if ((expiration <= Chronos.currentTimeMillis()) && !func.reactivate())
{
removeFunction(func);
continue;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
index a292c439e5..d81d7f08af 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHall.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanHallGrade;
import org.l2jmobius.gameserver.enums.ClanHallType;
@@ -265,7 +266,7 @@ public class ClanHall extends AbstractResidence
final int failDays = getCostFailDay();
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : _paidUntil;
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - Chronos.currentTimeMillis());
}
else
{
@@ -310,7 +311,7 @@ public class ClanHall extends AbstractResidence
*/
public long getNextPayment()
{
- return (_checkPaymentTask != null) ? System.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
+ return (_checkPaymentTask != null) ? Chronos.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
}
public Location getOwnerLocation()
@@ -382,7 +383,7 @@ public class ClanHall extends AbstractResidence
{
_owner.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, _lease, null, null);
setPaidUntil(Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(7)).toEpochMilli());
- _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - System.currentTimeMillis());
+ _checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - Chronos.currentTimeMillis());
updateDB();
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
index 2fa683814d..faac3921be 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHallAuction.java
@@ -30,6 +30,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
@@ -85,7 +86,7 @@ public class ClanHallAuction
public void addBid(Clan clan, long bid)
{
- addBid(clan, bid, System.currentTimeMillis());
+ addBid(clan, bid, Chronos.currentTimeMillis());
}
public void addBid(Clan clan, long bid, long bidTime)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
index c71380874f..841d3b180c 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ResidenceFunction.java
@@ -20,6 +20,7 @@ import java.time.Instant;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ResidenceFunctionsData;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -63,9 +64,9 @@ public class ResidenceFunction
private void init()
{
final ResidenceFunctionTemplate template = getTemplate();
- if ((template != null) && (_expiration > System.currentTimeMillis()))
+ if ((template != null) && (_expiration > Chronos.currentTimeMillis()))
{
- _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
+ _task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - Chronos.currentTimeMillis());
}
}
@@ -170,7 +171,7 @@ public class ResidenceFunction
if (wh.destroyItem("FunctionFee", item, template.getCost().getCount(), null, this) != null)
{
- _expiration = System.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
+ _expiration = Chronos.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
init();
}
return true;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
index 3a425c9b03..af7fd2e85e 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/shuttle/ShuttleStop.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.shuttle;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Location;
/**
@@ -29,7 +30,7 @@ public class ShuttleStop
private final int _id;
private boolean _isOpen = true;
private final List _dimensions = new ArrayList<>(3);
- private long _lastDoorStatusChanges = System.currentTimeMillis();
+ private long _lastDoorStatusChanges = Chronos.currentTimeMillis();
public ShuttleStop(int id)
{
@@ -64,7 +65,7 @@ public class ShuttleStop
}
_isOpen = true;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public void closeDoor()
@@ -75,11 +76,11 @@ public class ShuttleStop
}
_isOpen = false;
- _lastDoorStatusChanges = System.currentTimeMillis();
+ _lastDoorStatusChanges = Chronos.currentTimeMillis();
}
public boolean hasDoorChanged()
{
- return (System.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
+ return (Chronos.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Castle.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Castle.java
index 1ee2ffa27b..41cd50499c 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Castle.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Castle.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.CastleData;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -160,7 +161,7 @@ public class Castle extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -195,7 +196,7 @@ public class Castle extends AbstractResidence
fee = _tempFee;
}
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Fort.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Fort.java
index 95839a8065..de66de79ed 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Fort.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Fort.java
@@ -35,6 +35,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.FortUpdater;
import org.l2jmobius.gameserver.FortUpdater.UpdaterType;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -163,7 +164,7 @@ public class Fort extends AbstractResidence
{
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
if (_endDate > currentTime)
{
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
@@ -193,7 +194,7 @@ public class Fort extends AbstractResidence
if ((_fortOwner.getWarehouse().getAdena() >= _fee) || !_cwh)
{
final int fee = _endDate == -1 ? _tempFee : _fee;
- setEndTime(System.currentTimeMillis() + _rate);
+ setEndTime(Chronos.currentTimeMillis() + _rate);
dbSave();
if (_cwh)
{
@@ -580,7 +581,7 @@ public class Fort extends AbstractResidence
clan.setFortId(getResidenceId());
setOwnerClan(clan);
final int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
- long initial = System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
+ long initial = Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
while (initial > (Config.FS_UPDATE_FRQ * 60000))
{
initial -= Config.FS_UPDATE_FRQ * 60000;
@@ -786,7 +787,7 @@ public class Fort extends AbstractResidence
if (clan != null)
{
clanId = clan.getId();
- _lastOwnedTime.setTimeInMillis(System.currentTimeMillis());
+ _lastOwnedTime.setTimeInMillis(Chronos.currentTimeMillis());
}
else
{
@@ -920,12 +921,12 @@ public class Fort extends AbstractResidence
public int getOwnedTime()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
}
public int getTimeTillRebelArmy()
{
- return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - System.currentTimeMillis()) / 1000);
+ return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - Chronos.currentTimeMillis()) / 1000);
}
public long getTimeTillNextFortUpdate()
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Siege.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Siege.java
index 638b58e18e..f706a0fb7f 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Siege.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/siege/Siege.java
@@ -34,6 +34,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.SiegeScheduleData;
import org.l2jmobius.gameserver.enums.SiegeClanType;
@@ -1437,9 +1438,9 @@ public class Siege implements Siegable
}
final Calendar calendar = _castle.getSiegeDate();
- if (calendar.getTimeInMillis() < System.currentTimeMillis())
+ if (calendar.getTimeInMillis() < Chronos.currentTimeMillis())
{
- calendar.setTimeInMillis(System.currentTimeMillis());
+ calendar.setTimeInMillis(Chronos.currentTimeMillis());
}
calendar.set(Calendar.DAY_OF_WEEK, holder.getDay());
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
index c7b80987c7..77396cff6d 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenHPFinalizer.java
@@ -32,10 +32,10 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
-import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
+import org.l2jmobius.gameserver.model.siege.Siege;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
import org.l2jmobius.gameserver.model.stats.Stat;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
index c3ac06e1fc..18161a6c75 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/RegenMPFinalizer.java
@@ -30,8 +30,8 @@ import org.l2jmobius.gameserver.model.residences.AbstractResidence;
import org.l2jmobius.gameserver.model.residences.ResidenceFunction;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.model.stats.BaseStat;
import org.l2jmobius.gameserver.model.stats.IStatFunction;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
index 5428c6f7dd..497f4e7247 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/NoRestartZone.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.zone.type;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -99,7 +100,7 @@ public class NoRestartZone extends ZoneType
return;
}
- if (((System.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
+ if (((Chronos.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
{
player.teleToLocation(TeleportWhereType.TOWN);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java
index 8ed8a88f29..0d94946342 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.zone.type;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -43,7 +44,7 @@ public class TimedHuntingZone extends ZoneType
{
player.setInsideZone(ZoneId.TIMED_HUNTING, true);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long stormIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 1, 0);
final long primevalIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 6, 0);
if ((stormIsleExitTime > currentTime) && player.isInTimedHuntingZone(1))
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/GameClient.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/GameClient.java
index badd7b05a1..99c66513d8 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/GameClient.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/GameClient.java
@@ -30,6 +30,7 @@ import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.ICrypt;
import org.l2jmobius.commons.network.IIncomingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -341,7 +342,7 @@ public class GameClient extends ChannelInboundHandler
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps2 = con.prepareStatement("UPDATE characters SET deletetime=? WHERE charId=?"))
{
- ps2.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ ps2.setLong(1, Chronos.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
ps2.setInt(2, objectId);
ps2.execute();
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
index bf151234da..cf2986ced6 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/AllyDismiss.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -81,7 +82,7 @@ public class AllyDismiss implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000), Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
leaderClan.updateClanInDB();
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
index 3d5c508a4c..7cc2fa0c1f 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/AllyLeave.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class AllyLeave implements IClientIncomingPacket
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
clan.setAllyId(0);
clan.setAllyName(null);
clan.changeAllyCrest(0, true);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 9ab2453009..e7d47b0a3f 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
@@ -544,7 +545,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_HAVE_RECENTLY_BEEN_DISMISSED_FROM_A_CLAN_YOU_ARE_NOT_ALLOWED_TO_JOIN_ANOTHER_CLAN_FOR_24_HOURS);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
index c63a8bfcf4..854d89da8d 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.enums.AdminTeleportType;
@@ -74,7 +75,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
player.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
index d31283fff0..4fbde86e9d 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java
@@ -20,6 +20,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.enums.ItemSkillType;
@@ -128,7 +129,7 @@ public class RequestEnchantItem implements IClientIncomingPacket
}
// fast auto-enchant cheat check
- if ((request.getTimestamp() == 0) || ((System.currentTimeMillis() - request.getTimestamp()) < 2000))
+ if ((request.getTimestamp() == 0) || ((Chronos.currentTimeMillis() - request.getTimestamp()) < 2000))
{
Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " use autoenchant program ", Config.DEFAULT_PUNISH);
player.removeRequest(request.getClass());
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
index b8a07b77e8..bad73f8c28 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExAddEnchantScrollItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -82,7 +83,7 @@ public class RequestExAddEnchantScrollItem implements IClientIncomingPacket
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantScrollItemResult(_scrollObjectId));
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
index db4db5e742..b004d448e0 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExRemoveEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -55,7 +56,7 @@ public class RequestExRemoveEnchantSupportItem implements IClientIncomingPacket
request.setSupportItem(PlayerInstance.ID_NONE);
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(ExRemoveEnchantSupportItemResult.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
index 92018f3a8d..035cf151b6 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExSetPledgeCrestLarge.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -69,7 +70,7 @@ public class RequestExSetPledgeCrestLarge implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
index c9e0cf1be8..7a2a1c706a 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantSupportItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -85,7 +86,7 @@ public class RequestExTryToPutEnchantSupportItem implements IClientIncomingPacke
}
request.setSupportItem(support.getObjectId());
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
player.sendPacket(new ExPutEnchantSupportItemResult(_supportObjectId));
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
index cdf3996711..4b04a3965e 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestExTryToPutEnchantTargetItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
@@ -76,7 +77,7 @@ public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
}
return;
}
- request.setTimestamp(System.currentTimeMillis());
+ request.setTimestamp(Chronos.currentTimeMillis());
client.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
index 715be58f93..cd86a6542c 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinSiege.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -69,7 +70,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
{
if (_isJoining == 1)
{
- if (System.currentTimeMillis() < clan.getDissolvingExpiryTime())
+ if (Chronos.currentTimeMillis() < clan.getDissolvingExpiryTime())
{
client.sendPacket(SystemMessageId.YOUR_CLAN_MAY_NOT_REGISTER_TO_PARTICIPATE_IN_A_SIEGE_WHILE_UNDER_A_GRACE_PERIOD_OF_THE_CLAN_S_DISSOLUTION);
return;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
index 9e74ccac1a..6c52234804 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestMoveToLocationInVehicle.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.BoatManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.instance.BoatInstance;
@@ -61,7 +62,7 @@ public class RequestMoveToLocationInVehicle implements IClientIncomingPacket
return;
}
- if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
+ if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
{
client.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
index 5563872c57..0fd55d3ffe 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestOustPledgeMember.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
@@ -80,8 +81,8 @@ public class RequestOustPledgeMember implements IClientIncomingPacket
}
// this also updates the database
- clan.removeClanMember(member.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
- clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(member.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.setCharPenaltyExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
final SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_HAS_BEEN_EXPELLED);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
index 0bf1ebf5ec..a61cc79835 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionFeedback.java
@@ -22,6 +22,7 @@ import java.sql.SQLException;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -68,7 +69,7 @@ public class RequestPetitionFeedback implements IClientIncomingPacket
statement.setString(2, player.getLastPetitionGmName());
statement.setInt(3, _rate);
statement.setString(4, _message);
- statement.setLong(5, System.currentTimeMillis());
+ statement.setLong(5, Chronos.currentTimeMillis());
statement.execute();
}
catch (SQLException e)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
index ba7a5bab88..0a24a0e492 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSignInForOpenJoiningMethod.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanLevelData;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.ClanEntryManager;
@@ -63,12 +64,12 @@ public class RequestPledgeSignInForOpenJoiningMethod implements IClientIncomingP
final Clan clan = pledgeRecruitInfo.getClan();
if ((clan != null) && (player.getClan() == null))
{
- if (clan.getCharPenaltyExpiryTime() > System.currentTimeMillis())
+ if (clan.getCharPenaltyExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
return;
}
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
index 30e0b1b097..9c606fc9fe 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java
@@ -34,8 +34,8 @@ import org.l2jmobius.gameserver.model.quest.Event;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Fort.FortFunction;
import org.l2jmobius.gameserver.network.GameClient;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
index d415106f6a..d21279f5be 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestSetPledgeCrest.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CrestTable;
import org.l2jmobius.gameserver.model.Crest;
import org.l2jmobius.gameserver.model.Crest.CrestType;
@@ -74,7 +75,7 @@ public class RequestSetPledgeCrest implements IClientIncomingPacket
return;
}
- if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
+ if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
return;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
index 1b4d8434b5..0db2c26d57 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestStartPledgeWar.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.ClanWarState;
import org.l2jmobius.gameserver.enums.UserInfoType;
@@ -101,7 +102,7 @@ public class RequestStartPledgeWar implements IClientIncomingPacket
client.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
- else if (clanDeclaredWar.getDissolvingExpiryTime() > System.currentTimeMillis())
+ else if (clanDeclaredWar.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
{
client.sendPacket(new SystemMessage(SystemMessageId.A_CLAN_WAR_CAN_NOT_BE_DECLARED_AGAINST_A_CLAN_THAT_IS_BEING_DISSOLVED));
client.sendPacket(ActionFailed.STATIC_PACKET);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
index 8d0f9b92cc..48988b5249 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestWithdrawalPledge.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.network.GameClient;
@@ -62,7 +63,7 @@ public class RequestWithdrawalPledge implements IClientIncomingPacket
}
final Clan clan = player.getClan();
- clan.removeClanMember(player.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
+ clan.removeClanMember(player.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
sm.addString(player.getName());
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
index 64714a4976..949dba2b59 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/UseItem.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlEvent;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.NextAction;
@@ -264,7 +265,7 @@ public class UseItem implements IClientIncomingPacket
else if (player.isAttackingNow())
{
// Equip or unEquip.
- ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
+ ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
index aef68ac971..96ce901338 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.appearance;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
import org.l2jmobius.gameserver.enums.InventorySlot;
import org.l2jmobius.gameserver.enums.ItemLocation;
@@ -252,7 +253,7 @@ public class RequestShapeShiftingItem implements IClientIncomingPacket
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getLifeTime() > 0))
{
- targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, System.currentTimeMillis() + appearanceStone.getLifeTime());
+ targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, Chronos.currentTimeMillis() + appearanceStone.getLifeTime());
targetItem.scheduleVisualLifeTime();
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
index 2aa7eeeeac..d6bbe9b766 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.World;
@@ -118,9 +119,9 @@ public class ConfirmMenteeAdd implements IClientIncomingPacket
mentor.sendPacket(SystemMessageId.YOU_MUST_AWAKEN_IN_ORDER_TO_BECOME_A_MENTOR);
return false;
}
- else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > System.currentTimeMillis())
+ else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > Chronos.currentTimeMillis())
{
- long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - System.currentTimeMillis()) / 1000;
+ long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - Chronos.currentTimeMillis()) / 1000;
final int days = (int) (remainingTime / 86400);
remainingTime = remainingTime % 86400;
final int hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
index e06cd9048d..1e8aba6d16 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
@@ -119,7 +120,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
index f6702caa41..9c076a29a5 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
import org.l2jmobius.gameserver.enums.MailType;
@@ -140,7 +141,7 @@ public class RequestBRPresentBuyProduct implements IClientIncomingPacket
*/
private static boolean validatePlayer(PrimeShopGroup item, int count, PlayerInstance player)
{
- final long currentTime = System.currentTimeMillis() / 1000;
+ final long currentTime = Chronos.currentTimeMillis() / 1000;
if (item == null)
{
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/sessionzones/ExTimedHuntingZoneEnter.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/sessionzones/ExTimedHuntingZoneEnter.java
index 047287ab39..f7716bdd1f 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/sessionzones/ExTimedHuntingZoneEnter.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/sessionzones/ExTimedHuntingZoneEnter.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets.sessionzones;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
@@ -91,7 +92,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
player.sendMessage("Your level does not correspond the zone equivalent.");
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
long endTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, 0);
if ((endTime + Config.TIME_LIMITED_ZONE_RESET_DELAY) < currentTime)
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
index c3faad961a..138ed60513 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/training/NotifyTrainingRoomEnd.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.training;
import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.TrainingHolder;
import org.l2jmobius.gameserver.network.GameClient;
@@ -52,7 +53,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
if (holder.isTraining())
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
@@ -60,7 +61,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
player.setImmobilized(false);
player.teleToLocation(player.getLastLocation());
player.sendPacket(ExTrainingZone_Leaving.STATIC_PACKET);
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
index ee1c787150..3f1213f2ee 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/loginserverpackets/game/TempBan.java
@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.loginserverpackets.game;
import org.l2jmobius.commons.network.BaseSendablePacket;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author mrTJO
@@ -28,7 +29,7 @@ public class TempBan extends BaseSendablePacket
writeC(0x0A);
writeS(accountName);
writeS(ip);
- writeQ(System.currentTimeMillis() + (time * 60000));
+ writeQ(Chronos.currentTimeMillis() + (time * 60000));
// if (reason != null)
// {
// writeC(0x01);
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
index c721fa30d9..24af521ca5 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/CharSelectionInfo.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
@@ -277,7 +278,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP
packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP
- packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
+ packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0);
packet.writeD(charInfoPackage.getClassId());
packet.writeD(i == _activeId ? 1 : 0);
@@ -372,7 +373,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
// See if the char must be deleted
final long deletetime = chardata.getLong("deletetime");
- if ((deletetime > 0) && (System.currentTimeMillis() > deletetime))
+ if ((deletetime > 0) && (Chronos.currentTimeMillis() > deletetime))
{
final Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
if (clan != null)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
index 57dd77c3f1..6cbf9639e3 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExInzoneWaiting.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
@@ -53,7 +54,7 @@ public class ExInzoneWaiting implements IClientOutgoingPacket
packet.writeD(_instanceTimes.size());
for (Entry entry : _instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
index a40690e845..6f7b5f8735 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExListPartyMatchingWaitingRoom.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MatchingRoomManager;
@@ -73,7 +74,7 @@ public class ExListPartyMatchingWaitingRoom implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
index d455d825fd..5921d44781 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExPartyRoomMember.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MatchingMemberType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -61,7 +62,7 @@ public class ExPartyRoomMember implements IClientOutgoingPacket
packet.writeD(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
+ final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
packet.writeD(entry.getKey());
packet.writeD((int) instanceTime);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
index 3656ddbc4e..ab85228caf 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExShowReceivedPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.MailType;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
@@ -45,7 +46,7 @@ public class ExShowReceivedPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_RECEIVED_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_inbox != null) && !_inbox.isEmpty())
{
packet.writeD(_inbox.size());
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
index 2ae09181a7..db4bccc928 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ExShowSentPostList.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -40,7 +41,7 @@ public class ExShowSentPostList implements IClientOutgoingPacket
{
OutgoingPackets.EX_SHOW_SENT_POST_LIST.writeId(packet);
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if ((_outbox != null) && !_outbox.isEmpty())
{
packet.writeD(_outbox.size());
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
index db2091ad54..4403da53fe 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/HennaInfo.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.items.Henna;
import org.l2jmobius.gameserver.model.stats.BaseStat;
@@ -73,7 +74,7 @@ public class HennaInfo implements IClientOutgoingPacket
int duration = premium.getDuration();
if (duration > 0)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
duration = (int) Math.max(0, _player.getVariables().getLong("HennaDuration4", currentTime) - currentTime) / 1000;
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
index 5ed678042b..caed96260b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/SiegeInfo.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -88,7 +89,7 @@ public class SiegeInfo implements IClientOutgoingPacket
packet.writeS(""); // Ally Name
}
- packet.writeD((int) (System.currentTimeMillis() / 1000));
+ packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
if (!_castle.isTimeRegistrationOver() && _player.isClanLeader() && (_player.getClanId() == _castle.getOwnerId()))
{
final Calendar cal = Calendar.getInstance();
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
index 5871334785..c6de3ccd8b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/SkillCoolTime.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.TimeStamp;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -36,7 +37,7 @@ public class SkillCoolTime implements IClientOutgoingPacket
public SkillCoolTime(PlayerInstance player)
{
- _currentTime = System.currentTimeMillis();
+ _currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : player.getSkillReuseTimeStamps().values())
{
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel()).isNotBroadcastable())
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
index 74955d8a26..2ffa34919b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/friend/ExFriendDetailInfo.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets.friend;
import java.util.Calendar;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -39,7 +40,7 @@ public class ExFriendDetailInfo implements IClientOutgoingPacket
_objectId = player.getObjectId();
_name = name;
_friend = World.getInstance().getPlayer(_name);
- _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) System.currentTimeMillis() : (int) (System.currentTimeMillis() - _friend.getLastAccess()) / 1000;
+ _lastAccess = (_friend == null) || _friend.isBlocked(player) ? 0 : _friend.isOnline() ? (int) Chronos.currentTimeMillis() : (int) (Chronos.currentTimeMillis() - _friend.getLastAccess()) / 1000;
}
@Override
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/sessionzones/TimedHuntingZoneList.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/sessionzones/TimedHuntingZoneList.java
index 0b42fc84af..9e3aded1c6 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/sessionzones/TimedHuntingZoneList.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/sessionzones/TimedHuntingZoneList.java
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.serverpackets.sessionzones;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
@@ -43,7 +44,7 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
{
OutgoingPackets.EX_TIME_RESTRICT_FIELD_LIST.writeId(packet);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
long endTime;
packet.writeD(2); // zone count
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/scripting/ManagedScript.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
index 00235baa25..9d206480d8 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/scripting/ManagedScript.java
@@ -20,6 +20,8 @@ import java.nio.file.Path;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* Abstract class for classes that are meant to be implemented by scripts.
* @author KenM
@@ -35,7 +37,7 @@ public abstract class ManagedScript
public ManagedScript()
{
_scriptFile = getScriptPath();
- setLastLoadTime(System.currentTimeMillis());
+ setLastLoadTime(Chronos.currentTimeMillis());
}
public abstract Path getScriptPath();
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
index c504d21b0c..76be4439dd 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/AttackStanceTaskManager.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.network.serverpackets.AutoAttackStop;
@@ -54,7 +55,7 @@ public class AttackStanceTaskManager
}
_working = true;
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
try
{
final Iterator> iterator = _attackStanceTasks.entrySet().iterator();
@@ -106,7 +107,7 @@ public class AttackStanceTaskManager
return;
}
- _attackStanceTasks.put(creature, System.currentTimeMillis());
+ _attackStanceTasks.put(creature, Chronos.currentTimeMillis());
}
/**
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
index 8ab6c99d28..d56e0b8a23 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/BuyListTaskManager.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.buylist.Product;
/**
@@ -45,7 +46,7 @@ public class BuyListTaskManager
}
_workingProducts = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : PRODUCTS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
index 8b4a7db319..f8218055f3 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/DecayTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@@ -44,7 +45,7 @@ public class DecayTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -87,7 +88,7 @@ public class DecayTaskManager
}
// Add to decay schedules.
- DECAY_SCHEDULES.put(creature, System.currentTimeMillis() + (delay * 1000));
+ DECAY_SCHEDULES.put(creature, Chronos.currentTimeMillis() + (delay * 1000));
}
/**
@@ -107,7 +108,7 @@ public class DecayTaskManager
public long getRemainingTime(Creature creature)
{
final Long time = DECAY_SCHEDULES.get(creature);
- return time != null ? time.longValue() - System.currentTimeMillis() : Long.MAX_VALUE;
+ return time != null ? time.longValue() - Chronos.currentTimeMillis() : Long.MAX_VALUE;
}
@Override
@@ -122,7 +123,7 @@ public class DecayTaskManager
ret.append("Tasks dump:");
ret.append(Config.EOL);
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : DECAY_SCHEDULES.entrySet())
{
ret.append("Class/Name: ");
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
index c3834ecbb9..e0f823bef4 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemAppearanceTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemAppearanceTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
index 27f0273802..de10959db8 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemLifeTimeTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -41,7 +42,7 @@ public class ItemLifeTimeTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 396633692c..160debb492 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
@@ -42,7 +43,7 @@ public class ItemManaTaskManager
}
_working = true;
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Entry entry : ITEMS.entrySet())
{
if (currentTime > entry.getValue().longValue())
@@ -61,7 +62,7 @@ public class ItemManaTaskManager
{
if (!ITEMS.containsKey(item))
{
- ITEMS.put(item, System.currentTimeMillis() + MANA_CONSUMPTION_RATE);
+ ITEMS.put(item, Chronos.currentTimeMillis() + MANA_CONSUMPTION_RATE);
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
index eb0dd7a59f..a2f0dc5563 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/MessageDeletionTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.model.Message;
import org.l2jmobius.gameserver.model.World;
@@ -48,7 +49,7 @@ public class MessageDeletionTaskManager
Integer msgId;
Message msg;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_MESSAGES.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
index 2f270649fb..82483a498a 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/PlayerAutoSaveTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PlayerAutoSaveTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SEARCH: for (Entry entry : PLAYER_TIMES.entrySet())
{
if (time > entry.getValue().longValue())
@@ -63,7 +64,7 @@ public class PlayerAutoSaveTaskManager
public void add(PlayerInstance player)
{
- PLAYER_TIMES.put(player, System.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
+ PLAYER_TIMES.put(player, Chronos.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
}
public void remove(PlayerInstance player)
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
index 6a406a9591..3a812e2fcb 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/PvpFlagTaskManager.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -42,7 +43,7 @@ public class PvpFlagTaskManager
if (!PLAYERS.isEmpty())
{
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (PlayerInstance player : PLAYERS)
{
if (time > player.getPvpFlagLasts())
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
index 5473f21a8f..b8135996f8 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/RandomAnimationTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -43,7 +44,7 @@ public class RandomAnimationTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_ANIMATIONS.entrySet())
{
if (time > entry.getValue().longValue())
@@ -65,7 +66,7 @@ public class RandomAnimationTaskManager
{
if (npc.hasRandomAnimation())
{
- PENDING_ANIMATIONS.putIfAbsent(npc, System.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
+ PENDING_ANIMATIONS.putIfAbsent(npc, Chronos.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
index 8e8e818908..debb0d68e6 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/RespawnTaskManager.java
@@ -21,6 +21,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Spawn;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -42,7 +43,7 @@ public class RespawnTaskManager
}
_working = true;
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
for (Entry entry : PENDING_RESPAWNS.entrySet())
{
if (time > entry.getValue().longValue())
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
index 990efb8b45..d1946b860a 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/TaskManager.java
@@ -36,6 +36,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskBirthday;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskCleanUp;
import org.l2jmobius.gameserver.taskmanager.tasks.TaskRecom;
@@ -94,7 +95,7 @@ public class TaskManager
public void run()
{
task.onTimeElapsed(this);
- lastActivation = System.currentTimeMillis();
+ lastActivation = Chronos.currentTimeMillis();
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement statement = con.prepareStatement(SQL_STATEMENTS[1]))
{
@@ -242,7 +243,7 @@ public class TaskManager
try
{
final Date desired = DateFormat.getInstance().parse(task.getParams()[0]);
- final long diff = desired.getTime() - System.currentTimeMillis();
+ final long diff = desired.getTime() - Chronos.currentTimeMillis();
if (diff >= 0)
{
task.scheduled = ThreadPool.schedule(task, diff);
@@ -293,7 +294,7 @@ public class TaskManager
return false;
}
- delay = min.getTimeInMillis() - System.currentTimeMillis();
+ delay = min.getTimeInMillis() - Chronos.currentTimeMillis();
if (check.after(min) || (delay < 0))
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ui/SystemPanel.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ui/SystemPanel.java
index 8c01c1f8fe..a19a873bfe 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ui/SystemPanel.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ui/SystemPanel.java
@@ -31,6 +31,7 @@ import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.util.Locator;
@@ -42,7 +43,7 @@ public class SystemPanel extends JPanel
{
protected static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
- protected static final long START_TIME = System.currentTimeMillis();
+ protected static final long START_TIME = Chronos.currentTimeMillis();
public SystemPanel()
{
@@ -136,7 +137,7 @@ public class SystemPanel extends JPanel
lblConnected.setText("Connected: " + playerCount);
lblMaxConnected.setText("Max connected: " + World.MAX_CONNECTED_COUNT);
lblOfflineShops.setText("Offline trade: " + World.OFFLINE_TRADE_COUNT);
- lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - START_TIME));
+ lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(Chronos.currentTimeMillis() - START_TIME));
}
}, 1000, 1000);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
index ec95816f82..cc8059f91a 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/util/FloodProtectorAction.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.PlayerCondOverride;
@@ -151,7 +152,7 @@ public class FloodProtectorAction
*/
private void banAccount()
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(_client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
if (LOGGER.isLoggable(Level.WARNING))
{
log(" banned for flooding ", _config.PUNISHMENT_TIME <= 0 ? "forever" : "for " + (_config.PUNISHMENT_TIME / 60000) + " mins");
@@ -171,7 +172,7 @@ public class FloodProtectorAction
final int charId = _client.getPlayer().getObjectId();
if (charId > 0)
{
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(charId, PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + _config.PUNISHMENT_TIME, "", getClass().getSimpleName()));
}
if (LOGGER.isLoggable(Level.WARNING))
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
index e5912dd51b..d6580161c7 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/util/OfflineTradeUtil.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World;
@@ -143,7 +144,7 @@ public class OfflineTradeUtil
if (player.getOfflineStartTime() == 0)
{
- player.setOfflineStartTime(System.currentTimeMillis());
+ player.setOfflineStartTime(Chronos.currentTimeMillis());
}
// Store trade on exit, if realtime saving is enabled.
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/FloodProtectedListener.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/FloodProtectedListener.java
index ba2fc6536a..e2bbcc1aa3 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/FloodProtectedListener.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/FloodProtectedListener.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
/**
* @author -Wooden-
@@ -63,9 +64,9 @@ public abstract class FloodProtectedListener extends Thread
if (fConnection != null)
{
fConnection.connectionNumber += 1;
- if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((System.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((System.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
+ if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
{
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
connection.close();
fConnection.connectionNumber -= 1;
if (!fConnection.isFlooding)
@@ -80,11 +81,11 @@ public abstract class FloodProtectedListener extends Thread
fConnection.isFlooding = false;
LOGGER.info(connection.getInetAddress().getHostAddress() + " is not considered as flooding anymore.");
}
- fConnection.lastConnection = System.currentTimeMillis();
+ fConnection.lastConnection = Chronos.currentTimeMillis();
}
else
{
- fConnection = new ForeignConnection(System.currentTimeMillis());
+ fConnection = new ForeignConnection(Chronos.currentTimeMillis());
_floodProtection.put(connection.getInetAddress().getHostAddress(), fConnection);
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/LoginController.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/LoginController.java
index 189b90e2ee..9d382c646b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/LoginController.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/LoginController.java
@@ -41,6 +41,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.GameServerTable.GameServerInfo;
@@ -176,7 +177,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(USER_INFO_SELECT))
{
- ps.setString(1, Long.toString(System.currentTimeMillis()));
+ ps.setString(1, Long.toString(Chronos.currentTimeMillis()));
ps.setString(2, login);
try (ResultSet rset = ps.executeQuery())
{
@@ -208,7 +209,7 @@ public class LoginController
{
ps.setString(1, login);
ps.setString(2, hashBase64);
- ps.setLong(3, System.currentTimeMillis());
+ ps.setLong(3, Chronos.currentTimeMillis());
ps.setInt(4, 0);
ps.setString(5, addr.getHostAddress());
ps.execute();
@@ -273,7 +274,7 @@ public class LoginController
*/
public void addBanForAddress(InetAddress address, long duration)
{
- _bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
+ _bannedIps.putIfAbsent(address, Chronos.currentTimeMillis() + duration);
}
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
@@ -294,7 +295,7 @@ public class LoginController
}
if (bi != null)
{
- if ((bi > 0) && (bi < System.currentTimeMillis()))
+ if ((bi > 0) && (bi < Chronos.currentTimeMillis()))
{
_bannedIps.remove(address);
LOGGER.info("Removed expired ip address ban " + address.getHostAddress() + ".");
@@ -541,7 +542,7 @@ public class LoginController
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(ACCOUNT_INFO_UPDATE))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.setString(2, address.getHostAddress());
ps.setString(3, info.getLogin());
ps.execute();
@@ -613,7 +614,7 @@ public class LoginController
{
continue;
}
- if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < System.currentTimeMillis())
+ if ((client.getConnectionStartTime() + LOGIN_TIMEOUT) < Chronos.currentTimeMillis())
{
client.close(LoginFailReason.REASON_ACCESS_FAILED);
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/network/LoginClient.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/network/LoginClient.java
index 04455664e2..93194a11c0 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/network/LoginClient.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/network/LoginClient.java
@@ -27,6 +27,7 @@ import javax.crypto.SecretKey;
import org.l2jmobius.commons.network.ChannelInboundHandler;
import org.l2jmobius.commons.network.IIncomingPacket;
import org.l2jmobius.commons.network.IOutgoingPacket;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.commons.util.crypt.ScrambledKeyPair;
import org.l2jmobius.loginserver.LoginController;
@@ -82,14 +83,14 @@ public class LoginClient extends ChannelInboundHandler
_addr = address.getAddress();
_channel = ctx.channel();
_sessionId = Rnd.nextInt();
- _connectionStartTime = System.currentTimeMillis();
+ _connectionStartTime = Chronos.currentTimeMillis();
sendPacket(new Init(_scrambledPair.getScrambledModulus(), _blowfishKey.getEncoded(), _sessionId));
}
@Override
public void channelInactive(ChannelHandlerContext ctx)
{
- if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < System.currentTimeMillis()))
+ if (!_joinedGS || ((_connectionStartTime + LoginController.LOGIN_TIMEOUT) < Chronos.currentTimeMillis()))
{
LoginController.getInstance().removeAuthedLoginClient(getAccount());
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
index 801bc957ae..875759b72a 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/loginserver/network/util/IPv4Filter.java
@@ -24,6 +24,8 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
+
/**
* IPv4 filter.
* @author Forsaiken
@@ -59,7 +61,7 @@ public class IPv4Filter implements Runnable
Flood()
{
- lastAccess = System.currentTimeMillis();
+ lastAccess = Chronos.currentTimeMillis();
trys = 0;
}
}
@@ -74,7 +76,7 @@ public class IPv4Filter implements Runnable
}
final int h = hash(addr.getAddress());
- final long current = System.currentTimeMillis();
+ final long current = Chronos.currentTimeMillis();
Flood f;
synchronized (_ipFloodMap)
{
@@ -120,7 +122,7 @@ public class IPv4Filter implements Runnable
{
while (true)
{
- final long reference = System.currentTimeMillis() - (1000 * 300);
+ final long reference = Chronos.currentTimeMillis() - (1000 * 300);
synchronized (_ipFloodMap)
{
final Iterator> it = _ipFloodMap.entrySet().iterator();
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
index e66362d6c0..86b46f1919 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/FantasyIsle/Parade.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.model.Location;
@@ -137,7 +138,7 @@ public class Parade extends AbstractNpcAI
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
- LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
+ LOGGER.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
}
void load()
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
index c91b42bb26..7757d82c61 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/FantasyIsle/TalentShow.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
@@ -304,7 +305,7 @@ public class TalentShow extends AbstractNpcAI
hourDiff *= 3600000;
minDiff *= 60000;
diff = hourDiff + minDiff;
- LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
+ LOGGER.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(Chronos.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
startQuestTimer("Start", diff, null, null); // first start
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
index 940193f4fc..32c8b9f9f1 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java
@@ -16,6 +16,7 @@
*/
package ai.areas.GainakUnderground.Lailly;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -64,7 +65,7 @@ public class Lailly extends AbstractNpcAI
case "okay":
{
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
- if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis()))
+ if ((instance != null) && (instance.getEndTime() > Chronos.currentTimeMillis()))
{
switch (instance.getTemplateId())
{
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
index 244867b7c6..ded5cf9a43 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/KeucereusAllianceBase/LindviorScene.java
@@ -19,6 +19,7 @@ package ai.areas.KeucereusAllianceBase;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
@@ -109,7 +110,7 @@ public class LindviorScene extends AbstractNpcAI
final GregorianCalendar date = new GregorianCalendar();
date.set(Calendar.MINUTE, RESET_MIN);
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
- if (System.currentTimeMillis() >= date.getTimeInMillis())
+ if (Chronos.currentTimeMillis() >= date.getTimeInMillis())
{
date.add(Calendar.DAY_OF_WEEK, 1);
}
@@ -135,7 +136,7 @@ public class LindviorScene extends AbstractNpcAI
{
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
}
- return date.getTimeInMillis() - System.currentTimeMillis();
+ return date.getTimeInMillis() - Chronos.currentTimeMillis();
}
public static void main(String[] args)
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
index 80dffe38b2..de8ea0aea9 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/RuneCastle/Venom/Venom.java
@@ -19,6 +19,7 @@ package ai.areas.Rune.RuneCastle.Venom;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -111,7 +112,7 @@ public class Venom extends AbstractNpcAI
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
index a7d7250e8b..c42186c0d0 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/SeedOfAnnihilation/SeedOfAnnihilation.java
@@ -20,6 +20,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -229,7 +230,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
int buffsNow = 0;
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
- if (var < System.currentTimeMillis())
+ if (var < Chronos.currentTimeMillis())
{
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
@@ -254,7 +255,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
reenter.set(Calendar.MINUTE, 0);
reenter.set(Calendar.HOUR_OF_DAY, 13);
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
- if (reenter.getTimeInMillis() <= System.currentTimeMillis())
+ if (reenter.getTimeInMillis() <= Chronos.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 7);
}
@@ -272,7 +273,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
}
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
private void spawnGroupOfMinion(MonsterInstance npc, int[] mobIds)
@@ -317,7 +318,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
zone.clearSkills();
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
}
- startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
+ startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
}
else if (event.equalsIgnoreCase("transform"))
{
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Baium/Baium.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Baium/Baium.java
index b6bf605bd9..11c4fff3ef 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Baium/Baium.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Baium/Baium.java
@@ -17,6 +17,7 @@
package ai.bosses.Baium;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.CategoryType;
@@ -134,7 +135,7 @@ public class Baium extends AbstractNpcAI
final int heading = info.getInt("heading");
_baium = (GrandBossInstance) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
_baium.setCurrentHpMp(curr_hp, curr_mp);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
addBoss(_baium);
for (Location loc : ARCHANGEL_LOC)
@@ -147,7 +148,7 @@ public class Baium extends AbstractNpcAI
}
case DEAD:
{
- final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (remain > 0)
{
startQuestTimer("CLEAR_STATUS", remain, null, null);
@@ -202,7 +203,7 @@ public class Baium extends AbstractNpcAI
_baium.disableCoreAI(true);
_baium.setRandomWalking(false);
addBoss(_baium);
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
@@ -368,7 +369,7 @@ public class Baium extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
+ if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
{
notifyEvent("CLEAR_ZONE", null, null);
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
@@ -376,7 +377,7 @@ public class Baium extends AbstractNpcAI
}
else if (npc != null)
{
- if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
+ if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
{
npc.setTarget(npc);
npc.doCast(HEAL_OF_BAIUM.getSkill());
@@ -477,7 +478,7 @@ public class Baium extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon, Skill skill)
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
if (npc.getId() == BAIUM)
{
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
@@ -656,7 +657,7 @@ public class Baium extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
- GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
+ GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
}
private void manageSkills(Npc npc)
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
index aa8528926d..dfce75d90b 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Beleth/Beleth.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -108,7 +109,7 @@ public class Beleth extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("BELETH_UNLOCK", time, null, null);
@@ -349,7 +350,7 @@ public class Beleth extends AbstractNpcAI
c.setImmobilized(false);
}
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
startQuestTimer("CHECK_ATTACK", 60000, null, null);
startQuestTimer("SPAWN25", 60000, null, null);
break;
@@ -507,7 +508,7 @@ public class Beleth extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if ((_lastAttack + 900000) < System.currentTimeMillis())
+ if ((_lastAttack + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -708,7 +709,7 @@ public class Beleth extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(REAL_BELETH);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
deleteAll();
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Core/Core.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Core/Core.java
index 969bb08788..69dc20dc5d 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Core/Core.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Core/Core.java
@@ -23,6 +23,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -89,7 +90,7 @@ public class Core extends AbstractNpcAI
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
@@ -206,7 +207,7 @@ public class Core extends AbstractNpcAI
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
index f4c6a56159..8304f72d48 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/EtisVanEtina/EtisVanEtina.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
@@ -331,7 +332,7 @@ public class EtisVanEtina extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(ETIS_VAN_ETINA1);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_etina", time, null, null);
@@ -359,7 +360,7 @@ public class EtisVanEtina extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
if (GrandBossManager.getInstance().getBossStatus(ETIS_VAN_ETINA1) != ALIVE)
{
@@ -514,7 +515,7 @@ public class EtisVanEtina extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
// Anti BUGGERS
if (!BOSS_ZONE.isInsideZone(attacker))
{
@@ -697,7 +698,7 @@ public class EtisVanEtina extends AbstractNpcAI
_paragon.setInvul(true);
BOSS_ZONE.getPlayersInside().forEach(player -> player.sendPacket(new ExShowScreenMessage(NpcStringId.YOU_CAN_T_DEFEAT_PARAGON_WHILE_PARAGON_S_MINIONS_ARE_ALIVE, ExShowScreenMessage.TOP_CENTER, 7000, true)));
GrandBossManager.getInstance().setBossStatus(ETIS_VAN_ETINA1, FIGHTING);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
}
}
@@ -738,7 +739,7 @@ public class EtisVanEtina extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(ETIS_VAN_ETINA1, DEAD);
final long respawnTime = (Config.ETINA_SPAWN_INTERVAL + getRandom(-Config.ETINA_SPAWN_RANDOM, Config.ETINA_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(ETIS_VAN_ETINA1);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ETIS_VAN_ETINA1, info);
startQuestTimer("unlock_etina", respawnTime, null, null);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java
index 171704d1b8..d22ad4d237 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Fafurion/Fafurion.java
@@ -20,6 +20,7 @@ package ai.bosses.Fafurion;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -84,7 +85,7 @@ public class Fafurion extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(FAFURION_GRANDBOSS_ID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_fafurion", time, null, null);
@@ -449,7 +450,7 @@ public class Fafurion extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(FAFURION_GRANDBOSS_ID, DEAD);
final long respawnTime = (Config.FAFURION_SPAWN_INTERVAL + getRandom(-Config.FAFURION_SPAWN_RANDOM, Config.FAFURION_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(FAFURION_GRANDBOSS_ID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(FAFURION_GRANDBOSS_ID, info);
startQuestTimer("unlock_fafurion", respawnTime, null, null);
if (_stage < 7)
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
index 74d2de4727..0b9d442f84 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Freya/IceQueensCastleBattle/IceQueensCastleBattle.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.MountType;
@@ -272,7 +273,7 @@ public class IceQueensCastleBattle extends AbstractInstance
{
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
- controller.getVariables().set("TIMER_END", System.currentTimeMillis() + 360000);
+ controller.getVariables().set("TIMER_END", Chronos.currentTimeMillis() + 360000);
}
break;
}
@@ -665,7 +666,7 @@ public class IceQueensCastleBattle extends AbstractInstance
}
case "SHOW_GLAKIAS_TIMER":
{
- final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - System.currentTimeMillis()) / 1000);
+ final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - Chronos.currentTimeMillis()) / 1000);
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
break;
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
index acbc2c3094..6023594423 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Frintezza/ScarletVanHalisha.java
@@ -23,6 +23,7 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import java.util.List;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -143,11 +144,11 @@ public class ScarletVanHalisha extends AbstractNpcAI
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
}
- else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
+ else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
{
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
}
@@ -248,7 +249,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
case FRINTEZZA_DAEMON_MORPH:
case FRINTEZZA_DAEMON_FIELD:
{
- _lastRangedSkillTime = System.currentTimeMillis();
+ _lastRangedSkillTime = Chronos.currentTimeMillis();
skillRange = 550;
break;
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Helios/Helios.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Helios/Helios.java
index af4d5b4e8e..7e5c37bf69 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Helios/Helios.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Helios/Helios.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -150,7 +151,7 @@ public class Helios extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(HELIOS3);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_helios", time, null, null);
@@ -496,7 +497,7 @@ public class Helios extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(HELIOS3, DEAD);
final long respawnTime = (Config.HELIOS_SPAWN_INTERVAL + getRandom(-Config.HELIOS_SPAWN_RANDOM, Config.HELIOS_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(HELIOS3);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(HELIOS3, info);
startQuestTimer("unlock_helios", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
index 81fd9ae6e8..9c32d36ecf 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Kelbim/Kelbim.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.Movie;
@@ -121,7 +122,7 @@ public class Kelbim extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(KELBIM);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_kelbim", time, null, null);
@@ -156,7 +157,7 @@ public class Kelbim extends AbstractNpcAI
}
case "check_activity_task":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
GrandBossManager.getInstance().setBossStatus(KELBIM, ALIVE);
for (Creature creature : ZONE.getCharactersInside())
@@ -193,7 +194,7 @@ public class Kelbim extends AbstractNpcAI
{
_kelbimBoss = (GrandBossInstance) addSpawn(KELBIM, -56340, 60801, -269, 54262, false, 0);
GrandBossManager.getInstance().addBoss(_kelbimBoss);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("check_activity_task", 60000, null, null);
startQuestTimer("stage_all_random_area_attack", Rnd.get(2, 3) * 60000, null, null);
break;
@@ -369,7 +370,7 @@ public class Kelbim extends AbstractNpcAI
{
if (npc.getId() == KELBIM)
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
switch (_bossStage)
{
@@ -434,7 +435,7 @@ public class Kelbim extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(KELBIM, DEAD);
final long respawnTime = (Config.KELBIM_SPAWN_INTERVAL + getRandom(-Config.KELBIM_SPAWN_RANDOM, Config.KELBIM_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(KELBIM);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(KELBIM, info);
startQuestTimer("unlock_kelbim", respawnTime, null, null);
startQuestTimer("end_kelbim", 1800000, null, null);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
index 6b02643bc0..63811284a1 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Lindvior/Lindvior.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.SpawnTable;
@@ -213,7 +214,7 @@ public class Lindvior extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_lindvior", time, null, null);
@@ -863,7 +864,7 @@ public class Lindvior extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
final long respawnTime = (Config.LINDVIOR_SPAWN_INTERVAL + getRandom(-Config.LINDVIOR_SPAWN_RANDOM, Config.LINDVIOR_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
startQuestTimer("unlock_lindvior", respawnTime, null, null);
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
index 8f5d996e6c..5108b80c03 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Orfen/Orfen.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -88,7 +89,7 @@ public class Orfen extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for Orfen from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if Orfen is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -309,7 +310,7 @@ public class Orfen extends AbstractNpcAI
startQuestTimer("orfen_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(ORFEN, info);
cancelQuestTimer("check_minion_loc", npc, null);
startQuestTimer("despawn_minions", 20000, null, null);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
index f2869a3fe9..c00a82fb97 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/QueenAnt/QueenAnt.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -96,7 +97,7 @@ public class QueenAnt extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for queen ant from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
// if queen ant is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
@@ -367,7 +368,7 @@ public class QueenAnt extends AbstractNpcAI
cancelQuestTimer("heal", null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(QUEEN, info);
_nurses.clear();
_larva.deleteMe();
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
index eda49595a1..fd26faf27c 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/QueenShyeed/QueenShyeed.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.QueenShyeed;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -87,7 +88,7 @@ public class QueenShyeed extends AbstractNpcAI
private void spawnShyeed()
{
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
- final long remain = respawn != 0 ? respawn - System.currentTimeMillis() : 0;
+ final long remain = respawn != 0 ? respawn - Chronos.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("respawn", remain, null, null);
@@ -103,7 +104,7 @@ public class QueenShyeed extends AbstractNpcAI
private void startRespawn()
{
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
- GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(System.currentTimeMillis() + respawnTime));
+ GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(Chronos.currentTimeMillis() + respawnTime));
startQuestTimer("respawn", respawnTime, null, null);
// MOB_BUFF_ZONE.setEnabled(false);
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
index e6cd81dbf4..b02a51942f 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Ramona/Ramona.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -137,7 +138,7 @@ public class Ramona extends AbstractNpcAI
addAttackId(MP_CONTROL, RAMONA_1, RAMONA_2, RAMONA_3);
addSpawnId(RAMONA_1, RAMONA_2, RAMONA_3);
- final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - System.currentTimeMillis();
+ final long temp = GlobalVariablesManager.getInstance().getLong(RAMONA_RESPAWN_VAR, 0) - Chronos.currentTimeMillis();
if (temp > 0)
{
_boss = Status.DEAD;
@@ -167,7 +168,7 @@ public class Ramona extends AbstractNpcAI
npc.setInvul(false);
cancelQuestTimers("SPAWN_MS");
startQuestTimer("CHECK_ACTIVITY_TASK", 5000, null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
}
break;
}
@@ -186,7 +187,7 @@ public class Ramona extends AbstractNpcAI
startQuestTimer("GENERATOR_2", getRandom(900000, 1200000), null, null);
startQuestTimer("GENERATOR_3", getRandom(1500000, 1800000), null, null);
startQuestTimer("GENERATOR_4", getRandom(2100000, 2400000), null, null);
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
startQuestTimer("RAMONA1_SKILL", 6000, _ramona1, null);
break;
}
@@ -300,7 +301,7 @@ public class Ramona extends AbstractNpcAI
}
case "CHECK_ACTIVITY_TASK":
{
- if ((_lastAction + 900000) < System.currentTimeMillis())
+ if ((_lastAction + 900000) < Chronos.currentTimeMillis())
{
for (Creature creature : ZONE.getCharactersInside())
{
@@ -396,17 +397,17 @@ public class Ramona extends AbstractNpcAI
}
case RAMONA_1:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
@@ -540,7 +541,7 @@ public class Ramona extends AbstractNpcAI
{
_boss = Status.DEAD;
final long respawnTime = (Config.RAMONA_SPAWN_INTERVAL + getRandom(-Config.RAMONA_SPAWN_RANDOM, Config.RAMONA_SPAWN_RANDOM)) * 3600000;
- GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set(RAMONA_RESPAWN_VAR, Chronos.currentTimeMillis() + respawnTime);
startQuestTimer("RAMONA_UNLOCK", respawnTime, null, null);
startQuestTimer("END_RAMONA", 90000, null, null);
break;
@@ -568,13 +569,13 @@ public class Ramona extends AbstractNpcAI
case RAMONA_1:
{
_boss = Status.IN_FIGHT;
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
case RAMONA_2:
case RAMONA_3:
{
- _lastAction = System.currentTimeMillis();
+ _lastAction = Chronos.currentTimeMillis();
break;
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
index 4d4eb8653a..be58208558 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Sailren/Sailren.java
@@ -16,6 +16,7 @@
*/
package ai.bosses.Sailren;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -71,7 +72,7 @@ public class Sailren extends AbstractNpcAI
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
- final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
+ final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - Chronos.currentTimeMillis();
if (remain > 0)
{
STATUS = Status.DEAD;
@@ -118,7 +119,7 @@ public class Sailren extends AbstractNpcAI
{
takeItems(player, GAZKH, 1);
STATUS = Status.IN_FIGHT;
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
for (PlayerInstance member : player.getParty().getMembers())
{
if (member.isInsideRadius3D(npc, 1000))
@@ -237,7 +238,7 @@ public class Sailren extends AbstractNpcAI
}
case "CHECK_ATTACK":
{
- if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
+ if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < Chronos.currentTimeMillis()))
{
cancelQuestTimer("TIME_OUT", null, null);
notifyEvent("TIME_OUT", null, null);
@@ -257,7 +258,7 @@ public class Sailren extends AbstractNpcAI
{
if (zone.isCharacterInZone(attacker))
{
- _lastAttack = System.currentTimeMillis();
+ _lastAttack = Chronos.currentTimeMillis();
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -274,7 +275,7 @@ public class Sailren extends AbstractNpcAI
STATUS = Status.DEAD;
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
final long respawnTime = RESPAWN * 3600000;
- GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
+ GlobalVariablesManager.getInstance().set("SailrenRespawn", Chronos.currentTimeMillis() + respawnTime);
cancelQuestTimer("CHECK_ATTACK", null, null);
cancelQuestTimer("TIME_OUT", null, null);
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
index 660184afce..a38e646615 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Trasken/Trasken.java
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.DoorData;
@@ -326,7 +327,7 @@ public class Trasken extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (status == DEAD)
{
- final long time = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (time > 0)
{
startQuestTimer("unlock_trasken", time, null, null);
@@ -604,7 +605,7 @@ public class Trasken extends AbstractNpcAI
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
startQuestTimer("unlock_trasken", respawnTime, null, null);
break;
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
index 94d29e346e..c8e0f497af 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/bosses/Valakas/Valakas.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.MountType;
@@ -129,7 +130,7 @@ public class Valakas extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for valakas from DB
- final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
+ final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
if (temp > 0)
{
// The time has not yet expired. Mark Valakas as currently locked (dead).
@@ -168,7 +169,7 @@ public class Valakas extends AbstractNpcAI
if (status == FIGHTING)
{
// stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
startQuestTimer("regen_task", 60000, valakas, null, true);
startQuestTimer("skill_task", 2000, valakas, null, true);
@@ -196,7 +197,7 @@ public class Valakas extends AbstractNpcAI
if (event.equalsIgnoreCase("beginning"))
{
// Stores current time
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
// Teleport Valakas to his lair.
npc.teleToLocation(VALAKAS_LAIR);
@@ -220,7 +221,7 @@ public class Valakas extends AbstractNpcAI
else if (event.equalsIgnoreCase("regen_task"))
{
// Inactivity task - 15min
- if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
+ if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < Chronos.currentTimeMillis()))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
@@ -416,7 +417,7 @@ public class Valakas extends AbstractNpcAI
npc.setTarget(attacker);
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
}
- _timeTracker = System.currentTimeMillis();
+ _timeTracker = Chronos.currentTimeMillis();
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -447,7 +448,7 @@ public class Valakas extends AbstractNpcAI
startQuestTimer("valakas_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
- info.set("respawn_time", System.currentTimeMillis() + respawnTime);
+ info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
return super.onKill(npc, killer, isSummon);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/AetherDrops.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/AetherDrops.java
index e798fe70b4..4a77042169 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/AetherDrops.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/AetherDrops.java
@@ -22,6 +22,7 @@ import java.util.Calendar;
import java.util.logging.Level;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -100,7 +101,7 @@ public class AetherDrops extends AbstractNpcAI
calendar.set(Calendar.MINUTE, 30);
cancelQuestTimers("reset");
- startQuestTimer("reset", calendar.getTimeInMillis() - System.currentTimeMillis(), null, null);
+ startQuestTimer("reset", calendar.getTimeInMillis() - Chronos.currentTimeMillis(), null, null);
}
else if (event.equals("reset"))
{
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
index 32f96496cb..1326e0bdab 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java
@@ -46,8 +46,8 @@ import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcManorBypass;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.siege.Castle;
-import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.siege.Castle.CastleFunction;
+import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.teleporter.TeleportHolder;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
index 8eb06bae3d..58a1832471 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/ClanHallAuctioneer/ClanHallAuctioneer.java
@@ -26,6 +26,7 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -153,7 +154,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
- htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + clanHallAuction.getRemaingTime()).atZone(ZoneId.systemDefault())));
}
}
else
@@ -189,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
@@ -247,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
final Clan owner = clanHall.getOwner();
final long remainingTime = clanHallAuction.getRemaingTime();
- final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
+ final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
@@ -296,7 +297,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
sb.append("\">&%");
sb.append(clanHall.getResidenceId());
sb.append(";[0]");
- sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
+ sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + auction.getRemaingTime()).atZone(ZoneId.systemDefault())));
sb.append(" | ");
sb.append(auction.getHighestBid());
sb.append(" | ");
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
index f469c39159..2362aa9446 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -21,6 +21,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.Location;
@@ -73,7 +74,7 @@ public class ProvisionalHalls extends AbstractNpcAI
if (resetTime > 0)
{
cancelQuestTimers(HALL_RESET_VAR + id);
- startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
}
}
}
@@ -126,7 +127,7 @@ public class ProvisionalHalls extends AbstractNpcAI
for (int id : CLAN_HALLS.keySet())
{
- if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < Chronos.currentTimeMillis()))
{
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
@@ -137,7 +138,7 @@ public class ProvisionalHalls extends AbstractNpcAI
clanHall.setOwner(player.getClan());
}
player.sendMessage("Congratulations! You now own a provisional clan hall!");
- startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
return null;
}
}
@@ -177,7 +178,7 @@ public class ProvisionalHalls extends AbstractNpcAI
else if (event.startsWith(HALL_RESET_VAR))
{
final String id = event.replace(HALL_RESET_VAR, "");
- if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
{
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
if (clanId > 0)
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
index 18f813b1a2..a3c74220a9 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/TrainingCamp/TrainingCamp.java
@@ -19,6 +19,7 @@ package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.ExperienceData;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
@@ -111,7 +112,7 @@ public class TrainingCamp extends AbstractNpcAI
player.teleToLocation(TRAINING_LOCATION);
player.setImmobilized(true);
// @Sdw: Here we are supposed to send ExUserInfoEquipSlot with a fake equip of a SLS, feels ugly to me, not doing it.
- player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
+ player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), Chronos.currentTimeMillis(), -1));
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
@@ -203,7 +204,7 @@ public class TrainingCamp extends AbstractNpcAI
final TrainingHolder holder = player.getTraingCampInfo();
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
{
- holder.setEndTime(System.currentTimeMillis());
+ holder.setEndTime(Chronos.currentTimeMillis());
player.setTraingCampInfo(holder);
player.enableAllSkills();
player.setInvul(false);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
index 49dfa6b963..6140daa716 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java
@@ -16,6 +16,7 @@
*/
package events.FreyaCelebration;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -79,7 +80,7 @@ public class FreyaCelebration extends LongTimeEvent
{
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
if (currentTime > reuseTime)
{
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
index cce5b52533..d97b3c74db 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.java
@@ -16,6 +16,7 @@
*/
package events.GiftOfVitality;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -94,9 +95,9 @@ public class GiftOfVitality extends LongTimeEvent
case "vitality":
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -110,7 +111,7 @@ public class GiftOfVitality extends LongTimeEvent
{
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
htmltext = "4306-okvitality.htm";
}
break;
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/HappyHours/HappyHours.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/HappyHours/HappyHours.java
index edebac38cf..29c8abcbf5 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/HappyHours/HappyHours.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/HappyHours/HappyHours.java
@@ -16,6 +16,7 @@
*/
package events.HappyHours;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -39,7 +40,7 @@ public class HappyHours extends LongTimeEvent
// Other
private static final int MIN_LEVEL = 20;
private static final int REWARD_INTERVAL = 60 * 60 * 1000; // 1 hour
- private static long _lastRewardTime = System.currentTimeMillis();
+ private static long _lastRewardTime = Chronos.currentTimeMillis();
private HappyHours()
{
@@ -76,9 +77,9 @@ public class HappyHours extends LongTimeEvent
{
if (isEventPeriod())
{
- if ((System.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
+ if ((Chronos.currentTimeMillis() - (_lastRewardTime + REWARD_INTERVAL)) > 0) // Exploit check - Just in case.
{
- _lastRewardTime = System.currentTimeMillis();
+ _lastRewardTime = Chronos.currentTimeMillis();
final ExShowScreenMessage screenMsg = new ExShowScreenMessage("You obtained 20 Sibi's coins.", ExShowScreenMessage.TOP_CENTER, 7000, 0, true, true);
final SystemMessage systemMsg = new SystemMessage(SystemMessageId.YOU_VE_OBTAINED_S1_LUCKY_COINS);
systemMsg.addInt(20);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
index 038d7883b0..7fb3b481dd 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/LoveYourGatekeeper/LoveYourGatekeeper.java
@@ -16,6 +16,7 @@
*/
package events.LoveYourGatekeeper;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -58,9 +59,9 @@ public class LoveYourGatekeeper extends LongTimeEvent
if (player.getAdena() >= PRICE)
{
final long reuse = player.getVariables().getLong(REUSE, 0);
- if (reuse > System.currentTimeMillis())
+ if (reuse > Chronos.currentTimeMillis())
{
- final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
final int hours = (int) (remainingTime / 3600);
final int minutes = (int) ((remainingTime % 3600) / 60);
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
@@ -73,7 +74,7 @@ public class LoveYourGatekeeper extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, PRICE);
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
- player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
+ player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
}
}
else
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
index f7d34dfccd..6615d3e9c8 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/MasterOfEnchanting/MasterOfEnchanting.java
@@ -16,6 +16,7 @@
*/
package events.MasterOfEnchanting;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
@@ -86,7 +87,7 @@ public class MasterOfEnchanting extends LongTimeEvent
}
else if (event.equalsIgnoreCase("buy_scroll_24"))
{
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
final String value = player.getVariables().getString("MasterOfEnchanting", "");
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
@@ -100,7 +101,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
@@ -134,7 +135,7 @@ public class MasterOfEnchanting extends LongTimeEvent
{
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
giveItems(player, MASTER_YOGI_SCROLL, 24);
- player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
+ player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
htmltext = "32599-scroll24.htm";
}
else
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/SavingSanta/SavingSanta.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
index 4eccf4b578..9f1be4ab6a 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/SavingSanta/SavingSanta.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.data.xml.SkillData;
@@ -324,7 +325,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_rewardedPlayers.containsKey(pl.getAccountName()))
{
- final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
+ final long elapsedTimeSinceLastRewarded = Chronos.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
{
continue;
@@ -333,7 +334,7 @@ public class SavingSanta extends LongTimeEvent
else
{
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
- if ((System.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
+ if ((Chronos.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
{
_rewardedPlayers.put(pl.getAccountName(), time);
continue;
@@ -343,8 +344,8 @@ public class SavingSanta extends LongTimeEvent
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
- _rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
- player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
+ _rewardedPlayers.put(pl.getAccountName(), Chronos.currentTimeMillis());
+ player.getVariables().set("LAST_SANTA_REWARD", Chronos.currentTimeMillis());
startQuestTimer("SantaRewarding0", 500, santa, pl);
}
}
@@ -437,7 +438,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
{
startQuestTimer("SantaBlessings", 15000, null, null);
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (Npc santaHelper1 : _santaHelpers)
{
for (PlayerInstance plb : World.getInstance().getVisibleObjects(santaHelper1, PlayerInstance.class))
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java
index 5c332ec4ee..4e185fe8e2 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/events/TrainingWithDandy/TrainingWithDandy.java
@@ -18,6 +18,7 @@ package events.TrainingWithDandy;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -66,7 +67,7 @@ public class TrainingWithDandy extends LongTimeEvent
{
npc.setTarget(player);
npc.doCast(DANDY_CH.getSkill());
- player.getVariables().set(GIVE_DANDI_BUFF_VAR, System.currentTimeMillis());
+ player.getVariables().set(GIVE_DANDI_BUFF_VAR, Chronos.currentTimeMillis());
player.broadcastStatusUpdate();
htmltext = "33894-2.htm";
break;
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
index 64d4112e1f..729838d853 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Collection;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.CursedWeapon;
@@ -209,7 +210,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
}
- cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
+ cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
cw.reActivate();
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
index 9801093a20..0e4285c8e3 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminGraciaSeeds.java
@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import java.util.Calendar;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -66,7 +67,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
{
final Calendar nextChangeDate = Calendar.getInstance();
- nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
+ nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
html.replace("%sodtime%", nextChangeDate.getTime().toString());
}
else
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
index 72117290b3..6855d75da1 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminInstanceZone.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.World;
@@ -117,7 +118,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
int hours = 0;
int minutes = 0;
final int id = entry.getKey();
- final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
+ final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
if (remainingTime > 0)
{
hours = (int) (remainingTime / 3600);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
index 5fffc77ae3..8c3faede2d 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
@@ -233,7 +234,7 @@ public class AdminPunishment implements IAdminCommandHandler
long expirationTime = Integer.parseInt(exp);
if (expirationTime > 0)
{
- expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
+ expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
}
final PunishmentAffect affect = PunishmentAffect.getByName(af);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
index aa1d6dd435..ae1bb4e0b2 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminServerInfo.java
@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -60,7 +61,7 @@ public class AdminServerInfo implements IAdminCommandHandler
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
- html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
+ html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
html.replace("%serverUpTime%", getServerUpTime());
html.replace("%onlineAll%", getPlayersCount("ALL"));
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
@@ -76,7 +77,7 @@ public class AdminServerInfo implements IAdminCommandHandler
private String getServerUpTime()
{
- long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
+ long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
final long days = TimeUnit.MILLISECONDS.toDays(time);
time -= TimeUnit.DAYS.toMillis(days);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
index ff3b82a10f..21489c89f6 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IBypassHandler;
@@ -133,7 +134,7 @@ public class FindPvP implements IBypassHandler
player.setSpawnProtection(true);
if (!player.isGM())
{
- player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
player.startPvPFlag();
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
index a81161c50a..adb3c27701 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/dailymissionhandlers/LoginMonthDailyMissionHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.dailymissionhandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -61,9 +62,9 @@ public class LoginMonthDailyMissionHandler extends AbstractDailyMissionHandler
final long lastCompleted = entry.getLastCompleted();
if (lastCompleted == 0) // Initial entry.
{
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
}
- else if ((System.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
+ else if ((Chronos.currentTimeMillis() - lastCompleted) > 2506000000L) // 2506000000L (29 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
index 9fee9dd50e..0322107487 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/dailymissionhandlers/LoginWeekendDailyMissionHandler.java
@@ -18,6 +18,7 @@ package handlers.dailymissionhandlers;
import java.util.Calendar;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -63,7 +64,7 @@ public class LoginWeekendDailyMissionHandler extends AbstractDailyMissionHandler
final int currentDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
final long lastCompleted = entry.getLastCompleted();
if (((currentDay == Calendar.SATURDAY) || (currentDay == Calendar.SUNDAY)) // Reward only on weekend.
- && ((lastCompleted == 0) || ((System.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
+ && ((lastCompleted == 0) || ((Chronos.currentTimeMillis() - lastCompleted) > 172800000))) // Initial entry or 172800000 (2 day) delay.
{
entry.setProgress(1);
entry.setStatus(DailyMissionStatus.AVAILABLE);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
index 0b04c4ff59..5168629d5f 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/AddHuntingTime.java
@@ -17,6 +17,7 @@
package handlers.effecthandlers;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -55,7 +56,7 @@ public class AddHuntingTime extends AbstractEffect
return;
}
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
long endTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, 0);
if ((_zoneId == 8) && (endTime > currentTime) && (((endTime - currentTime) + _time) >= Config.TIME_LIMITED_MAX_ADDED_TIME_WEEKLY))
{
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
index 71928b144a..c2ea6f7a5a 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/punishmenthandlers/ChatBanHandler.java
@@ -16,6 +16,7 @@
*/
package handlers.punishmenthandlers;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
import org.l2jmobius.gameserver.model.World;
@@ -126,7 +127,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
index 245af11bfa..2abbe8e8e8 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/punishmenthandlers/JailHandler.java
@@ -17,6 +17,7 @@
package handlers.punishmenthandlers;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
@@ -180,7 +181,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
- final long delay = ((task.getExpirationTime() - System.currentTimeMillis()) / 1000);
+ final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
index 3dd1cdc97d..fd92c92ed9 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/Ban.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Ban implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
index f653561c0d..85b92a163b 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/BanChat.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class BanChat implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
index cf3736fc0e..c21718ad0c 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/telnethandlers/player/Jail.java
@@ -16,6 +16,7 @@
*/
package handlers.telnethandlers.player;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
@@ -65,7 +66,7 @@ public class Jail implements ITelnetCommand
if (Util.isDigit(token))
{
time = Integer.parseInt(token) * 60 * 1000;
- time += System.currentTimeMillis();
+ time += Chronos.currentTimeMillis();
}
if (args.length > 2)
{
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
index 43b6df41dc..a57194664d 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
@@ -18,6 +18,7 @@ package handlers.usercommandhandlers;
import java.text.SimpleDateFormat;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -46,7 +47,7 @@ public class ClanPenalty implements IUserCommandHandler
final StringBuilder htmlContent = new StringBuilder(500);
htmlContent.append("");
- if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append("Unable to join a clan. | ");
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
@@ -54,7 +55,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
{
htmlContent.append(" | Unable to create a clan. | ");
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
@@ -62,7 +63,7 @@ public class ClanPenalty implements IUserCommandHandler
penalty = true;
}
- if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
+ if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
{
htmlContent.append(" | Unable to invite a clan member. | ");
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/Time.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
index 530047a4f2..57bd48cd81 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/Time.java
@@ -20,6 +20,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Time implements IUserCommandHandler
player.sendPacket(sm);
if (Config.DISPLAY_SERVER_TIME)
{
- player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
+ player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
}
return true;
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
index a2eab150c7..f727b3518f 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/voicedcommandhandlers/ChatAdmin.java
@@ -18,6 +18,7 @@ package handlers.voicedcommandhandlers;
import java.util.StringTokenizer;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
@@ -103,7 +104,7 @@ public class ChatAdmin implements IVoicedCommandHandler
return false;
}
- PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
+ PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
if (expirationTime > 0)
{
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
index 213e03e20a..5bf36c47d0 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
@@ -19,6 +19,7 @@ package handlers.voicedcommandhandlers;
import java.text.SimpleDateFormat;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -74,7 +75,7 @@ public class Premium implements IVoicedCommandHandler
html.append(" |
Spoil Chance: x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " |
");
html.append("Spoil Amount: x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " |
");
html.append("Expires: " + format.format(endDate) + " |
");
- html.append("Current Date: " + format.format(System.currentTimeMillis()) + "
|
");
+ html.append("Current Date: " + format.format(Chronos.currentTimeMillis()) + "
|
");
html.append("Premium Info & Rules
|
");
html.append("1. Premium accounts CAN NOT BE TRANSFERED. |
");
html.append("2. Premium does not effect party members. |
");
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
index 4dedee6473..6a07191990 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/CastleDungeon/CastleDungeon.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -156,7 +157,7 @@ public class CastleDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -174,7 +175,7 @@ public class CastleDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
index 686b01379b..ea8ca11b83 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/FortressDungeon/FortressDungeon.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
@@ -169,7 +170,7 @@ public class FortressDungeon extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first raid
spawnRaid(instance);
}
@@ -197,7 +198,7 @@ public class FortressDungeon extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
index 45403c411d..48c9f0e21d 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/Kamaloka/Kamaloka.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
@@ -469,7 +470,7 @@ public class Kamaloka extends AbstractInstance
continue;
}
// if found instance still can't be reentered - exit
- if (System.currentTimeMillis() < entry.getValue().longValue())
+ if (Chronos.currentTimeMillis() < entry.getValue().longValue())
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
sm.addPcName(partyMember);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExceptional/KastiaExceptional.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExceptional/KastiaExceptional.java
index c83ebe83a2..f9185f1130 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExceptional/KastiaExceptional.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExceptional/KastiaExceptional.java
@@ -61,7 +61,7 @@ public class KastiaExceptional extends AbstractInstance
case "enterInstance":
{
/*
- * Cannot enter if player finished another Kastia instance. if ((System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
+ * Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
enterInstance(player, npc, TEMPLATE_ID);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExtreme/KastiaExtreme.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExtreme/KastiaExtreme.java
index 9942e56e93..bd1741c006 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExtreme/KastiaExtreme.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExtreme/KastiaExtreme.java
@@ -61,7 +61,7 @@ public class KastiaExtreme extends AbstractInstance
case "enterInstance":
{
/*
- * Cannot enter if player finished another Kastia instance. if ((System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
+ * Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
enterInstance(player, npc, TEMPLATE_ID);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaHard/KastiaHard.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaHard/KastiaHard.java
index 7aa4924d35..391ef994f6 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaHard/KastiaHard.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaHard/KastiaHard.java
@@ -61,7 +61,7 @@ public class KastiaHard extends AbstractInstance
case "enterInstance":
{
/*
- * Cannot enter if player finished another Kastia instance. if ((System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
+ * Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
enterInstance(player, npc, TEMPLATE_ID);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaLow/KastiaLow.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaLow/KastiaLow.java
index 1dc34af38f..503a6ef507 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaLow/KastiaLow.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaLow/KastiaLow.java
@@ -61,7 +61,7 @@ public class KastiaLow extends AbstractInstance
case "enterInstance":
{
/*
- * Cannot enter if player finished another Kastia instance. if ((System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
+ * Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
enterInstance(player, npc, TEMPLATE_ID);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaMedium/KastiaMedium.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaMedium/KastiaMedium.java
index a8f79a546a..1d474c09d4 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaMedium/KastiaMedium.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaMedium/KastiaMedium.java
@@ -61,7 +61,7 @@ public class KastiaMedium extends AbstractInstance
case "enterInstance":
{
/*
- * Cannot enter if player finished another Kastia instance. if ((System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
+ * Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
enterInstance(player, npc, TEMPLATE_ID);
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
index b3de2f227a..31fa72d28c 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/PailakaRuneCastle/PailakaRuneCastle.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
@@ -260,7 +261,7 @@ public class PailakaRuneCastle extends AbstractInstance
public void onInstanceCreated(Instance instance, PlayerInstance player)
{
// Put re-enter for instance
- REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
+ REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
// Schedule spawn of first wave
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
}
@@ -280,7 +281,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
@@ -309,7 +310,7 @@ public class PailakaRuneCastle extends AbstractInstance
else if (REENETER_HOLDER.containsKey(template.getId()))
{
final long time = REENETER_HOLDER.get(template.getId());
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
showHtmlFile(groupLeader, "enterRestricted.html");
return false;
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/Chronos.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/Chronos.java
new file mode 100644
index 0000000000..a4d15f77e5
--- /dev/null
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/Chronos.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2021 Pantelis Andrianakis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.l2jmobius.commons.util;
+
+/**
+ * Chronos updates an internal long value with System.currentTimeMillis() approximately every 1 millisecond.
+ * To get the current time in milliseconds use Chronos.currentTimeMillis()
+ * @author Pantelis Andrianakis
+ * @version February 3rd 2021
+ */
+public class Chronos extends Thread
+{
+ private long _currentTimeMillis = System.currentTimeMillis();
+
+ public Chronos()
+ {
+ super.setName("Chronos");
+ super.setPriority(MAX_PRIORITY);
+ super.setDaemon(true);
+ super.start();
+ }
+
+ @Override
+ public void run()
+ {
+ while (true)
+ {
+ _currentTimeMillis = System.currentTimeMillis();
+
+ // Sleep for approximately 1 millisecond.
+ try
+ {
+ Thread.sleep(1);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /**
+ * Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond,the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
+ *
+ * See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).
+ * @return the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
+ */
+ public static long currentTimeMillis()
+ {
+ return getInstance()._currentTimeMillis;
+ }
+
+ public static Chronos getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final Chronos INSTANCE = new Chronos();
+ }
+}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameServer.java
index af8c12e698..b6d7f6c539 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameServer.java
@@ -32,6 +32,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.enums.ServerMode;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.DeadLockDetector;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.BotReportTable;
@@ -184,7 +185,7 @@ public class GameServer
public GameServer() throws Exception
{
- final long serverLoadStart = System.currentTimeMillis();
+ final long serverLoadStart = Chronos.currentTimeMillis();
// GUI
if (!GraphicsEnvironment.isHeadless())
@@ -469,7 +470,7 @@ public class GameServer
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
- LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
+ LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
ClientNetworkManager.getInstance().start();
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameTimeController.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameTimeController.java
index aa4d359090..48391b466d 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameTimeController.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameTimeController.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.OnDayNightChange;
@@ -97,7 +98,7 @@ public class GameTimeController extends Thread
*/
public int getGameTicks()
{
- return (int) ((System.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
+ return (int) ((Chronos.currentTimeMillis() - _referenceTime) / MILLIS_IN_TICK);
}
/**
@@ -155,7 +156,7 @@ public class GameTimeController extends Thread
while (true)
{
- nextTickTime = ((System.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
+ nextTickTime = ((Chronos.currentTimeMillis() / MILLIS_IN_TICK) * MILLIS_IN_TICK) + 100;
try
{
@@ -166,7 +167,7 @@ public class GameTimeController extends Thread
LOGGER.log(Level.WARNING, getClass().getSimpleName(), e);
}
- sleepTime = nextTickTime - System.currentTimeMillis();
+ sleepTime = nextTickTime - Chronos.currentTimeMillis();
if (sleepTime > 0)
{
try
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
index 2fcae24603..cfb16ebb07 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ItemsAutoDestroy.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -42,7 +43,7 @@ public class ItemsAutoDestroy
public synchronized void addItem(ItemInstance item)
{
- item.setDropTime(System.currentTimeMillis());
+ item.setDropTime(Chronos.currentTimeMillis());
_items.add(item);
}
@@ -53,7 +54,7 @@ public class ItemsAutoDestroy
return;
}
- final long curtime = System.currentTimeMillis();
+ final long curtime = Chronos.currentTimeMillis();
final Iterator itemIterator = _items.iterator();
while (itemIterator.hasNext())
{
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/Shutdown.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/Shutdown.java
index 5279bac36d..d7328247aa 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/Shutdown.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/Shutdown.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseBackup;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.BotReportTable;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
@@ -529,19 +530,19 @@ public class Shutdown extends Thread
protected void restartCounter()
{
- _startTime = System.currentTimeMillis();
+ _startTime = Chronos.currentTimeMillis();
}
protected long getEstimatedTimeAndRestartCounter()
{
- final long toReturn = System.currentTimeMillis() - _startTime;
+ final long toReturn = Chronos.currentTimeMillis() - _startTime;
restartCounter();
return toReturn;
}
protected long getEstimatedTime()
{
- return System.currentTimeMillis() - _startTime;
+ return Chronos.currentTimeMillis() - _startTime;
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/CreatureAI.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/CreatureAI.java
index 22de59f51a..e03e0463be 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/CreatureAI.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/CreatureAI.java
@@ -33,6 +33,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
@@ -308,7 +309,7 @@ public class CreatureAI extends AbstractAI
if (_actor.isAttackingNow())
{
- ThreadPool.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(Chronos.currentTimeMillis()));
}
else
{
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
index fa5cca3384..26734231aa 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/cache/WarehouseCacheManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -39,7 +40,7 @@ public class WarehouseCacheManager
public void addCacheTask(PlayerInstance pc)
{
- CACHED_WH.put(pc, System.currentTimeMillis());
+ CACHED_WH.put(pc, Chronos.currentTimeMillis());
}
public void remCacheTask(PlayerInstance pc)
@@ -56,7 +57,7 @@ public class WarehouseCacheManager
@Override
public void run()
{
- final long cTime = System.currentTimeMillis();
+ final long cTime = Chronos.currentTimeMillis();
for (Entry entry : CACHED_WH.entrySet())
{
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/BotReportTable.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/BotReportTable.java
index 0e2f9777b7..46e025bd3d 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/BotReportTable.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/BotReportTable.java
@@ -39,6 +39,7 @@ import org.xml.sax.helpers.DefaultHandler;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -124,7 +125,7 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() < c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() < c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
}
@@ -290,7 +291,7 @@ public class BotReportTable
return false;
}
- final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
+ final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
@@ -301,7 +302,7 @@ public class BotReportTable
}
}
- final long curTime = System.currentTimeMillis();
+ final long curTime = Chronos.currentTimeMillis();
if (rcd == null)
{
rcd = new ReportedCharData();
@@ -418,12 +419,12 @@ public class BotReportTable
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
- if (System.currentTimeMillis() > c.getTimeInMillis())
+ if (Chronos.currentTimeMillis() > c.getTimeInMillis())
{
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
}
- ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
+ ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - Chronos.currentTimeMillis());
}
catch (Exception e)
{
@@ -464,7 +465,7 @@ public class BotReportTable
{
if (map.containsKey(objectId))
{
- return (System.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
+ return (Chronos.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
}
return true;
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/sql/ClanTable.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
index 4e4da8df06..10f7e0b311 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/sql/ClanTable.java
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import org.l2jmobius.gameserver.data.xml.ClanHallData;
import org.l2jmobius.gameserver.enums.ClanWarState;
@@ -171,7 +172,7 @@ public class ClanTable
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
return null;
}
- if (System.currentTimeMillis() < player.getClanCreateExpiryTime())
+ if (Chronos.currentTimeMillis() < player.getClanCreateExpiryTime())
{
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
return null;
@@ -346,7 +347,7 @@ public class ClanTable
{
destroyClan(clanId);
}
- }, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
+ }, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
}
public boolean isAllyExists(String allyName)
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index 49b0381c91..c3ab796fbf 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World;
@@ -185,7 +186,7 @@ public class OfflineTraderTable
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- if (cal.getTimeInMillis() <= System.currentTimeMillis())
+ if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
{
continue;
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
index 771af1a0a5..8f51b3f599 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/handler/AbstractDailyMissionHandler.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
import org.l2jmobius.gameserver.enums.SpecialItemType;
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
@@ -114,7 +115,7 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
final DailyMissionPlayerEntry entry = getPlayerEntry(player.getObjectId(), true);
entry.setStatus(DailyMissionStatus.COMPLETED);
- entry.setLastCompleted(System.currentTimeMillis());
+ entry.setLastCompleted(Chronos.currentTimeMillis());
entry.setRecentlyCompleted(true);
storePlayerEntry(entry);
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
index 025c3208e6..ecb5b8dc95 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/handler/AdminCommandHandler.java
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.AdminData;
import org.l2jmobius.gameserver.enums.PlayerAction;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -115,7 +116,7 @@ public class AdminCommandHandler implements IHandler
{
- final long begin = System.currentTimeMillis();
+ final long begin = Chronos.currentTimeMillis();
try
{
if (Config.GMAUDIT)
@@ -133,7 +134,7 @@ public class AdminCommandHandler implements IHandler 5000)
{
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
index fedf7cd9dc..ee7642eca5 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/AntiFeedManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
@@ -48,7 +49,7 @@ public class AntiFeedManager
*/
public void setLastDeathTime(int objectId)
{
- _lastDeathTimes.put(objectId, System.currentTimeMillis());
+ _lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
}
/**
@@ -81,7 +82,7 @@ public class AntiFeedManager
return false;
}
- if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
+ if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((Chronos.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
{
return false;
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
index 3d8c1f50e4..301806d976 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/CastleManorManager.java
@@ -41,6 +41,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ManorMode;
@@ -276,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
}
}
// Schedule mode change
- ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
+ ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
}
public void changeMode()
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
index f73777245c..57ff607c72 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/CursedWeaponsManager.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.model.CursedWeapon;
import org.l2jmobius.gameserver.model.actor.Attackable;
@@ -313,7 +314,7 @@ public class CursedWeaponsManager implements IXmlReader
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING_TYPE_CURSEDSWORD_TO_CHECK_OTHER_INFORMATION);
sm.addString(cw.getName());
// sm.addItemName(cw.getItemId());
- sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
+ sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
player.sendPacket(sm);
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
index 72602e0968..babf2e1476 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/DBSpawnManager.java
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -193,7 +194,7 @@ public class DBSpawnManager
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
- final long respawnTime = System.currentTimeMillis() + respawnDelay;
+ final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
info.set("currentHP", npc.getMaxHp());
info.set("currentMP", npc.getMaxMp());
info.set("respawnTime", respawnTime);
@@ -235,7 +236,7 @@ public class DBSpawnManager
}
final int npcId = spawn.getId();
- final long time = System.currentTimeMillis();
+ final long time = Chronos.currentTimeMillis();
SpawnTable.getInstance().addNewSpawn(spawn, false);
if ((respawnTime == 0) || (time > respawnTime))
{
@@ -257,7 +258,7 @@ public class DBSpawnManager
}
else
{
- final long spawnTime = respawnTime - System.currentTimeMillis();
+ final long spawnTime = respawnTime - Chronos.currentTimeMillis();
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
index 60a818cab6..06cce0d3a3 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/GraciaSeedsManager.java
@@ -21,6 +21,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -104,7 +105,7 @@ public class GraciaSeedsManager
case 2:
{
// Conquest Complete state, if too much time is passed than change to defense state
- final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
+ final long timePast = Chronos.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
if (timePast >= Config.SOD_STAGE_2_LENGTH)
{
// change to Attack state because Defend statet is not implemented
@@ -172,7 +173,7 @@ public class GraciaSeedsManager
public void setSoDState(int value, boolean doSave)
{
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
- _SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
+ _SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
_SoDState = value;
// reset number of Tiat kills
if (_SoDState == 1)
@@ -198,7 +199,7 @@ public class GraciaSeedsManager
}
case 2:
{
- return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
+ return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
}
case 3:
{
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index d595a5befa..052f8984d2 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.util.PrimeFinder;
/**
@@ -85,7 +86,7 @@ public class IdManager
try (Connection con = DatabaseFactory.getConnection();
Statement statement = con.createStatement())
{
- final long cleanupStart = System.currentTimeMillis();
+ final long cleanupStart = Chronos.currentTimeMillis();
int cleanCount = 0;
// Characters
@@ -157,7 +158,7 @@ public class IdManager
statement.executeUpdate("UPDATE characters SET clanid=0, clan_privs=0, wantspeace=0, subpledge=0, lvl_joined_academy=0, apprentice=0, sponsor=0, clan_join_expiry_time=0, clan_create_expiry_time=0 WHERE characters.clanid > 0 AND characters.clanid NOT IN (SELECT clan_id FROM clan_data);");
statement.executeUpdate("UPDATE fort SET owner=0 WHERE owner NOT IN (SELECT clan_id FROM clan_data);");
- LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((System.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
+ LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((Chronos.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
}
catch (Exception e)
{
@@ -173,7 +174,7 @@ public class IdManager
{
try (PreparedStatement statement = con.prepareStatement(line))
{
- statement.setLong(1, System.currentTimeMillis());
+ statement.setLong(1, Chronos.currentTimeMillis());
cleanCount += statement.executeUpdate();
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
index d47e436ace..d1f8cd35e2 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
@@ -40,6 +40,7 @@ import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.data.xml.SpawnData;
@@ -521,7 +522,7 @@ public class InstanceManager implements IXmlReader
{
// Check if instance penalty passed
final long time = rs.getLong("time");
- if (time > System.currentTimeMillis())
+ if (time > Chronos.currentTimeMillis())
{
// Load params
final int charId = rs.getInt("charId");
@@ -556,7 +557,7 @@ public class InstanceManager implements IXmlReader
final List invalidPenalty = new ArrayList<>(instanceTimes.size());
for (Entry entry : instanceTimes.entrySet())
{
- if (entry.getValue() <= System.currentTimeMillis())
+ if (entry.getValue() <= Chronos.currentTimeMillis())
{
invalidPenalty.add(entry.getKey());
}
@@ -615,7 +616,7 @@ public class InstanceManager implements IXmlReader
// If reenter time is higher then current, delete it
final long time = playerData.get(id);
- if (time <= System.currentTimeMillis())
+ if (time <= Chronos.currentTimeMillis())
{
deleteInstanceTime(player, id);
return -1;
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
index 739f67e9a9..dfb4734ca5 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -83,7 +84,7 @@ public class ItemsOnGroundManager implements Runnable
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(str))
{
- ps.setLong(1, System.currentTimeMillis());
+ ps.setLong(1, Chronos.currentTimeMillis());
ps.execute();
}
catch (Exception e)
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
index df45860d40..d429a2f8c9 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/MentorManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.Mentee;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -145,7 +146,7 @@ public class MentorManager
{
final PlayerInstance player = World.getInstance().getPlayer(mentorId);
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
- vars.set("Mentor-Penalty-" + mentorId, String.valueOf(System.currentTimeMillis() + penalty));
+ vars.set("Mentor-Penalty-" + mentorId, String.valueOf(Chronos.currentTimeMillis() + penalty));
}
public long getMentorPenalty(int mentorId)
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
index b6c44953b1..80bfff5fdb 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.Containers;
@@ -79,7 +80,7 @@ public class PremiumManager
final PlayerInstance player = event.getPlayer();
final String accountName = player.getAccountName();
loadPremiumData(accountName);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
final long premiumExpiration = getPremiumExpiration(accountName);
player.setPremiumStatus(premiumExpiration > now);
if (player.hasPremiumStatus())
@@ -153,7 +154,7 @@ public class PremiumManager
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
{
final long addTime = timeUnit.toMillis(timeValue);
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
// new premium task at least from now
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
final long newPremiumExpiration = oldPremiumExpiration + addTime;
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
index 9617f26e43..08193f9c5b 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/PunishmentManager.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
@@ -71,7 +72,7 @@ public class PunishmentManager
final String punishedBy = rset.getString("punishedBy");
if ((type != null) && (affect != null))
{
- if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
+ if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
{
expired++;
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/RankManager.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/RankManager.java
index 1e820e35dd..f4c53dca15 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/RankManager.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/RankManager.java
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -40,7 +41,7 @@ public class RankManager
private static final Logger LOGGER = Logger.getLogger(RankManager.class.getName());
public static final Long TIME_LIMIT = 2592000000L; // 30 days in milliseconds
- public static final long CURRENT_TIME = System.currentTimeMillis();
+ public static final long CURRENT_TIME = Chronos.currentTimeMillis();
public static final int PLAYER_LIMIT = 100;
private static final String SELECT_CHARACTERS = "SELECT charId,char_name,level,race,base_class, clanid FROM characters WHERE (" + CURRENT_TIME + " - cast(lastAccess as signed) < " + TIME_LIMIT + ") AND accesslevel = 0 AND level > 84 ORDER BY exp DESC, onlinetime DESC LIMIT " + PLAYER_LIMIT;
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
index 687d1288b9..ab73056bb1 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/instancemanager/games/BlockChecker.java
@@ -25,6 +25,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.SpawnTable;
import org.l2jmobius.gameserver.data.xml.NpcData;
@@ -424,7 +425,7 @@ public class BlockChecker
// Start up player parameters
setUpPlayers();
// Set the started time
- _startedTime = System.currentTimeMillis() + 300000;
+ _startedTime = Chronos.currentTimeMillis() + 300000;
}
}
@@ -524,7 +525,7 @@ public class BlockChecker
_redPoints += _numOfBoxes / 2;
_bluePoints += _numOfBoxes / 2;
- final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((_startedTime - Chronos.currentTimeMillis()) / 1000);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
_holder.broadCastPacketToTeam(changePoints);
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/CursedWeapon.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/CursedWeapon.java
index 37db02114d..d5c37da80e 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/CursedWeapon.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/CursedWeapon.java
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
@@ -237,7 +238,7 @@ public class CursedWeapon implements INamable
@Override
public void run()
{
- if (System.currentTimeMillis() >= _endTime)
+ if (Chronos.currentTimeMillis() >= _endTime)
{
endOfLife();
}
@@ -369,7 +370,7 @@ public class CursedWeapon implements INamable
public void reActivate()
{
_isActivated = true;
- if ((_endTime - System.currentTimeMillis()) <= 0)
+ if ((_endTime - Chronos.currentTimeMillis()) <= 0)
{
endOfLife();
}
@@ -387,7 +388,7 @@ public class CursedWeapon implements INamable
dropIt(attackable, player);
// Start the Life Task
- _endTime = System.currentTimeMillis() + (_duration * 60000);
+ _endTime = Chronos.currentTimeMillis() + (_duration * 60000);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
return true;
}
@@ -681,7 +682,7 @@ public class CursedWeapon implements INamable
public long getTimeLeft()
{
- return _endTime - System.currentTimeMillis();
+ return _endTime - Chronos.currentTimeMillis();
}
public void goTo(PlayerInstance player)
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/ItemInfo.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/ItemInfo.java
index 9ea4c13763..16f3dfe23e 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/ItemInfo.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/ItemInfo.java
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.model.buylist.Product;
import org.l2jmobius.gameserver.model.ensoul.EnsoulOption;
@@ -151,14 +152,14 @@ public class ItemInfo
_soulCrystalOptions = item.getSpecialAbilities();
_soulCrystalSpecialOptions = item.getAdditionalSpecialAbilities();
_visualId = item.getVisualId();
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(ItemInstance item, int change)
{
this(item);
_change = change;
- _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
+ _visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(TradeItem item)
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Message.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Message.java
index e6b1c31d32..53d2f20768 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Message.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Message.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.sql.CharNameTable;
import org.l2jmobius.gameserver.enums.AttributeType;
import org.l2jmobius.gameserver.enums.MailType;
@@ -104,7 +105,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = text;
- _expiration = (isCod ? System.currentTimeMillis() + (COD_EXPIRATION * 3600000) : System.currentTimeMillis() + (EXPIRATION * 3600000));
+ _expiration = (isCod ? Chronos.currentTimeMillis() + (COD_EXPIRATION * 3600000) : Chronos.currentTimeMillis() + (EXPIRATION * 3600000));
_hasAttachments = false;
_unread = true;
_deletedBySender = false;
@@ -123,7 +124,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_reqAdena = 0;
_hasAttachments = false;
_unread = true;
@@ -143,7 +144,7 @@ public class Message
_receiverId = receiverId;
_subject = subject;
_content = content;
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_hasAttachments = false;
_unread = true;
_deletedBySender = true;
@@ -162,7 +163,7 @@ public class Message
_receiverId = msg.getSenderId();
_subject = "";
_content = "";
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_deletedByReceiver = false;
@@ -182,7 +183,7 @@ public class Message
_receiverId = receiverId;
_subject = "";
_content = item.getName();
- _expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
+ _expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
_unread = true;
_deletedBySender = true;
_messageType = mailType;
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Petition.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Petition.java
index 06d4fc32b2..adb136407f 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Petition.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Petition.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.enums.PetitionState;
import org.l2jmobius.gameserver.enums.PetitionType;
import org.l2jmobius.gameserver.instancemanager.IdManager;
@@ -36,7 +37,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class Petition
{
- private final long _submitTime = System.currentTimeMillis();
+ private final long _submitTime = Chronos.currentTimeMillis();
private final int _id;
private final PetitionType _type;
private PetitionState _state = PetitionState.PENDING;
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Spawn.java
index 4a1a2926b3..eb57e4e69b 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -258,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
_scheduledCount++;
// Schedule the next respawn.
- RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
+ RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/TimeStamp.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/TimeStamp.java
index 8c232969e0..9bdb39d293 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/TimeStamp.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/TimeStamp.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -52,7 +53,7 @@ public class TimeStamp
_id2 = skill.getLevel();
_id3 = skill.getSubLevel();
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = -1;
}
@@ -68,7 +69,7 @@ public class TimeStamp
_id2 = item.getObjectId();
_id3 = 0;
_reuse = reuse;
- _stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
+ _stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
_group = item.getSharedReuseGroup();
}
@@ -155,7 +156,7 @@ public class TimeStamp
{
return 0;
}
- final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
+ final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
if (remainingTime == 0)
{
_stamp = 0;
@@ -173,7 +174,7 @@ public class TimeStamp
{
return false;
}
- final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
+ final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
if (!hasNotPassed)
{
_stamp = 0;
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/World.java
index bd533a1661..4821081142 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/World.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/World.java
@@ -28,6 +28,7 @@ import java.util.function.Predicate;
import java.util.logging.Logger;
import org.l2jmobius.Config;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CtrlEvent;
@@ -96,7 +97,7 @@ public class World
private static final AtomicInteger _memberInPartyNumber = new AtomicInteger();
private static final Set _pkPlayers = ConcurrentHashMap.newKeySet(30);
- private static final AtomicInteger _lastPkTime = new AtomicInteger((int) System.currentTimeMillis() / 1000);
+ private static final AtomicInteger _lastPkTime = new AtomicInteger((int) Chronos.currentTimeMillis() / 1000);
private static final WorldRegion[][] _worldRegions = new WorldRegion[REGIONS_X + 1][REGIONS_Y + 1];
@@ -845,13 +846,13 @@ public class World
}
}
_pkPlayers.add(player);
- _lastPkTime.set((int) System.currentTimeMillis() / 1000);
+ _lastPkTime.set((int) Chronos.currentTimeMillis() / 1000);
}
public void removePkPlayer(PlayerInstance player)
{
_pkPlayers.remove(player);
- _lastPkTime.set((int) System.currentTimeMillis() / 1000);
+ _lastPkTime.set((int) Chronos.currentTimeMillis() / 1000);
}
public Set getPkPlayers()
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Attackable.java
index 9289414c7c..121b62df28 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Attackable.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Attackable.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.AttackableAI;
import org.l2jmobius.gameserver.ai.CreatureAI;
@@ -215,7 +216,7 @@ public class Attackable extends Npc
if (_firstCommandChannelAttacked != null)
{
_commandChannelTimer = new CommandChannelTimer(this);
- _commandChannelLastAttack = System.currentTimeMillis();
+ _commandChannelLastAttack = Chronos.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
@@ -224,7 +225,7 @@ public class Attackable extends Npc
}
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
{
- _commandChannelLastAttack = System.currentTimeMillis(); // update last attack time
+ _commandChannelLastAttack = Chronos.currentTimeMillis(); // update last attack time
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java
index ba10981eef..7f0f5757e4 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -41,6 +41,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.EmptyQueue;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -1393,7 +1394,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
{
- final long currentTime = System.currentTimeMillis();
+ final long currentTime = Chronos.currentTimeMillis();
for (TimeStamp ts : _reuseTimeStampsItems.values())
{
if (ts.getSharedReuseGroup() == group)
@@ -1523,7 +1524,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return;
}
- _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? System.currentTimeMillis() + delay : Long.MAX_VALUE);
+ _disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? Chronos.currentTimeMillis() + delay : Long.MAX_VALUE);
}
/**
@@ -1571,7 +1572,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
return false;
}
- if (stamp < System.currentTimeMillis())
+ if (stamp < Chronos.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Npc.java
index 62f1d1049f..d288fe8816 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.cache.HtmCache;
@@ -203,7 +204,7 @@ public class Npc extends Creature
public void onRandomAnimation(int animationId)
{
// Send a packet SocialAction to all PlayerInstance in the _KnownPlayers of the NpcInstance
- final long now = System.currentTimeMillis();
+ final long now = Chronos.currentTimeMillis();
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
{
_lastSocialBroadcast = now;
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
index 7eacda4aa1..c87a2006a9 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/BlockInstance.java
@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.model.actor.instance;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
@@ -141,7 +142,7 @@ public class BlockInstance extends MonsterInstance
{
eng.increasePlayerPoints(player, team);
- final int timeLeft = (int) ((eng.getStarterTime() - System.currentTimeMillis()) / 1000);
+ final int timeLeft = (int) ((eng.getStarterTime() - Chronos.currentTimeMillis()) / 1000);
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints());
final ExCubeGameExtendedChangePoints secretPoints = new ExCubeGameExtendedChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints(), isRed, player, eng.getPlayerPoints(player, isRed));
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 91dd35c793..4c3d9066e4 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -46,6 +46,7 @@ import java.util.stream.Collectors;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameTimeController;
@@ -2764,7 +2765,7 @@ public class PlayerInstance extends Playable
public void setOnlineTime(long time)
{
_onlineTime = time;
- _onlineBeginTime = System.currentTimeMillis();
+ _onlineBeginTime = Chronos.currentTimeMillis();
}
/**
@@ -3809,22 +3810,22 @@ public class PlayerInstance extends Playable
public boolean isSpawnProtected()
{
- return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
+ return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
}
public boolean isTeleportProtected()
{
- return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
+ return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
}
public void setSpawnProtection(boolean protect)
{
- _spawnProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
+ _spawnProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
}
public void setTeleportProtection(boolean protect)
{
- _teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
+ _teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
}
/**
@@ -5200,7 +5201,7 @@ public class PlayerInstance extends Playable
{
return;
}
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
if (_pvpFlag == 0)
{
startPvPFlag();
@@ -5233,11 +5234,11 @@ public class PlayerInstance extends Playable
{
if (checkIfPvP(targetPlayer))
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
}
else
{
- setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
+ setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
}
if (_pvpFlag == 0)
{
@@ -6114,7 +6115,7 @@ public class PlayerInstance extends Playable
public long getUptime()
{
- return System.currentTimeMillis() - _uptime;
+ return Chronos.currentTimeMillis() - _uptime;
}
/**
@@ -6357,7 +6358,7 @@ public class PlayerInstance extends Playable
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
{
statement.setInt(1, isOnlineInt());
- statement.setLong(2, System.currentTimeMillis());
+ statement.setLong(2, Chronos.currentTimeMillis());
statement.setInt(3, getObjectId());
statement.execute();
}
@@ -6483,12 +6484,12 @@ public class PlayerInstance extends Playable
}
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
- if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
+ if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanJoinExpiryTime(0);
}
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
- if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
+ if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
{
player.setClanCreateExpiryTime(0);
}
@@ -6550,7 +6551,7 @@ public class PlayerInstance extends Playable
player.getAppearance().setTitleColor(titleColor);
}
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
- player.setUptime(System.currentTimeMillis());
+ player.setUptime(Chronos.currentTimeMillis());
currentHp = rset.getDouble("curHp");
currentCp = rset.getDouble("curCp");
@@ -7119,7 +7120,7 @@ public class PlayerInstance extends Playable
long totalOnlineTime = _onlineTime;
if (_onlineBeginTime > 0)
{
- totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
+ totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
}
statement.setLong(34, totalOnlineTime);
@@ -7205,7 +7206,7 @@ public class PlayerInstance extends Playable
int buffIndex = 0;
final List