Dropped Chronos.
This commit is contained in:
+1
-2
@@ -22,7 +22,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
@@ -138,7 +137,7 @@ public class Parade extends AbstractNpcAI
|
|||||||
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
|
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000;
|
||||||
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
|
// ThreadPoolManager.scheduleAtFixedRate(new Start(), 180000, cycle);
|
||||||
|
|
||||||
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.");
|
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.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void load()
|
void load()
|
||||||
|
|||||||
+1
-2
@@ -20,7 +20,6 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
@@ -305,7 +304,7 @@ public class TalentShow extends AbstractNpcAI
|
|||||||
hourDiff *= 3600000;
|
hourDiff *= 3600000;
|
||||||
minDiff *= 60000;
|
minDiff *= 60000;
|
||||||
diff = hourDiff + minDiff;
|
diff = hourDiff + minDiff;
|
||||||
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.");
|
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.");
|
||||||
startQuestTimer("Start", diff, null, null); // first start
|
startQuestTimer("Start", diff, null, null); // first start
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -29,7 +29,6 @@ import org.w3c.dom.NamedNodeMap;
|
|||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.IXmlReader;
|
import org.l2jmobius.commons.util.IXmlReader;
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
@@ -517,7 +516,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
|
|||||||
|
|
||||||
final GlobalVariablesManager vars = GlobalVariablesManager.getInstance();
|
final GlobalVariablesManager vars = GlobalVariablesManager.getInstance();
|
||||||
final long var = vars.getLong("FourSepulchers" + npcId, 0) + (TIME_ATTACK * 60 * 1000);
|
final long var = vars.getLong("FourSepulchers" + npcId, 0) + (TIME_ATTACK * 60 * 1000);
|
||||||
if (var > Chronos.currentTimeMillis())
|
if (var > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
showHtmlFile(player, npcId + "-NE.html", npc, null);
|
showHtmlFile(player, npcId + "-NE.html", npc, null);
|
||||||
return;
|
return;
|
||||||
@@ -582,7 +581,7 @@ public class FourSepulchers extends AbstractNpcAI implements IXmlReader
|
|||||||
ThreadPool.schedule(() -> ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers(), TIME_ATTACK * 60 * 1000);
|
ThreadPool.schedule(() -> ZoneManager.getInstance().getZoneById(MANAGER_ZONES.get(npcId)).oustAllPlayers(), TIME_ATTACK * 60 * 1000);
|
||||||
|
|
||||||
// Save attack time
|
// Save attack time
|
||||||
vars.set("FourSepulchers" + npcId, Chronos.currentTimeMillis());
|
vars.set("FourSepulchers" + npcId, System.currentTimeMillis());
|
||||||
// Init progress
|
// Init progress
|
||||||
STORED_PROGRESS.put(sepulcherId, 1); // start from 1
|
STORED_PROGRESS.put(sepulcherId, 1); // start from 1
|
||||||
// Start
|
// Start
|
||||||
|
|||||||
Vendored
+2
-3
@@ -19,7 +19,6 @@ package ai.areas.KeucereusAllianceBase;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.SpawnTable;
|
import org.l2jmobius.gameserver.data.SpawnTable;
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
import org.l2jmobius.gameserver.enums.Movie;
|
import org.l2jmobius.gameserver.enums.Movie;
|
||||||
@@ -122,7 +121,7 @@ public class LindviorScene extends AbstractNpcAI
|
|||||||
final GregorianCalendar date = new GregorianCalendar();
|
final GregorianCalendar date = new GregorianCalendar();
|
||||||
date.set(Calendar.MINUTE, RESET_MIN);
|
date.set(Calendar.MINUTE, RESET_MIN);
|
||||||
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
||||||
if (Chronos.currentTimeMillis() >= date.getTimeInMillis())
|
if (System.currentTimeMillis() >= date.getTimeInMillis())
|
||||||
{
|
{
|
||||||
date.add(Calendar.DAY_OF_WEEK, 1);
|
date.add(Calendar.DAY_OF_WEEK, 1);
|
||||||
}
|
}
|
||||||
@@ -140,7 +139,7 @@ public class LindviorScene extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
|
date.add(Calendar.DAY_OF_WEEK, 1 + RESET_DAY_1);
|
||||||
}
|
}
|
||||||
return date.getTimeInMillis() - Chronos.currentTimeMillis();
|
return date.getTimeInMillis() - System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
|||||||
+1
-2
@@ -19,7 +19,6 @@ package ai.areas.Rune.RuneCastle.Venom;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||||
@@ -112,7 +111,7 @@ public class Venom extends AbstractNpcAI
|
|||||||
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
|
setCastleSiegeStartId(this::onSiegeStart, CASTLE);
|
||||||
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
|
setCastleSiegeFinishId(this::onSiegeFinish, CASTLE);
|
||||||
|
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
|
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
|
||||||
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
|
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
|
||||||
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
|
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
|
||||||
|
|||||||
Vendored
+4
-5
@@ -20,7 +20,6 @@ import java.util.Calendar;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
@@ -230,7 +229,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
|||||||
|
|
||||||
int buffsNow = 0;
|
int buffsNow = 0;
|
||||||
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
|
final Long var = GlobalVariablesManager.getInstance().getLong("SeedNextStatusChange", 0);
|
||||||
if (var < Chronos.currentTimeMillis())
|
if (var < System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
|
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
|
||||||
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
|
GlobalVariablesManager.getInstance().set("SeedBuffsList", String.valueOf(buffsNow));
|
||||||
@@ -255,7 +254,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
|||||||
reenter.set(Calendar.MINUTE, 0);
|
reenter.set(Calendar.MINUTE, 0);
|
||||||
reenter.set(Calendar.HOUR_OF_DAY, 13);
|
reenter.set(Calendar.HOUR_OF_DAY, 13);
|
||||||
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
|
reenter.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
|
||||||
if (reenter.getTimeInMillis() <= Chronos.currentTimeMillis())
|
if (reenter.getTimeInMillis() <= System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
reenter.add(Calendar.DAY_OF_MONTH, 7);
|
reenter.add(Calendar.DAY_OF_MONTH, 7);
|
||||||
}
|
}
|
||||||
@@ -273,7 +272,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
|
ZoneManager.getInstance().getZoneById(a_regionsData.buff_zone, EffectZone.class).addSkill(ZONE_BUFFS[a_regionsData.activeBuff], 1);
|
||||||
}
|
}
|
||||||
startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
|
startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void spawnGroupOfMinion(Monster npc, int[] mobIds)
|
private void spawnGroupOfMinion(Monster npc, int[] mobIds)
|
||||||
@@ -318,7 +317,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
|||||||
zone.clearSkills();
|
zone.clearSkills();
|
||||||
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
|
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
|
||||||
}
|
}
|
||||||
startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - Chronos.currentTimeMillis(), null, null);
|
startQuestTimer("ChangeSeedsStatus", _seedsNextStatusChange - System.currentTimeMillis(), null, null);
|
||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("transform"))
|
else if (event.equalsIgnoreCase("transform"))
|
||||||
{
|
{
|
||||||
|
|||||||
+6
-7
@@ -21,7 +21,6 @@ import java.util.Calendar;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
@@ -345,7 +344,7 @@ public class Anakim extends AbstractNpcAI
|
|||||||
final int status = GrandBossManager.getInstance().getBossStatus(ANAKIM);
|
final int status = GrandBossManager.getInstance().getBossStatus(ANAKIM);
|
||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
final long time = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
if (time > 0)
|
if (time > 0)
|
||||||
{
|
{
|
||||||
startQuestTimer("unlock_anakim", time, null, null);
|
startQuestTimer("unlock_anakim", time, null, null);
|
||||||
@@ -373,7 +372,7 @@ public class Anakim extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
case "check_activity_task":
|
case "check_activity_task":
|
||||||
{
|
{
|
||||||
if ((_lastAction + 900000) < Chronos.currentTimeMillis())
|
if ((_lastAction + 900000) < System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
GrandBossManager.getInstance().setBossStatus(ANAKIM, ALIVE);
|
GrandBossManager.getInstance().setBossStatus(ANAKIM, ALIVE);
|
||||||
for (Creature creature : BOSS_ZONE.getCharactersInside())
|
for (Creature creature : BOSS_ZONE.getCharactersInside())
|
||||||
@@ -550,7 +549,7 @@ public class Anakim extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
_remnants.clear();
|
_remnants.clear();
|
||||||
notifyEvent("spawn_remant", null, null);
|
notifyEvent("spawn_remant", null, null);
|
||||||
_lastAction = Chronos.currentTimeMillis();
|
_lastAction = System.currentTimeMillis();
|
||||||
startQuestTimer("check_activity_task", 60000, null, null, true);
|
startQuestTimer("check_activity_task", 60000, null, null, true);
|
||||||
}
|
}
|
||||||
else if ((_anakimStatus == WAITING) && (npc.getId() == ANAKIM_CUBIC))
|
else if ((_anakimStatus == WAITING) && (npc.getId() == ANAKIM_CUBIC))
|
||||||
@@ -578,7 +577,7 @@ public class Anakim extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isPet)
|
public String onAttack(Npc npc, Player attacker, int damage, boolean isPet)
|
||||||
{
|
{
|
||||||
_lastAction = Chronos.currentTimeMillis();
|
_lastAction = System.currentTimeMillis();
|
||||||
if (npc.isMinion() || npc.isRaid())// Anakim and minions
|
if (npc.isMinion() || npc.isRaid())// Anakim and minions
|
||||||
{
|
{
|
||||||
// Anti BUGGERS
|
// Anti BUGGERS
|
||||||
@@ -614,7 +613,7 @@ public class Anakim extends AbstractNpcAI
|
|||||||
GrandBossManager.getInstance().setBossStatus(ANAKIM, DEAD);
|
GrandBossManager.getInstance().setBossStatus(ANAKIM, DEAD);
|
||||||
final long respawnTime = getRespawnTime();
|
final long respawnTime = getRespawnTime();
|
||||||
final StatSet info = GrandBossManager.getInstance().getStatSet(ANAKIM);
|
final StatSet info = GrandBossManager.getInstance().getStatSet(ANAKIM);
|
||||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatSet(ANAKIM, info);
|
GrandBossManager.getInstance().setStatSet(ANAKIM, info);
|
||||||
|
|
||||||
startQuestTimer("unlock_anakim", respawnTime, null, null);
|
startQuestTimer("unlock_anakim", respawnTime, null, null);
|
||||||
@@ -686,7 +685,7 @@ public class Anakim extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
reenter = day2;
|
reenter = day2;
|
||||||
}
|
}
|
||||||
return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
|
return reenter.getTimeInMillis() - System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
|||||||
+6
-7
@@ -21,7 +21,6 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.enums.MountType;
|
import org.l2jmobius.gameserver.enums.MountType;
|
||||||
@@ -170,14 +169,14 @@ public class Antharas extends AbstractNpcAI
|
|||||||
_antharas = (GrandBoss) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
|
_antharas = (GrandBoss) addSpawn(ANTHARAS, loc_x, loc_y, loc_z, heading, false, 0);
|
||||||
_antharas.setCurrentHpMp(curr_hp, curr_mp);
|
_antharas.setCurrentHpMp(curr_hp, curr_mp);
|
||||||
addBoss(_antharas);
|
addBoss(_antharas);
|
||||||
_lastAttack = Chronos.currentTimeMillis();
|
_lastAttack = System.currentTimeMillis();
|
||||||
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
|
startQuestTimer("CHECK_ATTACK", 60000, _antharas, null);
|
||||||
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
|
startQuestTimer("SPAWN_MINION", 300000, _antharas, null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DEAD:
|
case DEAD:
|
||||||
{
|
{
|
||||||
final long remain = respawnTime - Chronos.currentTimeMillis();
|
final long remain = respawnTime - System.currentTimeMillis();
|
||||||
if (remain > 0)
|
if (remain > 0)
|
||||||
{
|
{
|
||||||
startQuestTimer("CLEAR_STATUS", remain, null, null);
|
startQuestTimer("CLEAR_STATUS", remain, null, null);
|
||||||
@@ -273,7 +272,7 @@ public class Antharas extends AbstractNpcAI
|
|||||||
_antharas.setRandomWalking(false);
|
_antharas.setRandomWalking(false);
|
||||||
_antharas.teleToLocation(181323, 114850, -7623, 32542);
|
_antharas.teleToLocation(181323, 114850, -7623, 32542);
|
||||||
setStatus(IN_FIGHT);
|
setStatus(IN_FIGHT);
|
||||||
_lastAttack = Chronos.currentTimeMillis();
|
_lastAttack = System.currentTimeMillis();
|
||||||
zone.broadcastPacket(new PlaySound("BS02_A"));
|
zone.broadcastPacket(new PlaySound("BS02_A"));
|
||||||
startQuestTimer("CAMERA_1", 23, _antharas, null);
|
startQuestTimer("CAMERA_1", 23, _antharas, null);
|
||||||
break;
|
break;
|
||||||
@@ -368,7 +367,7 @@ public class Antharas extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
case "CHECK_ATTACK":
|
case "CHECK_ATTACK":
|
||||||
{
|
{
|
||||||
if ((npc != null) && ((_lastAttack + 900000) < Chronos.currentTimeMillis()))
|
if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
|
||||||
{
|
{
|
||||||
setStatus(ALIVE);
|
setStatus(ALIVE);
|
||||||
for (Creature creature : zone.getCharactersInside())
|
for (Creature creature : zone.getCharactersInside())
|
||||||
@@ -620,7 +619,7 @@ public class Antharas extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
|
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
|
||||||
{
|
{
|
||||||
_lastAttack = Chronos.currentTimeMillis();
|
_lastAttack = System.currentTimeMillis();
|
||||||
if (npc.getId() == BOMBER)
|
if (npc.getId() == BOMBER)
|
||||||
{
|
{
|
||||||
if (npc.calculateDistance3D(attacker) < 230)
|
if (npc.calculateDistance3D(attacker) < 230)
|
||||||
@@ -766,7 +765,7 @@ public class Antharas extends AbstractNpcAI
|
|||||||
|
|
||||||
private void setRespawn(long respawnTime)
|
private void setRespawn(long respawnTime)
|
||||||
{
|
{
|
||||||
GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
GrandBossManager.getInstance().getStatSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void refreshAiParams(Player attacker, int damage)
|
private final void refreshAiParams(Player attacker, int damage)
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
package ai.bosses.Baium;
|
package ai.bosses.Baium;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
@@ -137,7 +136,7 @@ public class Baium extends AbstractNpcAI
|
|||||||
final int heading = info.getInt("heading");
|
final int heading = info.getInt("heading");
|
||||||
_baium = (GrandBoss) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
|
_baium = (GrandBoss) addSpawn(BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
|
||||||
_baium.setCurrentHpMp(curr_hp, curr_mp);
|
_baium.setCurrentHpMp(curr_hp, curr_mp);
|
||||||
_lastAttack = Chronos.currentTimeMillis();
|
_lastAttack = System.currentTimeMillis();
|
||||||
addBoss(_baium);
|
addBoss(_baium);
|
||||||
|
|
||||||
for (Location loc : ARCHANGEL_LOC)
|
for (Location loc : ARCHANGEL_LOC)
|
||||||
@@ -150,7 +149,7 @@ public class Baium extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
case DEAD:
|
case DEAD:
|
||||||
{
|
{
|
||||||
final long remain = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
final long remain = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
if (remain > 0)
|
if (remain > 0)
|
||||||
{
|
{
|
||||||
startQuestTimer("CLEAR_STATUS", remain, null, null);
|
startQuestTimer("CLEAR_STATUS", remain, null, null);
|
||||||
@@ -210,7 +209,7 @@ public class Baium extends AbstractNpcAI
|
|||||||
_baium.disableCoreAI(true);
|
_baium.disableCoreAI(true);
|
||||||
_baium.setRandomWalking(false);
|
_baium.setRandomWalking(false);
|
||||||
addBoss(_baium);
|
addBoss(_baium);
|
||||||
_lastAttack = Chronos.currentTimeMillis();
|
_lastAttack = System.currentTimeMillis();
|
||||||
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
|
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
|
||||||
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
|
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
|
||||||
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
|
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
|
||||||
@@ -376,7 +375,7 @@ public class Baium extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
case "CHECK_ATTACK":
|
case "CHECK_ATTACK":
|
||||||
{
|
{
|
||||||
if ((npc != null) && ((_lastAttack + 1800000) < Chronos.currentTimeMillis()))
|
if ((npc != null) && ((_lastAttack + 1800000) < System.currentTimeMillis()))
|
||||||
{
|
{
|
||||||
notifyEvent("CLEAR_ZONE", null, null);
|
notifyEvent("CLEAR_ZONE", null, null);
|
||||||
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
|
addSpawn(BAIUM_STONE, BAIUM_LOC, false, 0);
|
||||||
@@ -384,7 +383,7 @@ public class Baium extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (npc != null)
|
else if (npc != null)
|
||||||
{
|
{
|
||||||
if (((_lastAttack + 300000) < Chronos.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
|
if (((_lastAttack + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.75)))
|
||||||
{
|
{
|
||||||
npc.setTarget(npc);
|
npc.setTarget(npc);
|
||||||
npc.doCast(HEAL_OF_BAIUM.getSkill());
|
npc.doCast(HEAL_OF_BAIUM.getSkill());
|
||||||
@@ -485,7 +484,7 @@ public class Baium extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
|
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
|
||||||
{
|
{
|
||||||
_lastAttack = Chronos.currentTimeMillis();
|
_lastAttack = System.currentTimeMillis();
|
||||||
if (npc.getId() == BAIUM)
|
if (npc.getId() == BAIUM)
|
||||||
{
|
{
|
||||||
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
|
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
|
||||||
@@ -665,7 +664,7 @@ public class Baium extends AbstractNpcAI
|
|||||||
|
|
||||||
private void setRespawn(long respawnTime)
|
private void setRespawn(long respawnTime)
|
||||||
{
|
{
|
||||||
GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (Chronos.currentTimeMillis() + respawnTime));
|
GrandBossManager.getInstance().getStatSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void manageSkills(Npc npc)
|
private void manageSkills(Npc npc)
|
||||||
|
|||||||
+1
-2
@@ -18,7 +18,6 @@ package ai.bosses.Baylor;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
import org.l2jmobius.gameserver.model.Party;
|
import org.l2jmobius.gameserver.model.Party;
|
||||||
@@ -92,7 +91,7 @@ public class BaylorWarzone extends AbstractInstance
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
final List<Player> members = party.getMembers();
|
final List<Player> members = party.getMembers();
|
||||||
for (Player member : members)
|
for (Player member : members)
|
||||||
{
|
{
|
||||||
|
|||||||
+4
-5
@@ -20,7 +20,6 @@ import java.util.List;
|
|||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||||
@@ -109,7 +108,7 @@ public class Beleth extends AbstractNpcAI
|
|||||||
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
|
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
|
||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
final long time = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
if (time > 0)
|
if (time > 0)
|
||||||
{
|
{
|
||||||
startQuestTimer("BELETH_UNLOCK", time, null, null);
|
startQuestTimer("BELETH_UNLOCK", time, null, null);
|
||||||
@@ -350,7 +349,7 @@ public class Beleth extends AbstractNpcAI
|
|||||||
c.setImmobilized(false);
|
c.setImmobilized(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
_lastAttack = Chronos.currentTimeMillis();
|
_lastAttack = System.currentTimeMillis();
|
||||||
startQuestTimer("CHECK_ATTACK", 60000, null, null);
|
startQuestTimer("CHECK_ATTACK", 60000, null, null);
|
||||||
startQuestTimer("SPAWN25", 60000, null, null);
|
startQuestTimer("SPAWN25", 60000, null, null);
|
||||||
break;
|
break;
|
||||||
@@ -508,7 +507,7 @@ public class Beleth extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
case "CHECK_ATTACK":
|
case "CHECK_ATTACK":
|
||||||
{
|
{
|
||||||
if ((_lastAttack + 900000) < Chronos.currentTimeMillis())
|
if ((_lastAttack + 900000) < System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
|
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE);
|
||||||
for (Creature creature : ZONE.getCharactersInside())
|
for (Creature creature : ZONE.getCharactersInside())
|
||||||
@@ -709,7 +708,7 @@ public class Beleth extends AbstractNpcAI
|
|||||||
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
|
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
|
||||||
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
|
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);
|
final StatSet info = GrandBossManager.getInstance().getStatSet(REAL_BELETH);
|
||||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
|
GrandBossManager.getInstance().setStatSet(REAL_BELETH, info);
|
||||||
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
|
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
|
||||||
deleteAll();
|
deleteAll();
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import java.util.Map.Entry;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||||
@@ -88,7 +87,7 @@ public class Core extends AbstractNpcAI
|
|||||||
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
|
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
|
||||||
{
|
{
|
||||||
// Load the unlock date and time for Core from DB.
|
// Load the unlock date and time for Core from DB.
|
||||||
final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
final long temp = info.getLong("respawn_time") - System.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 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)
|
if (temp > 0)
|
||||||
{
|
{
|
||||||
@@ -205,7 +204,7 @@ public class Core extends AbstractNpcAI
|
|||||||
startQuestTimer("core_unlock", respawnTime, null, null);
|
startQuestTimer("core_unlock", respawnTime, null, null);
|
||||||
// Also save the respawn time so that the info is maintained past reboots.
|
// Also save the respawn time so that the info is maintained past reboots.
|
||||||
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
|
final StatSet info = GrandBossManager.getInstance().getStatSet(CORE);
|
||||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatSet(CORE, info);
|
GrandBossManager.getInstance().setStatSet(CORE, info);
|
||||||
startQuestTimer("despawn_minions", 20000, null, null);
|
startQuestTimer("despawn_minions", 20000, null, null);
|
||||||
cancelQuestTimers("spawn_minion");
|
cancelQuestTimers("spawn_minion");
|
||||||
|
|||||||
+2
-3
@@ -20,7 +20,6 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
import org.l2jmobius.gameserver.enums.MountType;
|
import org.l2jmobius.gameserver.enums.MountType;
|
||||||
@@ -296,7 +295,7 @@ public class IceQueensCastleBattle extends AbstractInstance
|
|||||||
{
|
{
|
||||||
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
|
startQuestTimer("STAGE_2_FAILED", 360000, controller, null);
|
||||||
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
|
manageTimer(world, 360, NpcStringId.BATTLE_END_LIMIT_TIME);
|
||||||
controller.getVariables().set("TIMER_END", Chronos.currentTimeMillis() + 360000);
|
controller.getVariables().set("TIMER_END", System.currentTimeMillis() + 360000);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -689,7 +688,7 @@ public class IceQueensCastleBattle extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "SHOW_GLAKIAS_TIMER":
|
case "SHOW_GLAKIAS_TIMER":
|
||||||
{
|
{
|
||||||
final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - Chronos.currentTimeMillis()) / 1000);
|
final int time = (int) ((controller.getVariables().getLong("TIMER_END", 0) - System.currentTimeMillis()) / 1000);
|
||||||
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
|
manageTimer(world, time, NpcStringId.BATTLE_END_LIMIT_TIME);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -23,7 +23,6 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
@@ -144,11 +143,11 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
|
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_CHARGE, 2);
|
||||||
}
|
}
|
||||||
else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
|
else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
|
||||||
{
|
{
|
||||||
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
|
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_FIELD, 1);
|
||||||
}
|
}
|
||||||
else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < Chronos.currentTimeMillis()) && (getRandom(100) < 10))
|
else if (((_lastRangedSkillTime + RANGED_SKILL_MIN_COOLTIME) < System.currentTimeMillis()) && (getRandom(100) < 10))
|
||||||
{
|
{
|
||||||
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
|
return SkillData.getInstance().getSkill(FRINTEZZA_DAEMON_MORPH, 1);
|
||||||
}
|
}
|
||||||
@@ -249,7 +248,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
|||||||
case FRINTEZZA_DAEMON_MORPH:
|
case FRINTEZZA_DAEMON_MORPH:
|
||||||
case FRINTEZZA_DAEMON_FIELD:
|
case FRINTEZZA_DAEMON_FIELD:
|
||||||
{
|
{
|
||||||
_lastRangedSkillTime = Chronos.currentTimeMillis();
|
_lastRangedSkillTime = System.currentTimeMillis();
|
||||||
skillRange = 550;
|
skillRange = 550;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-7
@@ -21,7 +21,6 @@ import java.util.Calendar;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
@@ -371,7 +370,7 @@ public class Lilith extends AbstractNpcAI
|
|||||||
final int status = GrandBossManager.getInstance().getBossStatus(LILITH);
|
final int status = GrandBossManager.getInstance().getBossStatus(LILITH);
|
||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
final long time = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
if (time > 0)
|
if (time > 0)
|
||||||
{
|
{
|
||||||
startQuestTimer("unlock_lilith", time, null, null);
|
startQuestTimer("unlock_lilith", time, null, null);
|
||||||
@@ -399,7 +398,7 @@ public class Lilith extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
case "check_activity_task":
|
case "check_activity_task":
|
||||||
{
|
{
|
||||||
if ((_lastAction + 900000) < Chronos.currentTimeMillis())
|
if ((_lastAction + 900000) < System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
GrandBossManager.getInstance().setBossStatus(LILITH, ALIVE);
|
GrandBossManager.getInstance().setBossStatus(LILITH, ALIVE);
|
||||||
for (Creature creature : BOSS_ZONE.getCharactersInside())
|
for (Creature creature : BOSS_ZONE.getCharactersInside())
|
||||||
@@ -576,7 +575,7 @@ public class Lilith extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
_remnants.clear();
|
_remnants.clear();
|
||||||
notifyEvent("spawn_remant", null, null);
|
notifyEvent("spawn_remant", null, null);
|
||||||
_lastAction = Chronos.currentTimeMillis();
|
_lastAction = System.currentTimeMillis();
|
||||||
startQuestTimer("check_activity_task", 60000, null, null, true);
|
startQuestTimer("check_activity_task", 60000, null, null, true);
|
||||||
}
|
}
|
||||||
else if ((_lilithStatus == WAITING) && (npc.getId() == LILITH_CUBIC))
|
else if ((_lilithStatus == WAITING) && (npc.getId() == LILITH_CUBIC))
|
||||||
@@ -594,7 +593,7 @@ public class Lilith extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isPet)
|
public String onAttack(Npc npc, Player attacker, int damage, boolean isPet)
|
||||||
{
|
{
|
||||||
_lastAction = Chronos.currentTimeMillis();
|
_lastAction = System.currentTimeMillis();
|
||||||
if (npc.isMinion() || npc.isRaid()) // Lilith and minions
|
if (npc.isMinion() || npc.isRaid()) // Lilith and minions
|
||||||
{
|
{
|
||||||
// Anti BUGGERS
|
// Anti BUGGERS
|
||||||
@@ -630,7 +629,7 @@ public class Lilith extends AbstractNpcAI
|
|||||||
GrandBossManager.getInstance().setBossStatus(LILITH, DEAD);
|
GrandBossManager.getInstance().setBossStatus(LILITH, DEAD);
|
||||||
final long respawnTime = getRespawnTime();
|
final long respawnTime = getRespawnTime();
|
||||||
final StatSet info = GrandBossManager.getInstance().getStatSet(LILITH);
|
final StatSet info = GrandBossManager.getInstance().getStatSet(LILITH);
|
||||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatSet(LILITH, info);
|
GrandBossManager.getInstance().setStatSet(LILITH, info);
|
||||||
|
|
||||||
startQuestTimer("unlock_lilith", respawnTime, null, null);
|
startQuestTimer("unlock_lilith", respawnTime, null, null);
|
||||||
@@ -702,7 +701,7 @@ public class Lilith extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
reenter = day2;
|
reenter = day2;
|
||||||
}
|
}
|
||||||
return reenter.getTimeInMillis() - Chronos.currentTimeMillis();
|
return reenter.getTimeInMillis() - System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
-3
@@ -22,7 +22,6 @@ import java.util.concurrent.ScheduledFuture;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.data.SpawnTable;
|
import org.l2jmobius.gameserver.data.SpawnTable;
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
@@ -227,7 +226,7 @@ public class Lindvior extends AbstractNpcAI
|
|||||||
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
|
final int status = GrandBossManager.getInstance().getBossStatus(LINDVIOR_RAID);
|
||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
final long time = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
if (time > 0)
|
if (time > 0)
|
||||||
{
|
{
|
||||||
startQuestTimer("unlock_lindvior", time, null, null);
|
startQuestTimer("unlock_lindvior", time, null, null);
|
||||||
@@ -855,7 +854,7 @@ public class Lindvior extends AbstractNpcAI
|
|||||||
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
|
GrandBossManager.getInstance().setBossStatus(LINDVIOR_RAID, DEAD);
|
||||||
final long respawnTime = (Config.LINDVIOR_SPAWN_INTERVAL + getRandom(-Config.LINDVIOR_SPAWN_RANDOM, Config.LINDVIOR_SPAWN_RANDOM)) * 3600000;
|
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);
|
final StatSet info = GrandBossManager.getInstance().getStatSet(LINDVIOR_RAID);
|
||||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
|
GrandBossManager.getInstance().setStatSet(LINDVIOR_RAID, info);
|
||||||
startQuestTimer("unlock_lindvior", respawnTime, null, null);
|
startQuestTimer("unlock_lindvior", respawnTime, null, null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import java.util.Set;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||||
@@ -98,7 +97,7 @@ public class Orfen extends AbstractNpcAI
|
|||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
// load the unlock date and time for Orfen from DB
|
// load the unlock date and time for Orfen from DB
|
||||||
final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
// if Orfen is locked until a certain time, mark it so and start the unlock timer
|
// if Orfen is locked until a certain time, mark it so and start the unlock timer
|
||||||
// the unlock time has not yet expired.
|
// the unlock time has not yet expired.
|
||||||
if (temp > 0)
|
if (temp > 0)
|
||||||
@@ -329,7 +328,7 @@ public class Orfen extends AbstractNpcAI
|
|||||||
startQuestTimer("orfen_unlock", respawnTime, null, null);
|
startQuestTimer("orfen_unlock", respawnTime, null, null);
|
||||||
// also save the respawn time so that the info is maintained past reboots
|
// also save the respawn time so that the info is maintained past reboots
|
||||||
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
|
final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN);
|
||||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatSet(ORFEN, info);
|
GrandBossManager.getInstance().setStatSet(ORFEN, info);
|
||||||
cancelQuestTimer("check_minion_loc", npc, null);
|
cancelQuestTimer("check_minion_loc", npc, null);
|
||||||
cancelQuestTimer("check_orfen_pos", npc, null);
|
cancelQuestTimer("check_orfen_pos", npc, null);
|
||||||
|
|||||||
+2
-3
@@ -20,7 +20,6 @@ import java.util.Set;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||||
@@ -97,7 +96,7 @@ public class QueenAnt extends AbstractNpcAI
|
|||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
// load the unlock date and time for queen ant from DB
|
// load the unlock date and time for queen ant from DB
|
||||||
final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
// if queen ant is locked until a certain time, mark it so and start the unlock timer
|
// if queen ant is locked until a certain time, mark it so and start the unlock timer
|
||||||
// the unlock time has not yet expired.
|
// the unlock time has not yet expired.
|
||||||
if (temp > 0)
|
if (temp > 0)
|
||||||
@@ -368,7 +367,7 @@ public class QueenAnt extends AbstractNpcAI
|
|||||||
cancelQuestTimer("heal", null, null);
|
cancelQuestTimer("heal", null, null);
|
||||||
// also save the respawn time so that the info is maintained past reboots
|
// also save the respawn time so that the info is maintained past reboots
|
||||||
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
|
final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN);
|
||||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatSet(QUEEN, info);
|
GrandBossManager.getInstance().setStatSet(QUEEN, info);
|
||||||
_nurses.clear();
|
_nurses.clear();
|
||||||
if (_larva != null)
|
if (_larva != null)
|
||||||
|
|||||||
+2
-3
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package ai.bosses.QueenShyeed;
|
package ai.bosses.QueenShyeed;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||||
@@ -88,7 +87,7 @@ public class QueenShyeed extends AbstractNpcAI
|
|||||||
private void spawnShyeed()
|
private void spawnShyeed()
|
||||||
{
|
{
|
||||||
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
|
final long respawn = GlobalVariablesManager.getInstance().getLong("QueenShyeedRespawn", 0);
|
||||||
final long remain = respawn != 0 ? respawn - Chronos.currentTimeMillis() : 0;
|
final long remain = respawn != 0 ? respawn - System.currentTimeMillis() : 0;
|
||||||
if (remain > 0)
|
if (remain > 0)
|
||||||
{
|
{
|
||||||
startQuestTimer("respawn", remain, null, null);
|
startQuestTimer("respawn", remain, null, null);
|
||||||
@@ -104,7 +103,7 @@ public class QueenShyeed extends AbstractNpcAI
|
|||||||
private void startRespawn()
|
private void startRespawn()
|
||||||
{
|
{
|
||||||
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
|
final int respawnTime = RESPAWN - getRandom(RANDOM_RESPAWN);
|
||||||
GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(Chronos.currentTimeMillis() + respawnTime));
|
GlobalVariablesManager.getInstance().set("QueenShyeedRespawn", Long.toString(System.currentTimeMillis() + respawnTime));
|
||||||
startQuestTimer("respawn", respawnTime, null, null);
|
startQuestTimer("respawn", respawnTime, null, null);
|
||||||
// MOB_BUFF_ZONE.setEnabled(false);
|
// MOB_BUFF_ZONE.setEnabled(false);
|
||||||
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
|
MOB_BUFF_DISPLAY_ZONE.setEnabled(false);
|
||||||
|
|||||||
+5
-6
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package ai.bosses.Sailren;
|
package ai.bosses.Sailren;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||||
@@ -72,7 +71,7 @@ public class Sailren extends AbstractNpcAI
|
|||||||
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
|
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
|
||||||
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
|
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
|
||||||
|
|
||||||
final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - Chronos.currentTimeMillis();
|
final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
|
||||||
if (remain > 0)
|
if (remain > 0)
|
||||||
{
|
{
|
||||||
STATUS = Status.DEAD;
|
STATUS = Status.DEAD;
|
||||||
@@ -119,7 +118,7 @@ public class Sailren extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
takeItems(player, GAZKH, 1);
|
takeItems(player, GAZKH, 1);
|
||||||
STATUS = Status.IN_FIGHT;
|
STATUS = Status.IN_FIGHT;
|
||||||
_lastAttack = Chronos.currentTimeMillis();
|
_lastAttack = System.currentTimeMillis();
|
||||||
for (Player member : player.getParty().getMembers())
|
for (Player member : player.getParty().getMembers())
|
||||||
{
|
{
|
||||||
if (member.isInsideRadius3D(npc, 1000))
|
if (member.isInsideRadius3D(npc, 1000))
|
||||||
@@ -238,7 +237,7 @@ public class Sailren extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
case "CHECK_ATTACK":
|
case "CHECK_ATTACK":
|
||||||
{
|
{
|
||||||
if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < Chronos.currentTimeMillis()))
|
if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
|
||||||
{
|
{
|
||||||
cancelQuestTimer("TIME_OUT", null, null);
|
cancelQuestTimer("TIME_OUT", null, null);
|
||||||
notifyEvent("TIME_OUT", null, null);
|
notifyEvent("TIME_OUT", null, null);
|
||||||
@@ -258,7 +257,7 @@ public class Sailren extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (zone.isCharacterInZone(attacker))
|
if (zone.isCharacterInZone(attacker))
|
||||||
{
|
{
|
||||||
_lastAttack = Chronos.currentTimeMillis();
|
_lastAttack = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
return super.onAttack(npc, attacker, damage, isSummon);
|
return super.onAttack(npc, attacker, damage, isSummon);
|
||||||
}
|
}
|
||||||
@@ -275,7 +274,7 @@ public class Sailren extends AbstractNpcAI
|
|||||||
STATUS = Status.DEAD;
|
STATUS = Status.DEAD;
|
||||||
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
|
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
|
||||||
final long respawnTime = RESPAWN * 3600000;
|
final long respawnTime = RESPAWN * 3600000;
|
||||||
GlobalVariablesManager.getInstance().set("SailrenRespawn", Chronos.currentTimeMillis() + respawnTime);
|
GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
|
||||||
cancelQuestTimer("CHECK_ATTACK", null, null);
|
cancelQuestTimer("CHECK_ATTACK", null, null);
|
||||||
cancelQuestTimer("TIME_OUT", null, null);
|
cancelQuestTimer("TIME_OUT", null, null);
|
||||||
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
||||||
|
|||||||
+2
-3
@@ -21,7 +21,6 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.SpawnTable;
|
import org.l2jmobius.gameserver.data.SpawnTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||||
import org.l2jmobius.gameserver.enums.Movie;
|
import org.l2jmobius.gameserver.enums.Movie;
|
||||||
@@ -328,7 +327,7 @@ public class Trasken extends AbstractNpcAI
|
|||||||
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
|
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
|
||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
final long time = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
final long time = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
if (time > 0)
|
if (time > 0)
|
||||||
{
|
{
|
||||||
startQuestTimer("unlock_trasken", time, null, null);
|
startQuestTimer("unlock_trasken", time, null, null);
|
||||||
@@ -608,7 +607,7 @@ public class Trasken extends AbstractNpcAI
|
|||||||
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
|
GrandBossManager.getInstance().setBossStatus(TRASKEN, DEAD);
|
||||||
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
|
final long respawnTime = (Config.TRASKEN_SPAWN_INTERVAL + getRandom(-Config.TRASKEN_SPAWN_RANDOM, Config.TRASKEN_SPAWN_RANDOM)) * 3600000;
|
||||||
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
|
final StatSet info = GrandBossManager.getInstance().getStatSet(TRASKEN);
|
||||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
|
GrandBossManager.getInstance().setStatSet(TRASKEN, info);
|
||||||
startQuestTimer("unlock_trasken", respawnTime, null, null);
|
startQuestTimer("unlock_trasken", respawnTime, null, null);
|
||||||
break;
|
break;
|
||||||
|
|||||||
+6
-7
@@ -20,7 +20,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.enums.MountType;
|
import org.l2jmobius.gameserver.enums.MountType;
|
||||||
@@ -130,7 +129,7 @@ public class Valakas extends AbstractNpcAI
|
|||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
// load the unlock date and time for valakas from DB
|
// load the unlock date and time for valakas from DB
|
||||||
final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis();
|
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
if (temp > 0)
|
if (temp > 0)
|
||||||
{
|
{
|
||||||
// The time has not yet expired. Mark Valakas as currently locked (dead).
|
// The time has not yet expired. Mark Valakas as currently locked (dead).
|
||||||
@@ -169,7 +168,7 @@ public class Valakas extends AbstractNpcAI
|
|||||||
if (status == FIGHTING)
|
if (status == FIGHTING)
|
||||||
{
|
{
|
||||||
// stores current time for inactivity task.
|
// stores current time for inactivity task.
|
||||||
_timeTracker = Chronos.currentTimeMillis();
|
_timeTracker = System.currentTimeMillis();
|
||||||
|
|
||||||
startQuestTimer("regen_task", 60000, valakas, null, true);
|
startQuestTimer("regen_task", 60000, valakas, null, true);
|
||||||
startQuestTimer("skill_task", 2000, valakas, null, true);
|
startQuestTimer("skill_task", 2000, valakas, null, true);
|
||||||
@@ -197,7 +196,7 @@ public class Valakas extends AbstractNpcAI
|
|||||||
if (event.equalsIgnoreCase("beginning"))
|
if (event.equalsIgnoreCase("beginning"))
|
||||||
{
|
{
|
||||||
// Stores current time
|
// Stores current time
|
||||||
_timeTracker = Chronos.currentTimeMillis();
|
_timeTracker = System.currentTimeMillis();
|
||||||
|
|
||||||
// Teleport Valakas to his lair.
|
// Teleport Valakas to his lair.
|
||||||
npc.teleToLocation(VALAKAS_LAIR);
|
npc.teleToLocation(VALAKAS_LAIR);
|
||||||
@@ -221,7 +220,7 @@ public class Valakas extends AbstractNpcAI
|
|||||||
else if (event.equalsIgnoreCase("regen_task"))
|
else if (event.equalsIgnoreCase("regen_task"))
|
||||||
{
|
{
|
||||||
// Inactivity task - 15min
|
// Inactivity task - 15min
|
||||||
if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < Chronos.currentTimeMillis()))
|
if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
|
||||||
{
|
{
|
||||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||||
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
|
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
|
||||||
@@ -417,7 +416,7 @@ public class Valakas extends AbstractNpcAI
|
|||||||
npc.setTarget(attacker);
|
npc.setTarget(attacker);
|
||||||
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
|
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
|
||||||
}
|
}
|
||||||
_timeTracker = Chronos.currentTimeMillis();
|
_timeTracker = System.currentTimeMillis();
|
||||||
|
|
||||||
return super.onAttack(npc, attacker, damage, isSummon);
|
return super.onAttack(npc, attacker, damage, isSummon);
|
||||||
}
|
}
|
||||||
@@ -448,7 +447,7 @@ public class Valakas extends AbstractNpcAI
|
|||||||
startQuestTimer("valakas_unlock", respawnTime, null, null);
|
startQuestTimer("valakas_unlock", respawnTime, null, null);
|
||||||
// also save the respawn time so that the info is maintained past reboots
|
// also save the respawn time so that the info is maintained past reboots
|
||||||
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
|
final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS);
|
||||||
info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
|
GrandBossManager.getInstance().setStatSet(VALAKAS, info);
|
||||||
|
|
||||||
return super.onKill(npc, killer, isSummon);
|
return super.onKill(npc, killer, isSummon);
|
||||||
|
|||||||
Vendored
+4
-5
@@ -26,7 +26,6 @@ import java.util.Optional;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
||||||
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
|
import org.l2jmobius.gameserver.instancemanager.ClanHallAuctionManager;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
@@ -155,7 +154,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
|
|||||||
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
|
htmltext = htmltext.replace("%id%", String.valueOf(clanHallAuction.getClanHallId()));
|
||||||
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
|
htmltext = htmltext.replace("%minBid%", String.valueOf(clanHallAuction.getHighestBid()));
|
||||||
htmltext = htmltext.replace("%myBid%", String.valueOf(clanHallAuction.getClanBid(clan)));
|
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(Chronos.currentTimeMillis() + ClanHallAuctionManager.getInstance().getRemainingTime()).atZone(ZoneId.systemDefault())));
|
htmltext = htmltext.replace("%auctionEnd%", builder.appendPattern("dd/MM/yyyy HH").appendLiteral(" hour ").appendPattern("mm").appendLiteral(" minutes").toFormatter().format(Instant.ofEpochMilli(System.currentTimeMillis() + ClanHallAuctionManager.getInstance().getRemainingTime()).atZone(ZoneId.systemDefault())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -191,7 +190,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
|
|||||||
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
|
final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(clanHallAuction.getClanHallId());
|
||||||
final Clan owner = clanHall.getOwner();
|
final Clan owner = clanHall.getOwner();
|
||||||
final long remainingTime = ClanHallAuctionManager.getInstance().getRemainingTime();
|
final long remainingTime = ClanHallAuctionManager.getInstance().getRemainingTime();
|
||||||
final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
|
final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
|
||||||
|
|
||||||
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
|
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
|
||||||
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
|
htmltext = getHtm(player, "ClanHallAuctioneer-bidInfo.html");
|
||||||
@@ -249,7 +248,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
|
|||||||
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
|
final ClanHallAuction clanHallAuction = ClanHallAuctionManager.getInstance().getClanHallAuctionById(clanHallId);
|
||||||
final Clan owner = clanHall.getOwner();
|
final Clan owner = clanHall.getOwner();
|
||||||
final long remainingTime = ClanHallAuctionManager.getInstance().getRemainingTime();
|
final long remainingTime = ClanHallAuctionManager.getInstance().getRemainingTime();
|
||||||
final Instant endTime = Instant.ofEpochMilli(Chronos.currentTimeMillis() + remainingTime);
|
final Instant endTime = Instant.ofEpochMilli(System.currentTimeMillis() + remainingTime);
|
||||||
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
|
final DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
|
||||||
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||||
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
|
html.setHtml(getHtm(player, "ClanHallAuctioneer-info.html"));
|
||||||
@@ -298,7 +297,7 @@ public class ClanHallAuctioneer extends AbstractNpcAI
|
|||||||
sb.append("\"><font color=\"ffffaa\">&%");
|
sb.append("\"><font color=\"ffffaa\">&%");
|
||||||
sb.append(clanHall.getResidenceId());
|
sb.append(clanHall.getResidenceId());
|
||||||
sb.append(";[0]</font></a></td><td width=50>");
|
sb.append(";[0]</font></a></td><td width=50>");
|
||||||
sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(Chronos.currentTimeMillis() + ClanHallAuctionManager.getInstance().getRemainingTime()).atZone(ZoneId.systemDefault())));
|
sb.append(DateTimeFormatter.ofPattern("dd/MM/yyyy").format(Instant.ofEpochMilli(System.currentTimeMillis() + ClanHallAuctionManager.getInstance().getRemainingTime()).atZone(ZoneId.systemDefault())));
|
||||||
sb.append("</td><td width=70 align=right><font color=\"aaffff\">");
|
sb.append("</td><td width=70 align=right><font color=\"aaffff\">");
|
||||||
sb.append(auction.getHighestBid());
|
sb.append(auction.getHighestBid());
|
||||||
sb.append("</font></td></tr>");
|
sb.append("</font></td></tr>");
|
||||||
|
|||||||
Vendored
+4
-5
@@ -21,7 +21,6 @@ import java.util.LinkedHashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
@@ -74,7 +73,7 @@ public class ProvisionalHalls extends AbstractNpcAI
|
|||||||
if (resetTime > 0)
|
if (resetTime > 0)
|
||||||
{
|
{
|
||||||
cancelQuestTimers(HALL_RESET_VAR + id);
|
cancelQuestTimers(HALL_RESET_VAR + id);
|
||||||
startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (Chronos.currentTimeMillis() - resetTime) - 30000)), null, null);
|
startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,7 +126,7 @@ public class ProvisionalHalls extends AbstractNpcAI
|
|||||||
|
|
||||||
for (int id : CLAN_HALLS.keySet())
|
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) < Chronos.currentTimeMillis()))
|
if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
|
||||||
{
|
{
|
||||||
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
|
player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
|
||||||
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
|
GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
|
||||||
@@ -138,7 +137,7 @@ public class ProvisionalHalls extends AbstractNpcAI
|
|||||||
clanHall.setOwner(player.getClan());
|
clanHall.setOwner(player.getClan());
|
||||||
}
|
}
|
||||||
player.sendMessage("Congratulations! You now own a provisional clan hall!");
|
player.sendMessage("Congratulations! You now own a provisional clan hall!");
|
||||||
startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (Chronos.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
|
startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,7 +177,7 @@ public class ProvisionalHalls extends AbstractNpcAI
|
|||||||
else if (event.startsWith(HALL_RESET_VAR))
|
else if (event.startsWith(HALL_RESET_VAR))
|
||||||
{
|
{
|
||||||
final String id = event.replace(HALL_RESET_VAR, "");
|
final String id = event.replace(HALL_RESET_VAR, "");
|
||||||
if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= Chronos.currentTimeMillis())
|
if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
|
final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
|
||||||
if (clanId > 0)
|
if (clanId > 0)
|
||||||
|
|||||||
+2
-3
@@ -19,7 +19,6 @@ package ai.others.TrainingCamp;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
@@ -111,7 +110,7 @@ public class TrainingCamp extends AbstractNpcAI
|
|||||||
player.teleToLocation(TRAINING_LOCATION);
|
player.teleToLocation(TRAINING_LOCATION);
|
||||||
player.setImmobilized(true);
|
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.
|
// @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(), Chronos.currentTimeMillis(), -1));
|
player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
|
||||||
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
|
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
|
||||||
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
|
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0, timeRemaining));
|
||||||
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
|
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
|
||||||
@@ -203,7 +202,7 @@ public class TrainingCamp extends AbstractNpcAI
|
|||||||
final TrainingHolder holder = player.getTraingCampInfo();
|
final TrainingHolder holder = player.getTraingCampInfo();
|
||||||
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
|
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
|
||||||
{
|
{
|
||||||
holder.setEndTime(Chronos.currentTimeMillis());
|
holder.setEndTime(System.currentTimeMillis());
|
||||||
player.setTraingCampInfo(holder);
|
player.setTraingCampInfo(holder);
|
||||||
player.enableAllSkills();
|
player.enableAllSkills();
|
||||||
player.setInvul(false);
|
player.setInvul(false);
|
||||||
|
|||||||
+1
-1
@@ -136,7 +136,7 @@ public class TvT extends Event
|
|||||||
// calendar.set(Calendar.HOUR_OF_DAY, 20);
|
// calendar.set(Calendar.HOUR_OF_DAY, 20);
|
||||||
// calendar.set(Calendar.MINUTE, 0);
|
// calendar.set(Calendar.MINUTE, 0);
|
||||||
// calendar.set(Calendar.SECOND, 0);
|
// calendar.set(Calendar.SECOND, 0);
|
||||||
// ThreadPool.scheduleAtFixedRate(() -> eventStart(null), calendar.getTimeInMillis() - Chronos.currentTimeMillis(), 86400000); // 86400000 = 1 day
|
// ThreadPool.scheduleAtFixedRate(() -> eventStart(null), calendar.getTimeInMillis() - System.currentTimeMillis(), 86400000); // 86400000 = 1 day
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Vendored
+1
-2
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package events.FreyaCelebration;
|
package events.FreyaCelebration;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
@@ -80,7 +79,7 @@ public class FreyaCelebration extends LongTimeEvent
|
|||||||
{
|
{
|
||||||
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
|
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
|
||||||
{
|
{
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
|
final long reuseTime = player.getVariables().getLong(RESET_VAR, 0);
|
||||||
if (currentTime > reuseTime)
|
if (currentTime > reuseTime)
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-4
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package events.GiftOfVitality;
|
package events.GiftOfVitality;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||||
@@ -95,9 +94,9 @@ public class GiftOfVitality extends LongTimeEvent
|
|||||||
case "vitality":
|
case "vitality":
|
||||||
{
|
{
|
||||||
final long reuse = player.getVariables().getLong(REUSE, 0);
|
final long reuse = player.getVariables().getLong(REUSE, 0);
|
||||||
if (reuse > Chronos.currentTimeMillis())
|
if (reuse > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
|
final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
|
||||||
final int hours = (int) (remainingTime / 3600);
|
final int hours = (int) (remainingTime / 3600);
|
||||||
final int minutes = (int) ((remainingTime % 3600) / 60);
|
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);
|
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
|
||||||
@@ -111,7 +110,7 @@ public class GiftOfVitality extends LongTimeEvent
|
|||||||
{
|
{
|
||||||
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
|
SkillCaster.triggerCast(player, player, GIFT_OF_VITALITY.getSkill());
|
||||||
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
|
SkillCaster.triggerCast(player, player, JOY_OF_VITALITY.getSkill());
|
||||||
player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
|
player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
|
||||||
htmltext = "4306-okvitality.htm";
|
htmltext = "4306-okvitality.htm";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Vendored
+3
-4
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package events.LoveYourGatekeeper;
|
package events.LoveYourGatekeeper;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||||
@@ -59,9 +58,9 @@ public class LoveYourGatekeeper extends LongTimeEvent
|
|||||||
if (player.getAdena() >= PRICE)
|
if (player.getAdena() >= PRICE)
|
||||||
{
|
{
|
||||||
final long reuse = player.getVariables().getLong(REUSE, 0);
|
final long reuse = player.getVariables().getLong(REUSE, 0);
|
||||||
if (reuse > Chronos.currentTimeMillis())
|
if (reuse > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
final long remainingTime = (reuse - Chronos.currentTimeMillis()) / 1000;
|
final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
|
||||||
final int hours = (int) (remainingTime / 3600);
|
final int hours = (int) (remainingTime / 3600);
|
||||||
final int minutes = (int) ((remainingTime % 3600) / 60);
|
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);
|
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
|
||||||
@@ -74,7 +73,7 @@ public class LoveYourGatekeeper extends LongTimeEvent
|
|||||||
{
|
{
|
||||||
takeItems(player, Inventory.ADENA_ID, PRICE);
|
takeItems(player, Inventory.ADENA_ID, PRICE);
|
||||||
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
|
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
|
||||||
player.getVariables().set(REUSE, Chronos.currentTimeMillis() + (HOURS * 3600000));
|
player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Vendored
+3
-4
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package events.MasterOfEnchanting;
|
package events.MasterOfEnchanting;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
@@ -87,7 +86,7 @@ public class MasterOfEnchanting extends LongTimeEvent
|
|||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("buy_scroll_24"))
|
else if (event.equalsIgnoreCase("buy_scroll_24"))
|
||||||
{
|
{
|
||||||
final long curTime = Chronos.currentTimeMillis();
|
final long curTime = System.currentTimeMillis();
|
||||||
final String value = player.getVariables().getString("MasterOfEnchanting", "");
|
final String value = player.getVariables().getString("MasterOfEnchanting", "");
|
||||||
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
|
final long reuse = value.equals("") ? 0 : Long.parseLong(value);
|
||||||
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
|
if (player.getCreateDate().after(getEventPeriod().getStartDate()))
|
||||||
@@ -101,7 +100,7 @@ public class MasterOfEnchanting extends LongTimeEvent
|
|||||||
{
|
{
|
||||||
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
|
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
|
||||||
giveItems(player, MASTER_YOGI_SCROLL, 24);
|
giveItems(player, MASTER_YOGI_SCROLL, 24);
|
||||||
player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
|
player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
|
||||||
htmltext = "32599-scroll24.htm";
|
htmltext = "32599-scroll24.htm";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -135,7 +134,7 @@ public class MasterOfEnchanting extends LongTimeEvent
|
|||||||
{
|
{
|
||||||
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
|
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
|
||||||
giveItems(player, MASTER_YOGI_SCROLL, 24);
|
giveItems(player, MASTER_YOGI_SCROLL, 24);
|
||||||
player.getVariables().set("MasterOfEnchanting", Long.toString(Chronos.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
|
player.getVariables().set("MasterOfEnchanting", Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
|
||||||
htmltext = "32599-scroll24.htm";
|
htmltext = "32599-scroll24.htm";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
+5
-6
@@ -22,7 +22,6 @@ import java.util.Map;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
import org.l2jmobius.gameserver.data.ItemTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
@@ -326,7 +325,7 @@ public class SavingSanta extends LongTimeEvent
|
|||||||
{
|
{
|
||||||
if (_rewardedPlayers.containsKey(pl.getAccountName()))
|
if (_rewardedPlayers.containsKey(pl.getAccountName()))
|
||||||
{
|
{
|
||||||
final long elapsedTimeSinceLastRewarded = Chronos.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
|
final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
|
||||||
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
|
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -335,7 +334,7 @@ public class SavingSanta extends LongTimeEvent
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
|
final long time = player.getVariables().getLong("LAST_SANTA_REWARD", 0);
|
||||||
if ((Chronos.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
|
if ((System.currentTimeMillis() - time) < MIN_TIME_BETWEEN_2_REWARDS)
|
||||||
{
|
{
|
||||||
_rewardedPlayers.put(pl.getAccountName(), time);
|
_rewardedPlayers.put(pl.getAccountName(), time);
|
||||||
continue;
|
continue;
|
||||||
@@ -345,8 +344,8 @@ public class SavingSanta extends LongTimeEvent
|
|||||||
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
|
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 int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
|
||||||
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
|
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
|
||||||
_rewardedPlayers.put(pl.getAccountName(), Chronos.currentTimeMillis());
|
_rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
|
||||||
player.getVariables().set("LAST_SANTA_REWARD", Chronos.currentTimeMillis());
|
player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
|
||||||
startQuestTimer("SantaRewarding0", 500, santa, pl);
|
startQuestTimer("SantaRewarding0", 500, santa, pl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -439,7 +438,7 @@ public class SavingSanta extends LongTimeEvent
|
|||||||
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
|
else if (event.equalsIgnoreCase("SantaBlessings") && SANTAS_HELPER_AUTOBUFF)
|
||||||
{
|
{
|
||||||
startQuestTimer("SantaBlessings", 15000, null, null);
|
startQuestTimer("SantaBlessings", 15000, null, null);
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
for (Npc santaHelper1 : _santaHelpers)
|
for (Npc santaHelper1 : _santaHelpers)
|
||||||
{
|
{
|
||||||
for (Player plb : World.getInstance().getVisibleObjects(santaHelper1, Player.class))
|
for (Player plb : World.getInstance().getVisibleObjects(santaHelper1, Player.class))
|
||||||
|
|||||||
L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminCursedWeapons.java
Vendored
+1
-2
@@ -19,7 +19,6 @@ package handlers.admincommandhandlers;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
|
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
|
||||||
import org.l2jmobius.gameserver.model.CursedWeapon;
|
import org.l2jmobius.gameserver.model.CursedWeapon;
|
||||||
@@ -210,7 +209,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
|
activeChar.addItem("AdminCursedWeaponAdd", id, 1, activeChar, true);
|
||||||
}
|
}
|
||||||
cw.setEndTime(Chronos.currentTimeMillis() + (cw.getDuration() * 60000));
|
cw.setEndTime(System.currentTimeMillis() + (cw.getDuration() * 60000));
|
||||||
cw.reActivate();
|
cw.reActivate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-2
@@ -19,7 +19,6 @@ package handlers.admincommandhandlers;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
|
import org.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -67,7 +66,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
|
|||||||
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
|
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
|
||||||
{
|
{
|
||||||
final Calendar nextChangeDate = Calendar.getInstance();
|
final Calendar nextChangeDate = Calendar.getInstance();
|
||||||
nextChangeDate.setTimeInMillis(Chronos.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
|
nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
|
||||||
html.replace("%sodtime%", nextChangeDate.getTime().toString());
|
html.replace("%sodtime%", nextChangeDate.getTime().toString());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Vendored
+1
-2
@@ -20,7 +20,6 @@ import java.util.Map;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
@@ -119,7 +118,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
|
|||||||
int hours = 0;
|
int hours = 0;
|
||||||
int minutes = 0;
|
int minutes = 0;
|
||||||
final int id = entry.getKey();
|
final int id = entry.getKey();
|
||||||
final long remainingTime = (entry.getValue() - Chronos.currentTimeMillis()) / 1000;
|
final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
|
||||||
if (remainingTime > 0)
|
if (remainingTime > 0)
|
||||||
{
|
{
|
||||||
hours = (int) (remainingTime / 3600);
|
hours = (int) (remainingTime / 3600);
|
||||||
|
|||||||
Vendored
+1
-2
@@ -24,7 +24,6 @@ import java.util.StringTokenizer;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||||
@@ -237,7 +236,7 @@ public class AdminPunishment implements IAdminCommandHandler
|
|||||||
long expirationTime = Integer.parseInt(exp);
|
long expirationTime = Integer.parseInt(exp);
|
||||||
if (expirationTime > 0)
|
if (expirationTime > 0)
|
||||||
{
|
{
|
||||||
expirationTime = Chronos.currentTimeMillis() + (expirationTime * 60 * 1000);
|
expirationTime = System.currentTimeMillis() + (expirationTime * 60 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
final PunishmentAffect affect = PunishmentAffect.getByName(af);
|
final PunishmentAffect affect = PunishmentAffect.getByName(af);
|
||||||
|
|||||||
Vendored
+2
-3
@@ -29,7 +29,6 @@ import java.util.Set;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.GameServer;
|
import org.l2jmobius.gameserver.GameServer;
|
||||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
import org.l2jmobius.gameserver.data.xml.AdminData;
|
import org.l2jmobius.gameserver.data.xml.AdminData;
|
||||||
@@ -74,7 +73,7 @@ public class AdminServerInfo implements IAdminCommandHandler
|
|||||||
html.replace("%gameTime%", GameTimeTaskManager.getInstance().getGameHour() + ":" + GameTimeTaskManager.getInstance().getGameMinute());
|
html.replace("%gameTime%", GameTimeTaskManager.getInstance().getGameHour() + ":" + GameTimeTaskManager.getInstance().getGameMinute());
|
||||||
html.replace("%dayNight%", GameTimeTaskManager.getInstance().isNight() ? "Night" : "Day");
|
html.replace("%dayNight%", GameTimeTaskManager.getInstance().isNight() ? "Night" : "Day");
|
||||||
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
|
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
|
||||||
html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
|
html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
|
||||||
html.replace("%serverUpTime%", getServerUpTime());
|
html.replace("%serverUpTime%", getServerUpTime());
|
||||||
html.replace("%onlineAll%", getPlayersCount("ALL"));
|
html.replace("%onlineAll%", getPlayersCount("ALL"));
|
||||||
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
|
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
|
||||||
@@ -101,7 +100,7 @@ public class AdminServerInfo implements IAdminCommandHandler
|
|||||||
|
|
||||||
private String getServerUpTime()
|
private String getServerUpTime()
|
||||||
{
|
{
|
||||||
long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
|
long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
|
||||||
|
|
||||||
final long days = TimeUnit.MILLISECONDS.toDays(time);
|
final long days = TimeUnit.MILLISECONDS.toDays(time);
|
||||||
time -= TimeUnit.DAYS.toMillis(days);
|
time -= TimeUnit.DAYS.toMillis(days);
|
||||||
|
|||||||
+1
-2
@@ -21,7 +21,6 @@ import java.util.Map;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
import org.l2jmobius.gameserver.handler.IBypassHandler;
|
import org.l2jmobius.gameserver.handler.IBypassHandler;
|
||||||
@@ -134,7 +133,7 @@ public class FindPvP implements IBypassHandler
|
|||||||
player.setSpawnProtection(true);
|
player.setSpawnProtection(true);
|
||||||
if (!player.isGM())
|
if (!player.isGM())
|
||||||
{
|
{
|
||||||
player.setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
|
player.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
|
||||||
player.startPvPFlag();
|
player.startPvPFlag();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-2
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.punishmenthandlers;
|
package handlers.punishmenthandlers;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.LoginServerThread;
|
import org.l2jmobius.gameserver.LoginServerThread;
|
||||||
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
|
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
@@ -153,7 +152,7 @@ public class ChatBanHandler implements IPunishmentHandler
|
|||||||
*/
|
*/
|
||||||
private void applyToPlayer(PunishmentTask task, Player player)
|
private void applyToPlayer(PunishmentTask task, Player player)
|
||||||
{
|
{
|
||||||
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
|
final long delay = (task.getExpirationTime() - System.currentTimeMillis()) / 1000;
|
||||||
if (delay > 0)
|
if (delay > 0)
|
||||||
{
|
{
|
||||||
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
|
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
|
||||||
|
|||||||
Vendored
+1
-2
@@ -17,7 +17,6 @@
|
|||||||
package handlers.punishmenthandlers;
|
package handlers.punishmenthandlers;
|
||||||
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.LoginServerThread;
|
import org.l2jmobius.gameserver.LoginServerThread;
|
||||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
|
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
|
||||||
@@ -207,7 +206,7 @@ public class JailHandler implements IPunishmentHandler
|
|||||||
player.sendPacket(msg);
|
player.sendPacket(msg);
|
||||||
if (task != null)
|
if (task != null)
|
||||||
{
|
{
|
||||||
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
|
final long delay = (task.getExpirationTime() - System.currentTimeMillis()) / 1000;
|
||||||
if (delay > 0)
|
if (delay > 0)
|
||||||
{
|
{
|
||||||
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
|
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));
|
||||||
|
|||||||
+1
-2
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.telnethandlers.player;
|
package handlers.telnethandlers.player;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||||
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
||||||
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
||||||
@@ -66,7 +65,7 @@ public class Ban implements ITelnetCommand
|
|||||||
if (Util.isDigit(token))
|
if (Util.isDigit(token))
|
||||||
{
|
{
|
||||||
time = Integer.parseInt(token) * 60 * 1000;
|
time = Integer.parseInt(token) * 60 * 1000;
|
||||||
time += Chronos.currentTimeMillis();
|
time += System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
if (args.length > 2)
|
if (args.length > 2)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-2
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.telnethandlers.player;
|
package handlers.telnethandlers.player;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||||
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
||||||
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
||||||
@@ -66,7 +65,7 @@ public class BanChat implements ITelnetCommand
|
|||||||
if (Util.isDigit(token))
|
if (Util.isDigit(token))
|
||||||
{
|
{
|
||||||
time = Integer.parseInt(token) * 60 * 1000;
|
time = Integer.parseInt(token) * 60 * 1000;
|
||||||
time += Chronos.currentTimeMillis();
|
time += System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
if (args.length > 2)
|
if (args.length > 2)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-2
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.telnethandlers.player;
|
package handlers.telnethandlers.player;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||||
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
||||||
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
||||||
@@ -66,7 +65,7 @@ public class Jail implements ITelnetCommand
|
|||||||
if (Util.isDigit(token))
|
if (Util.isDigit(token))
|
||||||
{
|
{
|
||||||
time = Integer.parseInt(token) * 60 * 1000;
|
time = Integer.parseInt(token) * 60 * 1000;
|
||||||
time += Chronos.currentTimeMillis();
|
time += System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
if (args.length > 2)
|
if (args.length > 2)
|
||||||
{
|
{
|
||||||
|
|||||||
Vendored
+3
-4
@@ -18,7 +18,6 @@ package handlers.usercommandhandlers;
|
|||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||||
@@ -47,7 +46,7 @@ public class ClanPenalty implements IUserCommandHandler
|
|||||||
final StringBuilder htmlContent = new StringBuilder(500);
|
final StringBuilder htmlContent = new StringBuilder(500);
|
||||||
htmlContent.append("<html><body><center><table width=270 border=0 bgcolor=111111><tr><td width=170>Penalty</td><td width=100 align=center>Expiration Date</td></tr></table><table width=270 border=0><tr>");
|
htmlContent.append("<html><body><center><table width=270 border=0 bgcolor=111111><tr><td width=170>Penalty</td><td width=100 align=center>Expiration Date</td></tr></table><table width=270 border=0><tr>");
|
||||||
|
|
||||||
if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
|
if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
htmlContent.append("<td width=170>Unable to join a clan.</td><td width=100 align=center>");
|
htmlContent.append("<td width=170>Unable to join a clan.</td><td width=100 align=center>");
|
||||||
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
|
htmlContent.append(format.format(player.getClanJoinExpiryTime()));
|
||||||
@@ -55,7 +54,7 @@ public class ClanPenalty implements IUserCommandHandler
|
|||||||
penalty = true;
|
penalty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
|
if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
htmlContent.append("<td width=170>Unable to create a clan.</td><td width=100 align=center>");
|
htmlContent.append("<td width=170>Unable to create a clan.</td><td width=100 align=center>");
|
||||||
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
|
htmlContent.append(format.format(player.getClanCreateExpiryTime()));
|
||||||
@@ -63,7 +62,7 @@ public class ClanPenalty implements IUserCommandHandler
|
|||||||
penalty = true;
|
penalty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
|
if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
|
||||||
{
|
{
|
||||||
htmlContent.append("<td width=170>Unable to invite a clan member.</td><td width=100 align=center>");
|
htmlContent.append("<td width=170>Unable to invite a clan member.</td><td width=100 align=center>");
|
||||||
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
|
htmlContent.append(format.format(player.getClan().getCharPenaltyExpiryTime()));
|
||||||
|
|||||||
+1
-2
@@ -20,7 +20,6 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
@@ -75,7 +74,7 @@ public class Time implements IUserCommandHandler
|
|||||||
player.sendPacket(sm);
|
player.sendPacket(sm);
|
||||||
if (Config.DISPLAY_SERVER_TIME)
|
if (Config.DISPLAY_SERVER_TIME)
|
||||||
{
|
{
|
||||||
player.sendMessage("Server time is " + SDF.format(new Date(Chronos.currentTimeMillis())));
|
player.sendMessage("Server time is " + SDF.format(new Date(System.currentTimeMillis())));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-2
@@ -18,7 +18,6 @@ package handlers.voicedcommandhandlers;
|
|||||||
|
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.AdminData;
|
import org.l2jmobius.gameserver.data.xml.AdminData;
|
||||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
||||||
@@ -104,7 +103,7 @@ public class ChatAdmin implements IVoicedCommandHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, Chronos.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
|
PunishmentManager.getInstance().startPunishment(new PunishmentTask(objId, PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN, System.currentTimeMillis() + (expirationTime * 1000 * 60), "Chat banned by moderator", activeChar.getName()));
|
||||||
if (expirationTime > 0)
|
if (expirationTime > 0)
|
||||||
{
|
{
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
|
BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " chat banned for " + expirationTime + " minutes.");
|
||||||
|
|||||||
+1
-2
@@ -19,7 +19,6 @@ package handlers.voicedcommandhandlers;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
||||||
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
|
import org.l2jmobius.gameserver.instancemanager.PremiumManager;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -75,7 +74,7 @@ public class Premium implements IVoicedCommandHandler
|
|||||||
html.append("<tr><td>Spoil Chance: <font color=\"LEVEL\">x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " <br1></font></td></tr>");
|
html.append("<tr><td>Spoil Chance: <font color=\"LEVEL\">x" + (Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " <br1></font></td></tr>");
|
||||||
html.append("<tr><td>Spoil Amount: <font color=\"LEVEL\">x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " <br1></font></td></tr>");
|
html.append("<tr><td>Spoil Amount: <font color=\"LEVEL\">x" + (Config.RATE_SPOIL_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " <br1></font></td></tr>");
|
||||||
html.append("<tr><td>Expires: <font color=\"00A5FF\">" + format.format(endDate) + "</font></td></tr>");
|
html.append("<tr><td>Expires: <font color=\"00A5FF\">" + format.format(endDate) + "</font></td></tr>");
|
||||||
html.append("<tr><td>Current Date: <font color=\"70FFCA\">" + format.format(Chronos.currentTimeMillis()) + "<br><br></font></td></tr>");
|
html.append("<tr><td>Current Date: <font color=\"70FFCA\">" + format.format(System.currentTimeMillis()) + "<br><br></font></td></tr>");
|
||||||
html.append("<tr><td><center>Premium Info & Rules<br></center></td></tr>");
|
html.append("<tr><td><center>Premium Info & Rules<br></center></td></tr>");
|
||||||
html.append("<tr><td><font color=\"70FFCA\">1. Premium accounts CAN NOT BE TRANSFERED.<br1></font></td></tr>");
|
html.append("<tr><td><font color=\"70FFCA\">1. Premium accounts CAN NOT BE TRANSFERED.<br1></font></td></tr>");
|
||||||
html.append("<tr><td><font color=\"70FFCA\">2. Premium does not effect party members.<br1></font></td></tr>");
|
html.append("<tr><td><font color=\"70FFCA\">2. Premium does not effect party members.<br1></font></td></tr>");
|
||||||
|
|||||||
+2
-3
@@ -24,7 +24,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.gameserver.enums.QuestSound;
|
import org.l2jmobius.gameserver.enums.QuestSound;
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
@@ -157,7 +156,7 @@ public class CastleDungeon extends AbstractInstance
|
|||||||
public void onInstanceCreated(Instance instance, Player player)
|
public void onInstanceCreated(Instance instance, Player player)
|
||||||
{
|
{
|
||||||
// Put re-enter for instance
|
// Put re-enter for instance
|
||||||
REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
|
REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
|
||||||
// Schedule spawn of first raid
|
// Schedule spawn of first raid
|
||||||
spawnRaid(instance);
|
spawnRaid(instance);
|
||||||
}
|
}
|
||||||
@@ -175,7 +174,7 @@ public class CastleDungeon extends AbstractInstance
|
|||||||
else if (REENETER_HOLDER.containsKey(template.getId()))
|
else if (REENETER_HOLDER.containsKey(template.getId()))
|
||||||
{
|
{
|
||||||
final long time = REENETER_HOLDER.get(template.getId());
|
final long time = REENETER_HOLDER.get(template.getId());
|
||||||
if (time > Chronos.currentTimeMillis())
|
if (time > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
showHtmlFile(groupLeader, "enterRestricted.html");
|
showHtmlFile(groupLeader, "enterRestricted.html");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Vendored
+1
-2
@@ -28,7 +28,6 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
|
import org.l2jmobius.gameserver.enums.CeremonyOfChaosResult;
|
||||||
import org.l2jmobius.gameserver.enums.PartyMessageType;
|
import org.l2jmobius.gameserver.enums.PartyMessageType;
|
||||||
@@ -118,7 +117,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
|||||||
|
|
||||||
private CeremonyOfChaos()
|
private CeremonyOfChaos()
|
||||||
{
|
{
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
|
|
||||||
// Schedule event period end, 1st of next month 00:01.
|
// Schedule event period end, 1st of next month 00:01.
|
||||||
final Calendar periodEnd = Calendar.getInstance();
|
final Calendar periodEnd = Calendar.getInstance();
|
||||||
|
|||||||
Vendored
+2
-3
@@ -24,7 +24,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.gameserver.enums.QuestSound;
|
import org.l2jmobius.gameserver.enums.QuestSound;
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
@@ -170,7 +169,7 @@ public class FortressDungeon extends AbstractInstance
|
|||||||
public void onInstanceCreated(Instance instance, Player player)
|
public void onInstanceCreated(Instance instance, Player player)
|
||||||
{
|
{
|
||||||
// Put re-enter for instance
|
// Put re-enter for instance
|
||||||
REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
|
REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
|
||||||
// Schedule spawn of first raid
|
// Schedule spawn of first raid
|
||||||
spawnRaid(instance);
|
spawnRaid(instance);
|
||||||
}
|
}
|
||||||
@@ -198,7 +197,7 @@ public class FortressDungeon extends AbstractInstance
|
|||||||
else if (REENETER_HOLDER.containsKey(template.getId()))
|
else if (REENETER_HOLDER.containsKey(template.getId()))
|
||||||
{
|
{
|
||||||
final long time = REENETER_HOLDER.get(template.getId());
|
final long time = REENETER_HOLDER.get(template.getId());
|
||||||
if (time > Chronos.currentTimeMillis())
|
if (time > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
showHtmlFile(groupLeader, "enterRestricted.html");
|
showHtmlFile(groupLeader, "enterRestricted.html");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+1
-2
@@ -24,7 +24,6 @@ import java.util.Map;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
@@ -470,7 +469,7 @@ public class Kamaloka extends AbstractInstance
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if found instance still can't be reentered - exit
|
// if found instance still can't be reentered - exit
|
||||||
if (Chronos.currentTimeMillis() < entry.getValue().longValue())
|
if (System.currentTimeMillis() < entry.getValue().longValue())
|
||||||
{
|
{
|
||||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||||
sm.addPcName(partyMember);
|
sm.addPcName(partyMember);
|
||||||
|
|||||||
Vendored
+1
-2
@@ -20,7 +20,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||||
import org.l2jmobius.gameserver.model.Party;
|
import org.l2jmobius.gameserver.model.Party;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
@@ -89,7 +88,7 @@ public class NightmareKamaloka extends AbstractInstance
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
final List<Player> members = party.getMembers();
|
final List<Player> members = party.getMembers();
|
||||||
for (Player member : members)
|
for (Player member : members)
|
||||||
{
|
{
|
||||||
|
|||||||
Vendored
+3
-4
@@ -22,7 +22,6 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpc;
|
import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpc;
|
||||||
@@ -261,7 +260,7 @@ public class PailakaRuneCastle extends AbstractInstance
|
|||||||
public void onInstanceCreated(Instance instance, Player player)
|
public void onInstanceCreated(Instance instance, Player player)
|
||||||
{
|
{
|
||||||
// Put re-enter for instance
|
// Put re-enter for instance
|
||||||
REENETER_HOLDER.put(instance.getTemplateId(), Chronos.currentTimeMillis() + REENTER);
|
REENETER_HOLDER.put(instance.getTemplateId(), System.currentTimeMillis() + REENTER);
|
||||||
// Schedule spawn of first wave
|
// Schedule spawn of first wave
|
||||||
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
|
startQuestTimer("SPAWN_NEXT_WAVE", 120000, null, player, false); // 2 minutes
|
||||||
}
|
}
|
||||||
@@ -281,7 +280,7 @@ public class PailakaRuneCastle extends AbstractInstance
|
|||||||
else if (REENETER_HOLDER.containsKey(template.getId()))
|
else if (REENETER_HOLDER.containsKey(template.getId()))
|
||||||
{
|
{
|
||||||
final long time = REENETER_HOLDER.get(template.getId());
|
final long time = REENETER_HOLDER.get(template.getId());
|
||||||
if (time > Chronos.currentTimeMillis())
|
if (time > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
showHtmlFile(groupLeader, "enterRestricted.html");
|
showHtmlFile(groupLeader, "enterRestricted.html");
|
||||||
return false;
|
return false;
|
||||||
@@ -310,7 +309,7 @@ public class PailakaRuneCastle extends AbstractInstance
|
|||||||
else if (REENETER_HOLDER.containsKey(template.getId()))
|
else if (REENETER_HOLDER.containsKey(template.getId()))
|
||||||
{
|
{
|
||||||
final long time = REENETER_HOLDER.get(template.getId());
|
final long time = REENETER_HOLDER.get(template.getId());
|
||||||
if (time > Chronos.currentTimeMillis())
|
if (time > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
showHtmlFile(groupLeader, "enterRestricted.html");
|
showHtmlFile(groupLeader, "enterRestricted.html");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+2
-3
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package quests.Q00307_ControlDeviceOfTheGiants;
|
package quests.Q00307_ControlDeviceOfTheGiants;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.enums.QuestSound;
|
import org.l2jmobius.gameserver.enums.QuestSound;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
@@ -102,7 +101,7 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
|
|||||||
{
|
{
|
||||||
return "32711-09.html";
|
return "32711-09.html";
|
||||||
}
|
}
|
||||||
if ((GlobalVariablesManager.getInstance().getLong("GiantsControlDeviceRespawn", 0) - Chronos.currentTimeMillis()) > 0)
|
if ((GlobalVariablesManager.getInstance().getLong("GiantsControlDeviceRespawn", 0) - System.currentTimeMillis()) > 0)
|
||||||
{
|
{
|
||||||
return "32711-09a.html";
|
return "32711-09a.html";
|
||||||
}
|
}
|
||||||
@@ -169,7 +168,7 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
|
|||||||
qst.setCond(2, true);
|
qst.setCond(2, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GlobalVariablesManager.getInstance().set("GiantsControlDeviceRespawn", Long.toString(Chronos.currentTimeMillis() + RESPAWN_DELAY));
|
GlobalVariablesManager.getInstance().set("GiantsControlDeviceRespawn", Long.toString(System.currentTimeMillis() + RESPAWN_DELAY));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.<br>
|
|
||||||
* 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.<br>
|
|
||||||
* <br>
|
|
||||||
* 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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -32,7 +32,6 @@ import org.l2jmobius.Config;
|
|||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.enums.ServerMode;
|
import org.l2jmobius.commons.enums.ServerMode;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.DeadLockDetector;
|
import org.l2jmobius.commons.util.DeadLockDetector;
|
||||||
import org.l2jmobius.commons.util.PropertiesParser;
|
import org.l2jmobius.commons.util.PropertiesParser;
|
||||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
@@ -179,7 +178,7 @@ public class GameServer
|
|||||||
|
|
||||||
public GameServer() throws Exception
|
public GameServer() throws Exception
|
||||||
{
|
{
|
||||||
final long serverLoadStart = Chronos.currentTimeMillis();
|
final long serverLoadStart = System.currentTimeMillis();
|
||||||
|
|
||||||
// GUI
|
// GUI
|
||||||
final PropertiesParser interfaceConfig = new PropertiesParser(Config.INTERFACE_CONFIG_FILE);
|
final PropertiesParser interfaceConfig = new PropertiesParser(Config.INTERFACE_CONFIG_FILE);
|
||||||
@@ -455,7 +454,7 @@ public class GameServer
|
|||||||
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
|
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
|
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() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
|
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
|
||||||
|
|
||||||
ClientNetworkManager.getInstance().start();
|
ClientNetworkManager.getInstance().start();
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import org.l2jmobius.Config;
|
|||||||
import org.l2jmobius.commons.database.DatabaseBackup;
|
import org.l2jmobius.commons.database.DatabaseBackup;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.BotReportTable;
|
import org.l2jmobius.gameserver.data.BotReportTable;
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
|
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
|
||||||
@@ -532,19 +531,19 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
public void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = System.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return System.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import java.util.concurrent.TimeUnit;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.enums.ItemLocation;
|
import org.l2jmobius.gameserver.enums.ItemLocation;
|
||||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||||
@@ -313,7 +312,7 @@ public class CreatureAI extends AbstractAI
|
|||||||
|
|
||||||
if (_actor.isAttackingNow())
|
if (_actor.isAttackingNow())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new CastTask(_actor, skill, target, item, forceUse, dontMove), _actor.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(Chronos.currentTimeMillis()));
|
ThreadPool.schedule(new CastTask(_actor, skill, target, item, forceUse, dontMove), _actor.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-3
@@ -22,7 +22,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -40,7 +39,7 @@ public class WarehouseCacheManager
|
|||||||
|
|
||||||
public void addCacheTask(Player pc)
|
public void addCacheTask(Player pc)
|
||||||
{
|
{
|
||||||
CACHED_WH.put(pc, Chronos.currentTimeMillis());
|
CACHED_WH.put(pc, System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remCacheTask(Player pc)
|
public void remCacheTask(Player pc)
|
||||||
@@ -57,7 +56,7 @@ public class WarehouseCacheManager
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
final long cTime = Chronos.currentTimeMillis();
|
final long cTime = System.currentTimeMillis();
|
||||||
for (Entry<Player, Long> entry : CACHED_WH.entrySet())
|
for (Entry<Player, Long> entry : CACHED_WH.entrySet())
|
||||||
{
|
{
|
||||||
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
|
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import org.xml.sax.helpers.DefaultHandler;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
@@ -125,7 +124,7 @@ public class BotReportTable
|
|||||||
final Calendar c = Calendar.getInstance();
|
final Calendar c = Calendar.getInstance();
|
||||||
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
|
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
|
||||||
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
|
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
|
||||||
if (Chronos.currentTimeMillis() < c.getTimeInMillis())
|
if (System.currentTimeMillis() < c.getTimeInMillis())
|
||||||
{
|
{
|
||||||
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
|
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
|
||||||
}
|
}
|
||||||
@@ -291,7 +290,7 @@ public class BotReportTable
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
|
final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
|
||||||
if (reuse < Config.BOTREPORT_REPORT_DELAY)
|
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);
|
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
|
||||||
@@ -302,7 +301,7 @@ public class BotReportTable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final long curTime = Chronos.currentTimeMillis();
|
final long curTime = System.currentTimeMillis();
|
||||||
if (rcd == null)
|
if (rcd == null)
|
||||||
{
|
{
|
||||||
rcd = new ReportedCharData();
|
rcd = new ReportedCharData();
|
||||||
@@ -419,12 +418,12 @@ public class BotReportTable
|
|||||||
final Calendar c = Calendar.getInstance();
|
final Calendar c = Calendar.getInstance();
|
||||||
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
|
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
|
||||||
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
|
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
|
||||||
if (Chronos.currentTimeMillis() > c.getTimeInMillis())
|
if (System.currentTimeMillis() > c.getTimeInMillis())
|
||||||
{
|
{
|
||||||
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
|
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - Chronos.currentTimeMillis());
|
ThreadPool.schedule(new ResetPointTask(), c.getTimeInMillis() - System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -465,7 +464,7 @@ public class BotReportTable
|
|||||||
{
|
{
|
||||||
if (map.containsKey(objectId))
|
if (map.containsKey(objectId))
|
||||||
{
|
{
|
||||||
return (Chronos.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
|
return (System.currentTimeMillis() - map.get(objectId)) > Config.BOTREPORT_REPORT_DELAY;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
||||||
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
||||||
import org.l2jmobius.gameserver.enums.ClanWarState;
|
import org.l2jmobius.gameserver.enums.ClanWarState;
|
||||||
@@ -171,7 +170,7 @@ public class ClanTable
|
|||||||
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
|
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (Chronos.currentTimeMillis() < player.getClanCreateExpiryTime())
|
if (System.currentTimeMillis() < player.getClanCreateExpiryTime())
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
|
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_DAYS_BEFORE_CREATING_A_NEW_CLAN);
|
||||||
return null;
|
return null;
|
||||||
@@ -343,7 +342,7 @@ public class ClanTable
|
|||||||
{
|
{
|
||||||
destroyClan(clanId);
|
destroyClan(clanId);
|
||||||
}
|
}
|
||||||
}, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
|
}, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAllyExists(String allyName)
|
public boolean isAllyExists(String allyName)
|
||||||
|
|||||||
+1
-2
@@ -26,7 +26,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.enums.PrivateStoreType;
|
import org.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||||
import org.l2jmobius.gameserver.model.ManufactureItem;
|
import org.l2jmobius.gameserver.model.ManufactureItem;
|
||||||
import org.l2jmobius.gameserver.model.TradeItem;
|
import org.l2jmobius.gameserver.model.TradeItem;
|
||||||
@@ -185,7 +184,7 @@ public class OfflineTraderTable
|
|||||||
final Calendar cal = Calendar.getInstance();
|
final Calendar cal = Calendar.getInstance();
|
||||||
cal.setTimeInMillis(time);
|
cal.setTimeInMillis(time);
|
||||||
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
|
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
|
||||||
if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
|
if (cal.getTimeInMillis() <= System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -23,7 +23,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.xml.AdminData;
|
import org.l2jmobius.gameserver.data.xml.AdminData;
|
||||||
import org.l2jmobius.gameserver.enums.PlayerAction;
|
import org.l2jmobius.gameserver.enums.PlayerAction;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
@@ -116,7 +115,7 @@ public class AdminCommandHandler implements IHandler<IAdminCommandHandler, Strin
|
|||||||
// Admin Commands must run through a long running task, otherwise a command that takes too much time will freeze the server, this way you'll feel only a minor spike.
|
// Admin Commands must run through a long running task, otherwise a command that takes too much time will freeze the server, this way you'll feel only a minor spike.
|
||||||
ThreadPool.execute(() ->
|
ThreadPool.execute(() ->
|
||||||
{
|
{
|
||||||
final long begin = Chronos.currentTimeMillis();
|
final long begin = System.currentTimeMillis();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Config.GMAUDIT)
|
if (Config.GMAUDIT)
|
||||||
@@ -134,7 +133,7 @@ public class AdminCommandHandler implements IHandler<IAdminCommandHandler, Strin
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
final long runtime = Chronos.currentTimeMillis() - begin;
|
final long runtime = System.currentTimeMillis() - begin;
|
||||||
if (runtime > 5000)
|
if (runtime > 5000)
|
||||||
{
|
{
|
||||||
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
|
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
|
||||||
|
|||||||
+2
-3
@@ -22,7 +22,6 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -49,7 +48,7 @@ public class AntiFeedManager
|
|||||||
*/
|
*/
|
||||||
public void setLastDeathTime(int objectId)
|
public void setLastDeathTime(int objectId)
|
||||||
{
|
{
|
||||||
_lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
|
_lastDeathTimes.put(objectId, System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,7 +81,7 @@ public class AntiFeedManager
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((Chronos.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
|
if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()) && ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -42,7 +42,6 @@ import org.w3c.dom.Node;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.IXmlReader;
|
import org.l2jmobius.commons.util.IXmlReader;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.enums.ManorMode;
|
import org.l2jmobius.gameserver.enums.ManorMode;
|
||||||
@@ -278,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Schedule mode change
|
// Schedule mode change
|
||||||
ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
|
ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeMode()
|
public void changeMode()
|
||||||
|
|||||||
+1
-2
@@ -25,7 +25,6 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.residences.ClanHallAuction;
|
import org.l2jmobius.gameserver.model.residences.ClanHallAuction;
|
||||||
@@ -42,7 +41,7 @@ public class ClanHallAuctionManager
|
|||||||
|
|
||||||
protected ClanHallAuctionManager()
|
protected ClanHallAuctionManager()
|
||||||
{
|
{
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
|
|
||||||
// Schedule of the start, next Wednesday at 19:00.
|
// Schedule of the start, next Wednesday at 19:00.
|
||||||
final Calendar start = Calendar.getInstance();
|
final Calendar start = Calendar.getInstance();
|
||||||
|
|||||||
+1
-2
@@ -35,7 +35,6 @@ import org.w3c.dom.Node;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.IXmlReader;
|
import org.l2jmobius.commons.util.IXmlReader;
|
||||||
import org.l2jmobius.gameserver.model.CursedWeapon;
|
import org.l2jmobius.gameserver.model.CursedWeapon;
|
||||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||||
@@ -314,7 +313,7 @@ public class CursedWeaponsManager implements IXmlReader
|
|||||||
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING);
|
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING);
|
||||||
sm.addString(cw.getName());
|
sm.addString(cw.getName());
|
||||||
// sm.addItemName(cw.getItemId());
|
// sm.addItemName(cw.getItemId());
|
||||||
sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
|
sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
|
||||||
player.sendPacket(sm);
|
player.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -32,7 +32,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.data.SpawnTable;
|
import org.l2jmobius.gameserver.data.SpawnTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||||
@@ -215,7 +214,7 @@ public class DBSpawnManager
|
|||||||
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
|
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 respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
|
||||||
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
|
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
|
||||||
final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
|
final long respawnTime = System.currentTimeMillis() + respawnDelay;
|
||||||
info.set("currentHP", npc.getMaxHp());
|
info.set("currentHP", npc.getMaxHp());
|
||||||
info.set("currentMP", npc.getMaxMp());
|
info.set("currentMP", npc.getMaxMp());
|
||||||
info.set("respawnTime", respawnTime);
|
info.set("respawnTime", respawnTime);
|
||||||
@@ -257,7 +256,7 @@ public class DBSpawnManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int npcId = spawn.getId();
|
final int npcId = spawn.getId();
|
||||||
final long time = Chronos.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
SpawnTable.getInstance().addNewSpawn(spawn, false);
|
SpawnTable.getInstance().addNewSpawn(spawn, false);
|
||||||
if ((respawnTime == 0) || (time > respawnTime))
|
if ((respawnTime == 0) || (time > respawnTime))
|
||||||
{
|
{
|
||||||
@@ -279,7 +278,7 @@ public class DBSpawnManager
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final long spawnTime = respawnTime - Chronos.currentTimeMillis();
|
final long spawnTime = respawnTime - System.currentTimeMillis();
|
||||||
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
|
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -27,7 +27,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
@@ -60,7 +59,7 @@ public class DailyTaskManager
|
|||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
// Schedule reset everyday at 6:30.
|
// Schedule reset everyday at 6:30.
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
final Calendar calendar = Calendar.getInstance();
|
final Calendar calendar = Calendar.getInstance();
|
||||||
calendar.set(Calendar.HOUR_OF_DAY, 6);
|
calendar.set(Calendar.HOUR_OF_DAY, 6);
|
||||||
calendar.set(Calendar.MINUTE, 30);
|
calendar.set(Calendar.MINUTE, 30);
|
||||||
@@ -93,7 +92,7 @@ public class DailyTaskManager
|
|||||||
private void onReset()
|
private void onReset()
|
||||||
{
|
{
|
||||||
// Store last reset time.
|
// Store last reset time.
|
||||||
GlobalVariablesManager.getInstance().set(GlobalVariablesManager.DAILY_TASK_RESET, Chronos.currentTimeMillis());
|
GlobalVariablesManager.getInstance().set(GlobalVariablesManager.DAILY_TASK_RESET, System.currentTimeMillis());
|
||||||
|
|
||||||
// Wednesday weekly tasks.
|
// Wednesday weekly tasks.
|
||||||
if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY)
|
if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY)
|
||||||
|
|||||||
+3
-4
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
|
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
|
||||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||||
|
|
||||||
@@ -105,7 +104,7 @@ public class GraciaSeedsManager
|
|||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
// Conquest Complete state, if too much time is passed than change to defense state
|
// Conquest Complete state, if too much time is passed than change to defense state
|
||||||
final long timePast = Chronos.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
|
final long timePast = System.currentTimeMillis() - _SoDLastStateChangeDate.getTimeInMillis();
|
||||||
if (timePast >= Config.SOD_STAGE_2_LENGTH)
|
if (timePast >= Config.SOD_STAGE_2_LENGTH)
|
||||||
{
|
{
|
||||||
// change to Attack state because Defend statet is not implemented
|
// change to Attack state because Defend statet is not implemented
|
||||||
@@ -173,7 +172,7 @@ public class GraciaSeedsManager
|
|||||||
public void setSoDState(int value, boolean doSave)
|
public void setSoDState(int value, boolean doSave)
|
||||||
{
|
{
|
||||||
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
|
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
|
||||||
_SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
|
_SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
|
||||||
_SoDState = value;
|
_SoDState = value;
|
||||||
// reset number of Tiat kills
|
// reset number of Tiat kills
|
||||||
if (_SoDState == 1)
|
if (_SoDState == 1)
|
||||||
@@ -199,7 +198,7 @@ public class GraciaSeedsManager
|
|||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
|
return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-4
@@ -30,7 +30,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.util.PrimeFinder;
|
import org.l2jmobius.gameserver.util.PrimeFinder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,7 +85,7 @@ public class IdManager
|
|||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
Statement statement = con.createStatement())
|
Statement statement = con.createStatement())
|
||||||
{
|
{
|
||||||
final long cleanupStart = Chronos.currentTimeMillis();
|
final long cleanupStart = System.currentTimeMillis();
|
||||||
int cleanCount = 0;
|
int cleanCount = 0;
|
||||||
|
|
||||||
// Characters
|
// Characters
|
||||||
@@ -158,7 +157,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 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);");
|
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 " + ((Chronos.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
|
LOGGER.info("IdManager: Cleaned " + cleanCount + " elements from database in " + ((System.currentTimeMillis() - cleanupStart) / 1000) + " seconds.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -174,7 +173,7 @@ public class IdManager
|
|||||||
{
|
{
|
||||||
try (PreparedStatement statement = con.prepareStatement(line))
|
try (PreparedStatement statement = con.prepareStatement(line))
|
||||||
{
|
{
|
||||||
statement.setLong(1, Chronos.currentTimeMillis());
|
statement.setLong(1, System.currentTimeMillis());
|
||||||
cleanCount += statement.executeUpdate();
|
cleanCount += statement.executeUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -40,7 +40,6 @@ import org.w3c.dom.Node;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.IXmlReader;
|
import org.l2jmobius.commons.util.IXmlReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||||
import org.l2jmobius.gameserver.data.xml.SpawnData;
|
import org.l2jmobius.gameserver.data.xml.SpawnData;
|
||||||
@@ -521,7 +520,7 @@ public class InstanceManager implements IXmlReader
|
|||||||
{
|
{
|
||||||
// Check if instance penalty passed
|
// Check if instance penalty passed
|
||||||
final long time = rs.getLong("time");
|
final long time = rs.getLong("time");
|
||||||
if (time > Chronos.currentTimeMillis())
|
if (time > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
// Load params
|
// Load params
|
||||||
final int charId = rs.getInt("charId");
|
final int charId = rs.getInt("charId");
|
||||||
@@ -556,7 +555,7 @@ public class InstanceManager implements IXmlReader
|
|||||||
final List<Integer> invalidPenalty = new ArrayList<>(instanceTimes.size());
|
final List<Integer> invalidPenalty = new ArrayList<>(instanceTimes.size());
|
||||||
for (Entry<Integer, Long> entry : instanceTimes.entrySet())
|
for (Entry<Integer, Long> entry : instanceTimes.entrySet())
|
||||||
{
|
{
|
||||||
if (entry.getValue() <= Chronos.currentTimeMillis())
|
if (entry.getValue() <= System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
invalidPenalty.add(entry.getKey());
|
invalidPenalty.add(entry.getKey());
|
||||||
}
|
}
|
||||||
@@ -615,7 +614,7 @@ public class InstanceManager implements IXmlReader
|
|||||||
|
|
||||||
// If reenter time is higher then current, delete it
|
// If reenter time is higher then current, delete it
|
||||||
final long time = playerData.get(id);
|
final long time = playerData.get(id);
|
||||||
if (time <= Chronos.currentTimeMillis())
|
if (time <= System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
deleteInstanceTime(player, id);
|
deleteInstanceTime(player, id);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
+1
-2
@@ -29,7 +29,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.taskmanager.ItemsAutoDestroyTaskManager;
|
import org.l2jmobius.gameserver.taskmanager.ItemsAutoDestroyTaskManager;
|
||||||
@@ -84,7 +83,7 @@ public class ItemsOnGroundManager implements Runnable
|
|||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement ps = con.prepareStatement(str))
|
PreparedStatement ps = con.prepareStatement(str))
|
||||||
{
|
{
|
||||||
ps.setLong(1, Chronos.currentTimeMillis());
|
ps.setLong(1, System.currentTimeMillis());
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|||||||
+1
-2
@@ -29,7 +29,6 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.Mentee;
|
import org.l2jmobius.gameserver.model.Mentee;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -146,7 +145,7 @@ public class MentorManager
|
|||||||
{
|
{
|
||||||
final Player player = World.getInstance().getPlayer(mentorId);
|
final Player player = World.getInstance().getPlayer(mentorId);
|
||||||
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
|
final PlayerVariables vars = player != null ? player.getVariables() : new PlayerVariables(mentorId);
|
||||||
vars.set("Mentor-Penalty-" + mentorId, String.valueOf(Chronos.currentTimeMillis() + penalty));
|
vars.set("Mentor-Penalty-" + mentorId, String.valueOf(System.currentTimeMillis() + penalty));
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getMentorPenalty(int mentorId)
|
public long getMentorPenalty(int mentorId)
|
||||||
|
|||||||
+2
-3
@@ -29,7 +29,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.events.Containers;
|
import org.l2jmobius.gameserver.model.events.Containers;
|
||||||
@@ -80,7 +79,7 @@ public class PremiumManager
|
|||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
final String accountName = player.getAccountName();
|
final String accountName = player.getAccountName();
|
||||||
loadPremiumData(accountName);
|
loadPremiumData(accountName);
|
||||||
final long now = Chronos.currentTimeMillis();
|
final long now = System.currentTimeMillis();
|
||||||
final long premiumExpiration = getPremiumExpiration(accountName);
|
final long premiumExpiration = getPremiumExpiration(accountName);
|
||||||
player.setPremiumStatus(premiumExpiration > now);
|
player.setPremiumStatus(premiumExpiration > now);
|
||||||
if (player.hasPremiumStatus())
|
if (player.hasPremiumStatus())
|
||||||
@@ -154,7 +153,7 @@ public class PremiumManager
|
|||||||
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
|
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
|
||||||
{
|
{
|
||||||
final long addTime = timeUnit.toMillis(timeValue);
|
final long addTime = timeUnit.toMillis(timeValue);
|
||||||
final long now = Chronos.currentTimeMillis();
|
final long now = System.currentTimeMillis();
|
||||||
// new premium task at least from now
|
// new premium task at least from now
|
||||||
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
|
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
|
||||||
final long newPremiumExpiration = oldPremiumExpiration + addTime;
|
final long newPremiumExpiration = oldPremiumExpiration + addTime;
|
||||||
|
|||||||
+1
-2
@@ -25,7 +25,6 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
|
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
|
||||||
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
||||||
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
|
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
|
||||||
@@ -72,7 +71,7 @@ public class PunishmentManager
|
|||||||
final String punishedBy = rset.getString("punishedBy");
|
final String punishedBy = rset.getString("punishedBy");
|
||||||
if ((type != null) && (affect != null))
|
if ((type != null) && (affect != null))
|
||||||
{
|
{
|
||||||
if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
|
if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
|
||||||
{
|
{
|
||||||
expired++;
|
expired++;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -25,7 +25,6 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.data.SpawnTable;
|
import org.l2jmobius.gameserver.data.SpawnTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||||
@@ -425,7 +424,7 @@ public class BlockChecker
|
|||||||
// Start up player parameters
|
// Start up player parameters
|
||||||
setUpPlayers();
|
setUpPlayers();
|
||||||
// Set the started time
|
// Set the started time
|
||||||
_startedTime = Chronos.currentTimeMillis() + 300000;
|
_startedTime = System.currentTimeMillis() + 300000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,7 +524,7 @@ public class BlockChecker
|
|||||||
_redPoints += _numOfBoxes / 2;
|
_redPoints += _numOfBoxes / 2;
|
||||||
_bluePoints += _numOfBoxes / 2;
|
_bluePoints += _numOfBoxes / 2;
|
||||||
|
|
||||||
final int timeLeft = (int) ((_startedTime - Chronos.currentTimeMillis()) / 1000);
|
final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
|
||||||
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
|
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
|
||||||
_holder.broadCastPacketToTeam(changePoints);
|
_holder.broadCastPacketToTeam(changePoints);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.enums.PartyMessageType;
|
import org.l2jmobius.gameserver.enums.PartyMessageType;
|
||||||
@@ -200,7 +199,7 @@ public class CursedWeapon implements INamable
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
if (Chronos.currentTimeMillis() >= _endTime)
|
if (System.currentTimeMillis() >= _endTime)
|
||||||
{
|
{
|
||||||
endOfLife();
|
endOfLife();
|
||||||
}
|
}
|
||||||
@@ -329,7 +328,7 @@ public class CursedWeapon implements INamable
|
|||||||
public void reActivate()
|
public void reActivate()
|
||||||
{
|
{
|
||||||
_isActivated = true;
|
_isActivated = true;
|
||||||
if ((_endTime - Chronos.currentTimeMillis()) <= 0)
|
if ((_endTime - System.currentTimeMillis()) <= 0)
|
||||||
{
|
{
|
||||||
endOfLife();
|
endOfLife();
|
||||||
}
|
}
|
||||||
@@ -347,7 +346,7 @@ public class CursedWeapon implements INamable
|
|||||||
dropIt(attackable, player);
|
dropIt(attackable, player);
|
||||||
|
|
||||||
// Start the Life Task
|
// Start the Life Task
|
||||||
_endTime = Chronos.currentTimeMillis() + (_duration * 60000);
|
_endTime = System.currentTimeMillis() + (_duration * 60000);
|
||||||
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
|
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -631,7 +630,7 @@ public class CursedWeapon implements INamable
|
|||||||
|
|
||||||
public long getTimeLeft()
|
public long getTimeLeft()
|
||||||
{
|
{
|
||||||
return _endTime - Chronos.currentTimeMillis();
|
return _endTime - System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void goTo(Player player)
|
public void goTo(Player player)
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.model;
|
|||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||||
import org.l2jmobius.gameserver.model.buylist.Product;
|
import org.l2jmobius.gameserver.model.buylist.Product;
|
||||||
import org.l2jmobius.gameserver.model.item.ItemTemplate;
|
import org.l2jmobius.gameserver.model.item.ItemTemplate;
|
||||||
@@ -145,14 +144,14 @@ public class ItemInfo
|
|||||||
}
|
}
|
||||||
_option = item.getEnchantOptions();
|
_option = item.getEnchantOptions();
|
||||||
_visualId = item.getVisualId();
|
_visualId = item.getVisualId();
|
||||||
_visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
|
_visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemInfo(Item item, int change)
|
public ItemInfo(Item item, int change)
|
||||||
{
|
{
|
||||||
this(item);
|
this(item);
|
||||||
_change = change;
|
_change = change;
|
||||||
_visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - Chronos.currentTimeMillis()) / 1000 : 0;
|
_visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemInfo(TradeItem item)
|
public ItemInfo(TradeItem item)
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.sql.PreparedStatement;
|
|||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||||
import org.l2jmobius.gameserver.enums.MailType;
|
import org.l2jmobius.gameserver.enums.MailType;
|
||||||
@@ -105,7 +104,7 @@ public class Message
|
|||||||
_receiverId = receiverId;
|
_receiverId = receiverId;
|
||||||
_subject = subject;
|
_subject = subject;
|
||||||
_content = text;
|
_content = text;
|
||||||
_expiration = (isCod ? Chronos.currentTimeMillis() + (COD_EXPIRATION * 3600000) : Chronos.currentTimeMillis() + (EXPIRATION * 3600000));
|
_expiration = (isCod ? System.currentTimeMillis() + (COD_EXPIRATION * 3600000) : System.currentTimeMillis() + (EXPIRATION * 3600000));
|
||||||
_hasAttachments = false;
|
_hasAttachments = false;
|
||||||
_unread = true;
|
_unread = true;
|
||||||
_deletedBySender = false;
|
_deletedBySender = false;
|
||||||
@@ -124,7 +123,7 @@ public class Message
|
|||||||
_receiverId = receiverId;
|
_receiverId = receiverId;
|
||||||
_subject = subject;
|
_subject = subject;
|
||||||
_content = content;
|
_content = content;
|
||||||
_expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
|
_expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||||
_reqAdena = 0;
|
_reqAdena = 0;
|
||||||
_hasAttachments = false;
|
_hasAttachments = false;
|
||||||
_unread = true;
|
_unread = true;
|
||||||
@@ -144,7 +143,7 @@ public class Message
|
|||||||
_receiverId = receiverId;
|
_receiverId = receiverId;
|
||||||
_subject = subject;
|
_subject = subject;
|
||||||
_content = content;
|
_content = content;
|
||||||
_expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
|
_expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||||
_hasAttachments = false;
|
_hasAttachments = false;
|
||||||
_unread = true;
|
_unread = true;
|
||||||
_deletedBySender = true;
|
_deletedBySender = true;
|
||||||
@@ -163,7 +162,7 @@ public class Message
|
|||||||
_receiverId = msg.getSenderId();
|
_receiverId = msg.getSenderId();
|
||||||
_subject = "";
|
_subject = "";
|
||||||
_content = "";
|
_content = "";
|
||||||
_expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
|
_expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||||
_unread = true;
|
_unread = true;
|
||||||
_deletedBySender = true;
|
_deletedBySender = true;
|
||||||
_deletedByReceiver = false;
|
_deletedByReceiver = false;
|
||||||
@@ -183,7 +182,7 @@ public class Message
|
|||||||
_receiverId = receiverId;
|
_receiverId = receiverId;
|
||||||
_subject = "";
|
_subject = "";
|
||||||
_content = item.getName();
|
_content = item.getName();
|
||||||
_expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
|
_expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||||
_unread = true;
|
_unread = true;
|
||||||
_deletedBySender = true;
|
_deletedBySender = true;
|
||||||
_messageType = mailType;
|
_messageType = mailType;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.model;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.enums.PetitionState;
|
import org.l2jmobius.gameserver.enums.PetitionState;
|
||||||
import org.l2jmobius.gameserver.enums.PetitionType;
|
import org.l2jmobius.gameserver.enums.PetitionType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.IdManager;
|
import org.l2jmobius.gameserver.instancemanager.IdManager;
|
||||||
@@ -37,7 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
|||||||
*/
|
*/
|
||||||
public class Petition
|
public class Petition
|
||||||
{
|
{
|
||||||
private final long _submitTime = Chronos.currentTimeMillis();
|
private final long _submitTime = System.currentTimeMillis();
|
||||||
private final int _id;
|
private final int _id;
|
||||||
private final PetitionType _type;
|
private final PetitionType _type;
|
||||||
private PetitionState _state = PetitionState.PENDING;
|
private PetitionState _state = PetitionState.PENDING;
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||||
@@ -260,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
_scheduledCount++;
|
_scheduledCount++;
|
||||||
|
|
||||||
// Schedule the next respawn.
|
// Schedule the next respawn.
|
||||||
RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
|
RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + (hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model;
|
package org.l2jmobius.gameserver.model;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
|
|
||||||
@@ -53,7 +52,7 @@ public class TimeStamp
|
|||||||
_id2 = skill.getLevel();
|
_id2 = skill.getLevel();
|
||||||
_id3 = skill.getSubLevel();
|
_id3 = skill.getSubLevel();
|
||||||
_reuse = reuse;
|
_reuse = reuse;
|
||||||
_stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
|
_stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
|
||||||
_group = -1;
|
_group = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +68,7 @@ public class TimeStamp
|
|||||||
_id2 = item.getObjectId();
|
_id2 = item.getObjectId();
|
||||||
_id3 = 0;
|
_id3 = 0;
|
||||||
_reuse = reuse;
|
_reuse = reuse;
|
||||||
_stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
|
_stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
|
||||||
_group = item.getSharedReuseGroup();
|
_group = item.getSharedReuseGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +155,7 @@ public class TimeStamp
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
|
final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
|
||||||
if (remainingTime == 0)
|
if (remainingTime == 0)
|
||||||
{
|
{
|
||||||
_stamp = 0;
|
_stamp = 0;
|
||||||
@@ -174,7 +173,7 @@ public class TimeStamp
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
|
final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
|
||||||
if (!hasNotPassed)
|
if (!hasNotPassed)
|
||||||
{
|
{
|
||||||
_stamp = 0;
|
_stamp = 0;
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import java.util.logging.Level;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.AttackableAI;
|
import org.l2jmobius.gameserver.ai.AttackableAI;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -221,7 +220,7 @@ public class Attackable extends Npc
|
|||||||
if (_firstCommandChannelAttacked != null)
|
if (_firstCommandChannelAttacked != null)
|
||||||
{
|
{
|
||||||
_commandChannelTimer = new CommandChannelTimer(this);
|
_commandChannelTimer = new CommandChannelTimer(this);
|
||||||
_commandChannelLastAttack = Chronos.currentTimeMillis();
|
_commandChannelLastAttack = System.currentTimeMillis();
|
||||||
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
|
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
|
||||||
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
|
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
|
||||||
}
|
}
|
||||||
@@ -230,7 +229,7 @@ public class Attackable extends Npc
|
|||||||
}
|
}
|
||||||
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
|
else if (attacker.getParty().getCommandChannel().equals(_firstCommandChannelAttacked)) // is in same channel
|
||||||
{
|
{
|
||||||
_commandChannelLastAttack = Chronos.currentTimeMillis(); // update last attack time
|
_commandChannelLastAttack = System.currentTimeMillis(); // update last attack time
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.EmptyQueue;
|
import org.l2jmobius.commons.util.EmptyQueue;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.AttackableAI;
|
import org.l2jmobius.gameserver.ai.AttackableAI;
|
||||||
@@ -1475,7 +1474,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
|
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
|
||||||
{
|
{
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
for (TimeStamp ts : _reuseTimeStampsItems.values())
|
for (TimeStamp ts : _reuseTimeStampsItems.values())
|
||||||
{
|
{
|
||||||
if (ts.getSharedReuseGroup() == group)
|
if (ts.getSharedReuseGroup() == group)
|
||||||
@@ -1605,7 +1604,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? Chronos.currentTimeMillis() + delay : Long.MAX_VALUE);
|
_disabledSkills.put(skill.getReuseHashCode(), delay > 0 ? System.currentTimeMillis() + delay : Long.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1653,7 +1652,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (stamp < Chronos.currentTimeMillis())
|
if (stamp < System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
_disabledSkills.remove(hashCode);
|
_disabledSkills.remove(hashCode);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import java.util.logging.Level;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
import org.l2jmobius.gameserver.data.ItemTable;
|
||||||
@@ -206,7 +205,7 @@ public class Npc extends Creature
|
|||||||
public void onRandomAnimation(int animationId)
|
public void onRandomAnimation(int animationId)
|
||||||
{
|
{
|
||||||
// Send a packet SocialAction to all Player in the _KnownPlayers of the Npc
|
// Send a packet SocialAction to all Player in the _KnownPlayers of the Npc
|
||||||
final long now = Chronos.currentTimeMillis();
|
final long now = System.currentTimeMillis();
|
||||||
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
|
if ((now - _lastSocialBroadcast) > MINIMUM_SOCIAL_INTERVAL)
|
||||||
{
|
{
|
||||||
_lastSocialBroadcast = now;
|
_lastSocialBroadcast = now;
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ import java.util.stream.Collectors;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.LoginServerThread;
|
import org.l2jmobius.gameserver.LoginServerThread;
|
||||||
@@ -2879,7 +2878,7 @@ public class Player extends Playable
|
|||||||
public void setOnlineTime(long time)
|
public void setOnlineTime(long time)
|
||||||
{
|
{
|
||||||
_onlineTime = time;
|
_onlineTime = time;
|
||||||
_onlineBeginTime = Chronos.currentTimeMillis();
|
_onlineBeginTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3944,22 +3943,22 @@ public class Player extends Playable
|
|||||||
|
|
||||||
public boolean isSpawnProtected()
|
public boolean isSpawnProtected()
|
||||||
{
|
{
|
||||||
return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
|
return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTeleportProtected()
|
public boolean isTeleportProtected()
|
||||||
{
|
{
|
||||||
return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
|
return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSpawnProtection(boolean protect)
|
public void setSpawnProtection(boolean protect)
|
||||||
{
|
{
|
||||||
_spawnProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
|
_spawnProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_SPAWN_PROTECTION * 1000) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTeleportProtection(boolean protect)
|
public void setTeleportProtection(boolean protect)
|
||||||
{
|
{
|
||||||
_teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
|
_teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -5305,7 +5304,7 @@ public class Player extends Playable
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
|
setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
|
||||||
if (_pvpFlag == 0)
|
if (_pvpFlag == 0)
|
||||||
{
|
{
|
||||||
startPvPFlag();
|
startPvPFlag();
|
||||||
@@ -5338,11 +5337,11 @@ public class Player extends Playable
|
|||||||
{
|
{
|
||||||
if (checkIfPvP(targetPlayer))
|
if (checkIfPvP(targetPlayer))
|
||||||
{
|
{
|
||||||
setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
|
setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
|
setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
|
||||||
}
|
}
|
||||||
if (_pvpFlag == 0)
|
if (_pvpFlag == 0)
|
||||||
{
|
{
|
||||||
@@ -6218,7 +6217,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
public long getUptime()
|
public long getUptime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _uptime;
|
return System.currentTimeMillis() - _uptime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6463,7 +6462,7 @@ public class Player extends Playable
|
|||||||
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
|
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
|
||||||
{
|
{
|
||||||
statement.setInt(1, isOnlineInt());
|
statement.setInt(1, isOnlineInt());
|
||||||
statement.setLong(2, Chronos.currentTimeMillis());
|
statement.setLong(2, System.currentTimeMillis());
|
||||||
statement.setInt(3, getObjectId());
|
statement.setInt(3, getObjectId());
|
||||||
statement.execute();
|
statement.execute();
|
||||||
}
|
}
|
||||||
@@ -6588,12 +6587,12 @@ public class Player extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
|
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
|
||||||
if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
|
if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
player.setClanJoinExpiryTime(0);
|
player.setClanJoinExpiryTime(0);
|
||||||
}
|
}
|
||||||
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
|
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
|
||||||
if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
|
if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
player.setClanCreateExpiryTime(0);
|
player.setClanCreateExpiryTime(0);
|
||||||
}
|
}
|
||||||
@@ -6652,7 +6651,7 @@ public class Player extends Playable
|
|||||||
player.getAppearance().setTitleColor(titleColor);
|
player.getAppearance().setTitleColor(titleColor);
|
||||||
}
|
}
|
||||||
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
|
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
|
||||||
player.setUptime(Chronos.currentTimeMillis());
|
player.setUptime(System.currentTimeMillis());
|
||||||
|
|
||||||
currentHp = rset.getDouble("curHp");
|
currentHp = rset.getDouble("curHp");
|
||||||
currentCp = rset.getDouble("curCp");
|
currentCp = rset.getDouble("curCp");
|
||||||
@@ -7172,7 +7171,7 @@ public class Player extends Playable
|
|||||||
long totalOnlineTime = _onlineTime;
|
long totalOnlineTime = _onlineTime;
|
||||||
if (_onlineBeginTime > 0)
|
if (_onlineBeginTime > 0)
|
||||||
{
|
{
|
||||||
totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
|
totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
|
||||||
}
|
}
|
||||||
statement.setLong(34, _offlineShopStart > 0 ? _onlineTime : totalOnlineTime);
|
statement.setLong(34, _offlineShopStart > 0 ? _onlineTime : totalOnlineTime);
|
||||||
statement.setInt(35, isNoble() ? 1 : 0);
|
statement.setInt(35, isNoble() ? 1 : 0);
|
||||||
@@ -7257,7 +7256,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
int buffIndex = 0;
|
int buffIndex = 0;
|
||||||
final List<Long> storedSkills = new ArrayList<>();
|
final List<Long> storedSkills = new ArrayList<>();
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
|
|
||||||
// Store all effect data along with calulated remaining
|
// Store all effect data along with calulated remaining
|
||||||
// reuse delays for matching skills. 'restore_type'= 0.
|
// reuse delays for matching skills. 'restore_type'= 0.
|
||||||
@@ -7372,7 +7371,7 @@ public class Player extends Playable
|
|||||||
ps1.setInt(1, getObjectId());
|
ps1.setInt(1, getObjectId());
|
||||||
ps1.execute();
|
ps1.execute();
|
||||||
|
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
for (TimeStamp ts : getItemReuseTimeStamps().values())
|
for (TimeStamp ts : getItemReuseTimeStamps().values())
|
||||||
{
|
{
|
||||||
if ((ts != null) && (currentTime < ts.getStamp()))
|
if ((ts != null) && (currentTime < ts.getStamp()))
|
||||||
@@ -7693,7 +7692,7 @@ public class Player extends Playable
|
|||||||
statement.setInt(2, _classIndex);
|
statement.setInt(2, _classIndex);
|
||||||
try (ResultSet rset = statement.executeQuery())
|
try (ResultSet rset = statement.executeQuery())
|
||||||
{
|
{
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
while (rset.next())
|
while (rset.next())
|
||||||
{
|
{
|
||||||
final int remainingTime = rset.getInt("remaining_time");
|
final int remainingTime = rset.getInt("remaining_time");
|
||||||
@@ -7755,7 +7754,7 @@ public class Player extends Playable
|
|||||||
long systime;
|
long systime;
|
||||||
boolean isInInventory;
|
boolean isInInventory;
|
||||||
long remainingTime;
|
long remainingTime;
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
while (rset.next())
|
while (rset.next())
|
||||||
{
|
{
|
||||||
itemId = rset.getInt("itemId");
|
itemId = rset.getInt("itemId");
|
||||||
@@ -7830,7 +7829,7 @@ public class Player extends Playable
|
|||||||
{
|
{
|
||||||
int slot;
|
int slot;
|
||||||
int symbolId;
|
int symbolId;
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
while (rset.next())
|
while (rset.next())
|
||||||
{
|
{
|
||||||
slot = rset.getInt("slot");
|
slot = rset.getInt("slot");
|
||||||
@@ -7953,7 +7952,7 @@ public class Player extends Playable
|
|||||||
// Send Server->Client UserInfo packet to this Player
|
// Send Server->Client UserInfo packet to this Player
|
||||||
broadcastUserInfo(UserInfoType.BASE_STATS, UserInfoType.MAX_HPCPMP, UserInfoType.STATS, UserInfoType.SPEED);
|
broadcastUserInfo(UserInfoType.BASE_STATS, UserInfoType.MAX_HPCPMP, UserInfoType.STATS, UserInfoType.SPEED);
|
||||||
|
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
final long timeLeft = getVariables().getLong("HennaDuration" + slot, currentTime) - currentTime;
|
final long timeLeft = getVariables().getLong("HennaDuration" + slot, currentTime) - currentTime;
|
||||||
if ((henna.getDuration() < 0) || (timeLeft > 0))
|
if ((henna.getDuration() < 0) || (timeLeft > 0))
|
||||||
{
|
{
|
||||||
@@ -8044,7 +8043,7 @@ public class Player extends Playable
|
|||||||
// Task for henna duration
|
// Task for henna duration
|
||||||
if (henna.getDuration() > 0)
|
if (henna.getDuration() > 0)
|
||||||
{
|
{
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
final long durationInMillis = henna.getDuration() * 60000;
|
final long durationInMillis = henna.getDuration() * 60000;
|
||||||
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
|
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
|
||||||
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
|
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
|
||||||
@@ -12498,7 +12497,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
public int getBirthdays()
|
public int getBirthdays()
|
||||||
{
|
{
|
||||||
long time = (Chronos.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
|
long time = (System.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
|
||||||
time /= TimeUnit.DAYS.toMillis(365);
|
time /= TimeUnit.DAYS.toMillis(365);
|
||||||
return (int) time;
|
return (int) time;
|
||||||
}
|
}
|
||||||
@@ -12739,7 +12738,7 @@ public class Player extends Playable
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
|
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -12791,7 +12790,7 @@ public class Player extends Playable
|
|||||||
*/
|
*/
|
||||||
public void setFalling()
|
public void setFalling()
|
||||||
{
|
{
|
||||||
_fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
|
_fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12812,7 +12811,7 @@ public class Player extends Playable
|
|||||||
*/
|
*/
|
||||||
public void updateLastItemAuctionRequest()
|
public void updateLastItemAuctionRequest()
|
||||||
{
|
{
|
||||||
_lastItemAuctionInfoRequest = Chronos.currentTimeMillis();
|
_lastItemAuctionInfoRequest = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12821,7 +12820,7 @@ public class Player extends Playable
|
|||||||
*/
|
*/
|
||||||
public boolean isItemAuctionPolling()
|
public boolean isItemAuctionPolling()
|
||||||
{
|
{
|
||||||
return (Chronos.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
|
return (System.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -13179,7 +13178,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
public void updateNotMoveUntil()
|
public void updateNotMoveUntil()
|
||||||
{
|
{
|
||||||
_notMoveUntil = Chronos.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
|
_notMoveUntil = System.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-2
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor.instance;
|
package org.l2jmobius.gameserver.model.actor.instance;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
import org.l2jmobius.gameserver.data.ItemTable;
|
||||||
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
|
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
|
||||||
@@ -143,7 +142,7 @@ public class Block extends Monster
|
|||||||
{
|
{
|
||||||
eng.increasePlayerPoints(player, team);
|
eng.increasePlayerPoints(player, team);
|
||||||
|
|
||||||
final int timeLeft = (int) ((eng.getStarterTime() - Chronos.currentTimeMillis()) / 1000);
|
final int timeLeft = (int) ((eng.getStarterTime() - System.currentTimeMillis()) / 1000);
|
||||||
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
|
final boolean isRed = eng.getHolder().getRedPlayers().contains(player);
|
||||||
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints());
|
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));
|
final ExCubeGameExtendedChangePoints secretPoints = new ExCubeGameExtendedChangePoints(timeLeft, eng.getBluePoints(), eng.getRedPoints(), isRed, player, eng.getPlayerPoints(player, isRed));
|
||||||
|
|||||||
+2
-3
@@ -22,7 +22,6 @@ import java.util.regex.Pattern;
|
|||||||
import java.util.regex.PatternSyntaxException;
|
import java.util.regex.PatternSyntaxException;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
||||||
import org.l2jmobius.gameserver.enums.AcquireSkillType;
|
import org.l2jmobius.gameserver.enums.AcquireSkillType;
|
||||||
@@ -340,13 +339,13 @@ public class VillageMaster extends Folk
|
|||||||
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
|
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
|
if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
|
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clan.setDissolvingExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||||
clan.updateClanInDB();
|
clan.updateClanInDB();
|
||||||
|
|
||||||
// The clan leader should take the XP penalty of a full death.
|
// The clan leader should take the XP penalty of a full death.
|
||||||
|
|||||||
+1
-2
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.model.actor.tasks.attackable;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,7 +40,7 @@ public class CommandChannelTimer implements Runnable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Chronos.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
|
if ((System.currentTimeMillis() - _attackable.getCommandChannelLastAttack()) > Config.LOOT_RAIDS_PRIVILEGE_INTERVAL)
|
||||||
{
|
{
|
||||||
_attackable.setCommandChannelTimer(null);
|
_attackable.setCommandChannelTimer(null);
|
||||||
_attackable.setFirstCommandChannelAttacked(null);
|
_attackable.setFirstCommandChannelAttacked(null);
|
||||||
|
|||||||
+2
-3
@@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.model.actor.tasks.player;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
|
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -94,12 +93,12 @@ public class IllegalPlayerActionTask implements Runnable
|
|||||||
}
|
}
|
||||||
case KICKBAN:
|
case KICKBAN:
|
||||||
{
|
{
|
||||||
PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
|
PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case JAIL:
|
case JAIL:
|
||||||
{
|
{
|
||||||
PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, Chronos.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
|
PunishmentManager.getInstance().startPunishment(new PunishmentTask(_actor.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL, System.currentTimeMillis() + (Config.DEFAULT_PUNISH_PARAM * 1000), _message, getClass().getSimpleName()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.item.ItemTemplate;
|
import org.l2jmobius.gameserver.model.item.ItemTemplate;
|
||||||
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
|
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
|
||||||
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
|
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
|
||||||
@@ -121,7 +120,7 @@ public class Product
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuyListTaskManager.getInstance().add(this, Chronos.currentTimeMillis() + _restockDelay);
|
BuyListTaskManager.getInstance().add(this, System.currentTimeMillis() + _restockDelay);
|
||||||
|
|
||||||
final boolean result = _count.addAndGet(-value) >= 0;
|
final boolean result = _count.addAndGet(-value) >= 0;
|
||||||
save();
|
save();
|
||||||
@@ -135,7 +134,7 @@ public class Product
|
|||||||
|
|
||||||
public void restartRestockTask(long nextRestockTime)
|
public void restartRestockTask(long nextRestockTime)
|
||||||
{
|
{
|
||||||
final long remainTime = nextRestockTime - Chronos.currentTimeMillis();
|
final long remainTime = nextRestockTime - System.currentTimeMillis();
|
||||||
if (remainTime > 0)
|
if (remainTime > 0)
|
||||||
{
|
{
|
||||||
BuyListTaskManager.getInstance().update(this, remainTime);
|
BuyListTaskManager.getInstance().update(this, remainTime);
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
|
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
|
||||||
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
||||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||||
@@ -505,7 +504,7 @@ public class Clan implements IIdentifiable, INamable
|
|||||||
if (player.isClanLeader())
|
if (player.isClanLeader())
|
||||||
{
|
{
|
||||||
SiegeManager.getInstance().removeSiegeSkills(player);
|
SiegeManager.getInstance().removeSiegeSkills(player);
|
||||||
player.setClanCreateExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove Clan skills from Player
|
// remove Clan skills from Player
|
||||||
@@ -545,7 +544,7 @@ public class Clan implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
|
removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
// Notify to scripts
|
||||||
@@ -1083,12 +1082,12 @@ public class Clan implements IIdentifiable, INamable
|
|||||||
setAllyId(clanData.getInt("ally_id"));
|
setAllyId(clanData.getInt("ally_id"));
|
||||||
setAllyName(clanData.getString("ally_name"));
|
setAllyName(clanData.getString("ally_name"));
|
||||||
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
|
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
|
||||||
if (_allyPenaltyExpiryTime < Chronos.currentTimeMillis())
|
if (_allyPenaltyExpiryTime < System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
setAllyPenaltyExpiryTime(0, 0);
|
setAllyPenaltyExpiryTime(0, 0);
|
||||||
}
|
}
|
||||||
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
|
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
|
||||||
if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < Chronos.currentTimeMillis()) // 24*60*60*1000 = 86400000
|
if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
|
||||||
{
|
{
|
||||||
setCharPenaltyExpiryTime(0);
|
setCharPenaltyExpiryTime(0);
|
||||||
}
|
}
|
||||||
@@ -2205,7 +2204,7 @@ public class Clan implements IIdentifiable, INamable
|
|||||||
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
|
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_charPenaltyExpiryTime > Chronos.currentTimeMillis())
|
if (_charPenaltyExpiryTime > System.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);
|
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;
|
return false;
|
||||||
@@ -2217,7 +2216,7 @@ public class Clan implements IIdentifiable, INamable
|
|||||||
player.sendPacket(sm);
|
player.sendPacket(sm);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (target.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
|
if (target.getClanJoinExpiryTime() > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
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());
|
sm.addString(target.getName());
|
||||||
@@ -2266,7 +2265,7 @@ public class Clan implements IIdentifiable, INamable
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final Clan leaderClan = player.getClan();
|
final Clan leaderClan = player.getClan();
|
||||||
if (leaderClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
|
if (leaderClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
if (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN)
|
if (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN)
|
||||||
{
|
{
|
||||||
@@ -2305,7 +2304,7 @@ public class Clan implements IIdentifiable, INamable
|
|||||||
player.sendPacket(sm);
|
player.sendPacket(sm);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
|
if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
|
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
|
||||||
{
|
{
|
||||||
@@ -2399,12 +2398,12 @@ public class Clan implements IIdentifiable, INamable
|
|||||||
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
|
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((_allyPenaltyExpiryTime > Chronos.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
|
if ((_allyPenaltyExpiryTime > System.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
|
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_dissolvingExpiryTime > Chronos.currentTimeMillis())
|
if (_dissolvingExpiryTime > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
|
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
|
||||||
return;
|
return;
|
||||||
@@ -2456,7 +2455,7 @@ public class Clan implements IIdentifiable, INamable
|
|||||||
|
|
||||||
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
|
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
|
||||||
|
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
for (Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
|
for (Clan clan : ClanTable.getInstance().getClanAllies(getAllyId()))
|
||||||
{
|
{
|
||||||
if (clan.getId() != getId())
|
if (clan.getId() != getId())
|
||||||
@@ -2482,7 +2481,7 @@ public class Clan implements IIdentifiable, INamable
|
|||||||
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
|
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (Chronos.currentTimeMillis() < _dissolvingExpiryTime)
|
if (System.currentTimeMillis() < _dissolvingExpiryTime)
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
|
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.enums.ClanWarState;
|
import org.l2jmobius.gameserver.enums.ClanWarState;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -55,9 +54,9 @@ public class ClanWar
|
|||||||
{
|
{
|
||||||
_attackerClanId = attacker.getId();
|
_attackerClanId = attacker.getId();
|
||||||
_attackedClanId = attacked.getId();
|
_attackedClanId = attacked.getId();
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = System.currentTimeMillis();
|
||||||
_state = ClanWarState.BLOOD_DECLARATION;
|
_state = ClanWarState.BLOOD_DECLARATION;
|
||||||
_cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_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());
|
||||||
attacker.addWar(attacked.getId(), this);
|
attacker.addWar(attacked.getId(), this);
|
||||||
attacked.addWar(attacker.getId(), this);
|
attacked.addWar(attacker.getId(), this);
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
|
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
|
||||||
@@ -80,15 +79,15 @@ public class ClanWar
|
|||||||
_attackerKillCount.set(attackerKillCount);
|
_attackerKillCount.set(attackerKillCount);
|
||||||
_attackedKillCount.set(attackedKillCount);
|
_attackedKillCount.set(attackedKillCount);
|
||||||
_winnerClanId = winnerClan;
|
_winnerClanId = winnerClan;
|
||||||
if ((_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) > Chronos.currentTimeMillis())
|
if ((_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());
|
_cancelTask = ThreadPool.schedule(this::clanWarTimeout, (_startTime + TIME_TO_CANCEL_NON_MUTUAL_CLAN_WAR) - System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_endTime > 0)
|
if (_endTime > 0)
|
||||||
{
|
{
|
||||||
final long endTimePeriod = _endTime + (_state == ClanWarState.TIE ? TIME_TO_DELETION_AFTER_CANCELLATION : TIME_TO_DELETION_AFTER_DEFEAT);
|
final long endTimePeriod = _endTime + (_state == ClanWarState.TIE ? TIME_TO_DELETION_AFTER_CANCELLATION : TIME_TO_DELETION_AFTER_DEFEAT);
|
||||||
if (endTimePeriod > Chronos.currentTimeMillis())
|
if (endTimePeriod > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(_attackerClanId, _attackedClanId), 10000);
|
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(_attackerClanId, _attackedClanId), 10000);
|
||||||
}
|
}
|
||||||
@@ -178,8 +177,8 @@ public class ClanWar
|
|||||||
winnerClan.broadcastToOnlineMembers(sm);
|
winnerClan.broadcastToOnlineMembers(sm);
|
||||||
|
|
||||||
_winnerClanId = winnerClan.getId();
|
_winnerClanId = winnerClan.getId();
|
||||||
_endTime = Chronos.currentTimeMillis();
|
_endTime = System.currentTimeMillis();
|
||||||
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - Chronos.currentTimeMillis());
|
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clanWarTimeout()
|
public void clanWarTimeout()
|
||||||
@@ -197,8 +196,8 @@ public class ClanWar
|
|||||||
attackerClan.broadcastToOnlineMembers(sm);
|
attackerClan.broadcastToOnlineMembers(sm);
|
||||||
|
|
||||||
_state = ClanWarState.TIE;
|
_state = ClanWarState.TIE;
|
||||||
_endTime = Chronos.currentTimeMillis();
|
_endTime = System.currentTimeMillis();
|
||||||
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - Chronos.currentTimeMillis());
|
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -20,7 +20,6 @@ import java.io.Serializable;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,7 +85,7 @@ public class TrainingHolder implements Serializable
|
|||||||
|
|
||||||
public long getElapsedTime()
|
public long getElapsedTime()
|
||||||
{
|
{
|
||||||
return TimeUnit.SECONDS.convert(Chronos.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
|
return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getRemainingTime()
|
public long getRemainingTime()
|
||||||
|
|||||||
+4
-5
@@ -39,7 +39,6 @@ import java.util.stream.Stream;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||||
import org.l2jmobius.gameserver.enums.InstanceReenterType;
|
import org.l2jmobius.gameserver.enums.InstanceReenterType;
|
||||||
@@ -108,7 +107,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
// Set basic instance info
|
// Set basic instance info
|
||||||
_id = id;
|
_id = id;
|
||||||
_template = template;
|
_template = template;
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = System.currentTimeMillis();
|
||||||
_spawns = new ArrayList<>(template.getSpawns().size());
|
_spawns = new ArrayList<>(template.getSpawns().size());
|
||||||
|
|
||||||
// Clone and add the spawn templates
|
// Clone and add the spawn templates
|
||||||
@@ -796,7 +795,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set new cleanup task
|
// Set new cleanup task
|
||||||
_endTime = Chronos.currentTimeMillis() + millis;
|
_endTime = System.currentTimeMillis() + millis;
|
||||||
if (minutes < 1) // Destroy instance
|
if (minutes < 1) // Destroy instance
|
||||||
{
|
{
|
||||||
destroy();
|
destroy();
|
||||||
@@ -900,7 +899,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public long getElapsedTime()
|
public long getElapsedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return System.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -909,7 +908,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public long getRemainingTime()
|
public long getRemainingTime()
|
||||||
{
|
{
|
||||||
return (_endTime == -1) ? -1 : (_endTime - Chronos.currentTimeMillis());
|
return (_endTime == -1) ? -1 : (_endTime - System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
-4
@@ -26,7 +26,6 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.enums.GroupType;
|
import org.l2jmobius.gameserver.enums.GroupType;
|
||||||
import org.l2jmobius.gameserver.enums.InstanceReenterType;
|
import org.l2jmobius.gameserver.enums.InstanceReenterType;
|
||||||
@@ -551,7 +550,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
|
|||||||
{
|
{
|
||||||
if (data.getTime() > 0)
|
if (data.getTime() > 0)
|
||||||
{
|
{
|
||||||
time = Chronos.currentTimeMillis() + data.getTime();
|
time = System.currentTimeMillis() + data.getTime();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,7 +560,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
|
|||||||
calendar.set(Calendar.SECOND, 0);
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
|
||||||
// If calendar time is lower than current, add one more day
|
// If calendar time is lower than current, add one more day
|
||||||
if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
|
if (calendar.getTimeInMillis() <= System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
}
|
}
|
||||||
@@ -578,7 +577,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
|
|||||||
|
|
||||||
// Set exact day. If modified date is before current, add one more week.
|
// Set exact day. If modified date is before current, add one more week.
|
||||||
calendar.set(Calendar.DAY_OF_WEEK, day);
|
calendar.set(Calendar.DAY_OF_WEEK, day);
|
||||||
if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
|
if (calendar.getTimeInMillis() <= System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
calendar.add(Calendar.WEEK_OF_MONTH, 1);
|
calendar.add(Calendar.WEEK_OF_MONTH, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.instancezone.conditions;
|
package org.l2jmobius.gameserver.model.instancezone.conditions;
|
||||||
|
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||||
@@ -40,6 +39,6 @@ public class ConditionReenter extends Condition
|
|||||||
protected boolean test(Player player, Npc npc)
|
protected boolean test(Player player, Npc npc)
|
||||||
{
|
{
|
||||||
final int instanceId = getParameters().getInt("instanceId", getInstanceTemplate().getId());
|
final int instanceId = getParameters().getInt("instanceId", getInstanceTemplate().getId());
|
||||||
return Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
|
return System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, instanceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
import org.l2jmobius.gameserver.data.ItemTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
|
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
|
||||||
import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData;
|
import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData;
|
||||||
@@ -195,7 +194,7 @@ public class Item extends WorldObject
|
|||||||
_type2 = 0;
|
_type2 = 0;
|
||||||
_dropTime = 0;
|
_dropTime = 0;
|
||||||
_mana = _itemTemplate.getDuration();
|
_mana = _itemTemplate.getDuration();
|
||||||
_time = _itemTemplate.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_itemTemplate.getTime() * 60 * 1000);
|
_time = _itemTemplate.getTime() == -1 ? -1 : System.currentTimeMillis() + (_itemTemplate.getTime() * 60 * 1000);
|
||||||
scheduleLifeTimeTask();
|
scheduleLifeTimeTask();
|
||||||
scheduleVisualLifeTime();
|
scheduleVisualLifeTime();
|
||||||
}
|
}
|
||||||
@@ -218,7 +217,7 @@ public class Item extends WorldObject
|
|||||||
super.setName(_itemTemplate.getName());
|
super.setName(_itemTemplate.getName());
|
||||||
_loc = ItemLocation.VOID;
|
_loc = ItemLocation.VOID;
|
||||||
_mana = _itemTemplate.getDuration();
|
_mana = _itemTemplate.getDuration();
|
||||||
_time = _itemTemplate.getTime() == -1 ? -1 : Chronos.currentTimeMillis() + (_itemTemplate.getTime() * 60 * 1000);
|
_time = _itemTemplate.getTime() == -1 ? -1 : System.currentTimeMillis() + (_itemTemplate.getTime() * 60 * 1000);
|
||||||
scheduleLifeTimeTask();
|
scheduleLifeTimeTask();
|
||||||
scheduleVisualLifeTime();
|
scheduleVisualLifeTime();
|
||||||
}
|
}
|
||||||
@@ -1516,7 +1515,7 @@ public class Item extends WorldObject
|
|||||||
setSpawned(true);
|
setSpawned(true);
|
||||||
setXYZ(x, y, z);
|
setXYZ(x, y, z);
|
||||||
|
|
||||||
setDropTime(Chronos.currentTimeMillis());
|
setDropTime(System.currentTimeMillis());
|
||||||
setDropperObjectId(dropper != null ? dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
|
setDropperObjectId(dropper != null ? dropper.getObjectId() : 0); // Set the dropper Id for the knownlist packets in sendInfo
|
||||||
|
|
||||||
// Add the Item dropped in the world as a visible object
|
// Add the Item dropped in the world as a visible object
|
||||||
@@ -1789,7 +1788,7 @@ public class Item extends WorldObject
|
|||||||
|
|
||||||
public long getRemainingTime()
|
public long getRemainingTime()
|
||||||
{
|
{
|
||||||
return _time - Chronos.currentTimeMillis();
|
return _time - System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void endOfLife()
|
public void endOfLife()
|
||||||
@@ -2163,7 +2162,7 @@ public class Item extends WorldObject
|
|||||||
if (getVisualLifeTime() > 0)
|
if (getVisualLifeTime() > 0)
|
||||||
{
|
{
|
||||||
final long endTime = getVisualLifeTime();
|
final long endTime = getVisualLifeTime();
|
||||||
if ((endTime - Chronos.currentTimeMillis()) > 0)
|
if ((endTime - System.currentTimeMillis()) > 0)
|
||||||
{
|
{
|
||||||
ItemAppearanceTaskManager.getInstance().add(this, endTime);
|
ItemAppearanceTaskManager.getInstance().add(this, endTime);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-5
@@ -28,7 +28,6 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.gameserver.model.ItemInfo;
|
import org.l2jmobius.gameserver.model.ItemInfo;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -182,12 +181,12 @@ public class ItemAuction
|
|||||||
|
|
||||||
public long getStartingTimeRemaining()
|
public long getStartingTimeRemaining()
|
||||||
{
|
{
|
||||||
return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
|
return Math.max(_endingTime - System.currentTimeMillis(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getFinishingTimeRemaining()
|
public long getFinishingTimeRemaining()
|
||||||
{
|
{
|
||||||
return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
|
return Math.max(_endingTime - System.currentTimeMillis(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void storeMe()
|
public void storeMe()
|
||||||
@@ -340,7 +339,7 @@ public class ItemAuction
|
|||||||
_highestBid = bid;
|
_highestBid = bid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_endingTime - Chronos.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
|
if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
|
||||||
{
|
{
|
||||||
switch (_auctionEndingExtendState)
|
switch (_auctionEndingExtendState)
|
||||||
{
|
{
|
||||||
@@ -427,7 +426,7 @@ public class ItemAuction
|
|||||||
}
|
}
|
||||||
case FINISHED:
|
case FINISHED:
|
||||||
{
|
{
|
||||||
if (_startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
|
if (_startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-16
@@ -41,7 +41,6 @@ import org.w3c.dom.Node;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||||
import org.l2jmobius.gameserver.enums.ItemLocation;
|
import org.l2jmobius.gameserver.enums.ItemLocation;
|
||||||
@@ -244,7 +243,7 @@ public class ItemAuctionInstance
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
|
nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
@@ -253,10 +252,10 @@ public class ItemAuctionInstance
|
|||||||
{
|
{
|
||||||
case CREATED:
|
case CREATED:
|
||||||
{
|
{
|
||||||
if (auctions[0].getStartingTime() < (Chronos.currentTimeMillis() + START_TIME_SPACE))
|
if (auctions[0].getStartingTime() < (System.currentTimeMillis() + START_TIME_SPACE))
|
||||||
{
|
{
|
||||||
currentAuction = auctions[0];
|
currentAuction = auctions[0];
|
||||||
nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
|
nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -267,13 +266,13 @@ public class ItemAuctionInstance
|
|||||||
case STARTED:
|
case STARTED:
|
||||||
{
|
{
|
||||||
currentAuction = auctions[0];
|
currentAuction = auctions[0];
|
||||||
nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, Chronos.currentTimeMillis() + START_TIME_SPACE));
|
nextAuction = createAuction(Math.max(currentAuction.getEndingTime() + FINISH_TIME_SPACE, System.currentTimeMillis() + START_TIME_SPACE));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FINISHED:
|
case FINISHED:
|
||||||
{
|
{
|
||||||
currentAuction = auctions[0];
|
currentAuction = auctions[0];
|
||||||
nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
|
nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -288,7 +287,7 @@ public class ItemAuctionInstance
|
|||||||
{
|
{
|
||||||
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
|
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
|
||||||
// just to make sure we won't skip any auction because of little different times
|
// just to make sure we won't skip any auction because of little different times
|
||||||
final long currentTime = Chronos.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
for (ItemAuction auction : auctions)
|
for (ItemAuction auction : auctions)
|
||||||
{
|
{
|
||||||
if (auction.getAuctionState() == ItemAuctionState.STARTED)
|
if (auction.getAuctionState() == ItemAuctionState.STARTED)
|
||||||
@@ -312,7 +311,7 @@ public class ItemAuctionInstance
|
|||||||
}
|
}
|
||||||
if (nextAuction == null)
|
if (nextAuction == null)
|
||||||
{
|
{
|
||||||
nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
|
nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -327,17 +326,17 @@ public class ItemAuctionInstance
|
|||||||
{
|
{
|
||||||
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
|
if (currentAuction.getAuctionState() == ItemAuctionState.STARTED)
|
||||||
{
|
{
|
||||||
setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
|
setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getEndingTime() - System.currentTimeMillis(), 0)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
|
setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(currentAuction), Math.max(currentAuction.getStartingTime() - System.currentTimeMillis(), 0)));
|
||||||
}
|
}
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
|
LOGGER.info(getClass().getSimpleName() + ": Schedule current auction " + currentAuction.getAuctionId() + " for instance " + _instanceId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - Chronos.currentTimeMillis(), 0)));
|
setStateTask(ThreadPool.schedule(new ScheduleAuctionTask(nextAuction), Math.max(nextAuction.getStartingTime() - System.currentTimeMillis(), 0)));
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
|
LOGGER.info(getClass().getSimpleName() + ": Schedule next auction " + nextAuction.getAuctionId() + " on " + DATE_FORMAT.format(new Date(nextAuction.getStartingTime())) + " for instance " + _instanceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -423,7 +422,7 @@ public class ItemAuctionInstance
|
|||||||
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
|
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
|
||||||
{
|
{
|
||||||
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
|
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_5_MIN);
|
||||||
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
|
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -433,7 +432,7 @@ public class ItemAuctionInstance
|
|||||||
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
|
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
|
||||||
{
|
{
|
||||||
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
|
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
|
||||||
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
|
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -443,7 +442,7 @@ public class ItemAuctionInstance
|
|||||||
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
|
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
|
||||||
{
|
{
|
||||||
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
|
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
|
||||||
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
|
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -453,7 +452,7 @@ public class ItemAuctionInstance
|
|||||||
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
|
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
|
||||||
{
|
{
|
||||||
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
|
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
|
||||||
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
|
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -578,7 +577,7 @@ public class ItemAuctionInstance
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (Chronos.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
|
if ((auctionState == ItemAuctionState.FINISHED) && (startingTime < (System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(Config.ALT_ITEM_AUCTION_EXPIRED_AFTER, TimeUnit.DAYS))))
|
||||||
{
|
{
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Clearing expired auction: " + auctionId);
|
LOGGER.info(getClass().getSimpleName() + ": Clearing expired auction: " + auctionId);
|
||||||
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
|
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user