Dropped Chronos.
This commit is contained in:
@@ -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.enums.ServerMode;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.DeadLockDetector;
|
||||
import org.l2jmobius.commons.util.PropertiesParser;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
@@ -189,7 +188,7 @@ public class GameServer
|
||||
|
||||
public GameServer() throws Exception
|
||||
{
|
||||
final long serverLoadStart = Chronos.currentTimeMillis();
|
||||
final long serverLoadStart = System.currentTimeMillis();
|
||||
|
||||
// GUI
|
||||
final PropertiesParser interfaceConfig = new PropertiesParser(Config.INTERFACE_CONFIG_FILE);
|
||||
@@ -475,7 +474,7 @@ public class GameServer
|
||||
final long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
|
||||
LOGGER.info(getClass().getSimpleName() + ": Started, using " + getUsedMemoryMB() + " of " + totalMem + " MB total memory.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Maximum number of connected players is " + Config.MAXIMUM_ONLINE_USERS + ".");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((Chronos.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
|
||||
|
||||
ClientNetworkManager.getInstance().start();
|
||||
|
||||
|
@@ -23,7 +23,6 @@ import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseBackup;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.BotReportTable;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
|
||||
@@ -532,19 +531,19 @@ public class Shutdown extends Thread
|
||||
|
||||
public void restartCounter()
|
||||
{
|
||||
_startTime = Chronos.currentTimeMillis();
|
||||
_startTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public long getEstimatedTimeAndRestartCounter()
|
||||
{
|
||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||
final long toReturn = System.currentTimeMillis() - _startTime;
|
||||
restartCounter();
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
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.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.ItemLocation;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
@@ -313,7 +312,7 @@ public class CreatureAI extends AbstractAI
|
||||
|
||||
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
|
||||
{
|
||||
|
@@ -22,7 +22,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
|
||||
/**
|
||||
@@ -40,7 +39,7 @@ public class WarehouseCacheManager
|
||||
|
||||
public void addCacheTask(Player pc)
|
||||
{
|
||||
CACHED_WH.put(pc, Chronos.currentTimeMillis());
|
||||
CACHED_WH.put(pc, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void remCacheTask(Player pc)
|
||||
@@ -57,7 +56,7 @@ public class WarehouseCacheManager
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final long cTime = Chronos.currentTimeMillis();
|
||||
final long cTime = System.currentTimeMillis();
|
||||
for (Entry<Player, Long> entry : CACHED_WH.entrySet())
|
||||
{
|
||||
if ((cTime - entry.getValue().longValue()) > CACHE_TIME)
|
||||
|
@@ -39,7 +39,6 @@ import org.xml.sax.helpers.DefaultHandler;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -125,7 +124,7 @@ public class BotReportTable
|
||||
final Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
|
||||
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
|
||||
if (Chronos.currentTimeMillis() < c.getTimeInMillis())
|
||||
if (System.currentTimeMillis() < c.getTimeInMillis())
|
||||
{
|
||||
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
|
||||
}
|
||||
@@ -291,7 +290,7 @@ public class BotReportTable
|
||||
return false;
|
||||
}
|
||||
|
||||
final long reuse = (Chronos.currentTimeMillis() - rcdRep.getLastReporTime());
|
||||
final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
|
||||
if (reuse < Config.BOTREPORT_REPORT_DELAY)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
|
||||
@@ -302,7 +301,7 @@ public class BotReportTable
|
||||
}
|
||||
}
|
||||
|
||||
final long curTime = Chronos.currentTimeMillis();
|
||||
final long curTime = System.currentTimeMillis();
|
||||
if (rcd == null)
|
||||
{
|
||||
rcd = new ReportedCharData();
|
||||
@@ -419,12 +418,12 @@ public class BotReportTable
|
||||
final Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
|
||||
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
|
||||
if (Chronos.currentTimeMillis() > c.getTimeInMillis())
|
||||
if (System.currentTimeMillis() > c.getTimeInMillis())
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -465,7 +464,7 @@ public class BotReportTable
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@@ -31,7 +31,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
||||
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
||||
import org.l2jmobius.gameserver.enums.ClanWarState;
|
||||
@@ -172,7 +171,7 @@ public class ClanTable
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_FAILED_TO_CREATE_A_CLAN);
|
||||
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);
|
||||
return null;
|
||||
@@ -347,7 +346,7 @@ public class ClanTable
|
||||
{
|
||||
destroyClan(clanId);
|
||||
}
|
||||
}, Math.max(getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis(), 300000));
|
||||
}, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
|
||||
}
|
||||
|
||||
public boolean isAllyExists(String allyName)
|
||||
|
@@ -29,7 +29,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import org.l2jmobius.gameserver.model.TradeItem;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
@@ -187,7 +186,7 @@ public class OfflineTraderTable
|
||||
final Calendar cal = Calendar.getInstance();
|
||||
cal.setTimeInMillis(time);
|
||||
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
|
||||
if (cal.getTimeInMillis() <= Chronos.currentTimeMillis())
|
||||
if (cal.getTimeInMillis() <= System.currentTimeMillis())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@@ -26,7 +26,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.DailyMissionStatus;
|
||||
import org.l2jmobius.gameserver.enums.SpecialItemType;
|
||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||
@@ -126,7 +125,7 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
{
|
||||
entry.setStatus(DailyMissionStatus.COMPLETED);
|
||||
}
|
||||
entry.setLastCompleted(Chronos.currentTimeMillis());
|
||||
entry.setLastCompleted(System.currentTimeMillis());
|
||||
entry.setRecentlyCompleted(true);
|
||||
storePlayerEntry(entry);
|
||||
|
||||
|
@@ -23,7 +23,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.enums.PlayerAction;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
@@ -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.
|
||||
ThreadPool.execute(() ->
|
||||
{
|
||||
final long begin = Chronos.currentTimeMillis();
|
||||
final long begin = System.currentTimeMillis();
|
||||
try
|
||||
{
|
||||
if (Config.GMAUDIT)
|
||||
@@ -134,7 +133,7 @@ public class AdminCommandHandler implements IHandler<IAdminCommandHandler, Strin
|
||||
}
|
||||
finally
|
||||
{
|
||||
final long runtime = Chronos.currentTimeMillis() - begin;
|
||||
final long runtime = System.currentTimeMillis() - begin;
|
||||
if (runtime > 5000)
|
||||
{
|
||||
player.sendMessage("The execution of '" + fullCommand + "' took " + TimeAmountInterpreter.consolidateMillis(runtime) + ".");
|
||||
|
@@ -22,7 +22,6 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
@@ -49,7 +48,7 @@ public class AntiFeedManager
|
||||
*/
|
||||
public void setLastDeathTime(int objectId)
|
||||
{
|
||||
_lastDeathTimes.put(objectId, Chronos.currentTimeMillis());
|
||||
_lastDeathTimes.put(objectId, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +81,7 @@ public class AntiFeedManager
|
||||
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;
|
||||
}
|
||||
|
@@ -42,7 +42,6 @@ import org.w3c.dom.Node;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.IXmlReader;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.enums.ManorMode;
|
||||
@@ -278,7 +277,7 @@ public class CastleManorManager implements IXmlReader, IStorable
|
||||
}
|
||||
}
|
||||
// Schedule mode change
|
||||
ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - Chronos.currentTimeMillis()));
|
||||
ThreadPool.schedule(this::changeMode, (_nextModeChange.getTimeInMillis() - System.currentTimeMillis()));
|
||||
}
|
||||
|
||||
public void changeMode()
|
||||
|
@@ -25,7 +25,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
import org.l2jmobius.gameserver.model.residences.ClanHallAuction;
|
||||
@@ -42,7 +41,7 @@ public class ClanHallAuctionManager
|
||||
|
||||
protected ClanHallAuctionManager()
|
||||
{
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
|
||||
// Schedule of the start, next Wednesday at 19:00.
|
||||
final Calendar start = Calendar.getInstance();
|
||||
|
@@ -35,7 +35,6 @@ import org.w3c.dom.Node;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.IXmlReader;
|
||||
import org.l2jmobius.gameserver.model.CursedWeapon;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
@@ -314,7 +313,7 @@ public class CursedWeaponsManager implements IXmlReader
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_S2_MINUTE_S_OF_USAGE_TIME_REMAINING_TYPE_CURSEDSWORD_TO_CHECK_OTHER_INFORMATION);
|
||||
sm.addString(cw.getName());
|
||||
// sm.addItemName(cw.getItemId());
|
||||
sm.addInt((int) ((cw.getEndTime() - Chronos.currentTimeMillis()) / 60000));
|
||||
sm.addInt((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.SpawnTable;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
@@ -215,7 +214,7 @@ public class DBSpawnManager
|
||||
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
|
||||
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
|
||||
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
|
||||
final long respawnTime = Chronos.currentTimeMillis() + respawnDelay;
|
||||
final long respawnTime = System.currentTimeMillis() + respawnDelay;
|
||||
info.set("currentHP", npc.getMaxHp());
|
||||
info.set("currentMP", npc.getMaxMp());
|
||||
info.set("respawnTime", respawnTime);
|
||||
@@ -257,7 +256,7 @@ public class DBSpawnManager
|
||||
}
|
||||
|
||||
final int npcId = spawn.getId();
|
||||
final long time = Chronos.currentTimeMillis();
|
||||
final long time = System.currentTimeMillis();
|
||||
SpawnTable.getInstance().addNewSpawn(spawn, false);
|
||||
if ((respawnTime == 0) || (time > respawnTime))
|
||||
{
|
||||
@@ -279,7 +278,7 @@ public class DBSpawnManager
|
||||
}
|
||||
else
|
||||
{
|
||||
final long spawnTime = respawnTime - Chronos.currentTimeMillis();
|
||||
final long spawnTime = respawnTime - System.currentTimeMillis();
|
||||
_schedules.put(npcId, ThreadPool.schedule(() -> scheduleSpawn(npcId), spawnTime));
|
||||
}
|
||||
|
||||
|
@@ -29,7 +29,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||
@@ -73,7 +72,7 @@ public class DailyTaskManager
|
||||
protected DailyTaskManager()
|
||||
{
|
||||
// Schedule reset everyday at 6:30.
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
final Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 6);
|
||||
calendar.set(Calendar.MINUTE, 30);
|
||||
@@ -106,7 +105,7 @@ public class DailyTaskManager
|
||||
private void onReset()
|
||||
{
|
||||
// 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.
|
||||
if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY)
|
||||
|
@@ -21,7 +21,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.instancemanager.tasks.UpdateSoDStateTask;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
@@ -105,7 +104,7 @@ public class GraciaSeedsManager
|
||||
case 2:
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
// change to Attack state because Defend statet is not implemented
|
||||
@@ -173,7 +172,7 @@ public class GraciaSeedsManager
|
||||
public void setSoDState(int value, boolean doSave)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": New Seed of Destruction state -> " + value + ".");
|
||||
_SoDLastStateChangeDate.setTimeInMillis(Chronos.currentTimeMillis());
|
||||
_SoDLastStateChangeDate.setTimeInMillis(System.currentTimeMillis());
|
||||
_SoDState = value;
|
||||
// reset number of Tiat kills
|
||||
if (_SoDState == 1)
|
||||
@@ -199,7 +198,7 @@ public class GraciaSeedsManager
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - Chronos.currentTimeMillis());
|
||||
return ((_SoDLastStateChangeDate.getTimeInMillis() + Config.SOD_STAGE_2_LENGTH) - System.currentTimeMillis());
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
|
@@ -30,7 +30,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.util.PrimeFinder;
|
||||
|
||||
/**
|
||||
@@ -86,7 +85,7 @@ public class IdManager
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
Statement statement = con.createStatement())
|
||||
{
|
||||
final long cleanupStart = Chronos.currentTimeMillis();
|
||||
final long cleanupStart = System.currentTimeMillis();
|
||||
int cleanCount = 0;
|
||||
|
||||
// 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 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)
|
||||
{
|
||||
@@ -174,7 +173,7 @@ public class IdManager
|
||||
{
|
||||
try (PreparedStatement statement = con.prepareStatement(line))
|
||||
{
|
||||
statement.setLong(1, Chronos.currentTimeMillis());
|
||||
statement.setLong(1, System.currentTimeMillis());
|
||||
cleanCount += statement.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,6 @@ import org.w3c.dom.Node;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.IXmlReader;
|
||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||
import org.l2jmobius.gameserver.data.xml.SpawnData;
|
||||
@@ -525,7 +524,7 @@ public class InstanceManager implements IXmlReader
|
||||
{
|
||||
// Check if instance penalty passed
|
||||
final long time = rs.getLong("time");
|
||||
if (time > Chronos.currentTimeMillis())
|
||||
if (time > System.currentTimeMillis())
|
||||
{
|
||||
// Load params
|
||||
final int charId = rs.getInt("charId");
|
||||
@@ -560,7 +559,7 @@ public class InstanceManager implements IXmlReader
|
||||
final List<Integer> invalidPenalty = new ArrayList<>(instanceTimes.size());
|
||||
for (Entry<Integer, Long> entry : instanceTimes.entrySet())
|
||||
{
|
||||
if (entry.getValue() <= Chronos.currentTimeMillis())
|
||||
if (entry.getValue() <= System.currentTimeMillis())
|
||||
{
|
||||
invalidPenalty.add(entry.getKey());
|
||||
}
|
||||
@@ -619,7 +618,7 @@ public class InstanceManager implements IXmlReader
|
||||
|
||||
// If reenter time is higher then current, delete it
|
||||
final long time = playerData.get(id);
|
||||
if (time <= Chronos.currentTimeMillis())
|
||||
if (time <= System.currentTimeMillis())
|
||||
{
|
||||
deleteInstanceTime(player, id);
|
||||
return -1;
|
||||
|
@@ -29,7 +29,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.taskmanager.ItemsAutoDestroyTaskManager;
|
||||
@@ -84,7 +83,7 @@ public class ItemsOnGroundManager implements Runnable
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(str))
|
||||
{
|
||||
ps.setLong(1, Chronos.currentTimeMillis());
|
||||
ps.setLong(1, System.currentTimeMillis());
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@@ -29,7 +29,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.Mentee;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -146,7 +145,7 @@ public class MentorManager
|
||||
{
|
||||
final Player player = World.getInstance().getPlayer(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)
|
||||
|
@@ -29,7 +29,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.events.Containers;
|
||||
@@ -80,7 +79,7 @@ public class PremiumManager
|
||||
final Player player = event.getPlayer();
|
||||
final String accountName = player.getAccountName();
|
||||
loadPremiumData(accountName);
|
||||
final long now = Chronos.currentTimeMillis();
|
||||
final long now = System.currentTimeMillis();
|
||||
final long premiumExpiration = getPremiumExpiration(accountName);
|
||||
player.setPremiumStatus(premiumExpiration > now);
|
||||
if (player.hasPremiumStatus())
|
||||
@@ -154,7 +153,7 @@ public class PremiumManager
|
||||
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
|
||||
{
|
||||
final long addTime = timeUnit.toMillis(timeValue);
|
||||
final long now = Chronos.currentTimeMillis();
|
||||
final long now = System.currentTimeMillis();
|
||||
// new premium task at least from now
|
||||
final long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
|
||||
final long newPremiumExpiration = oldPremiumExpiration + addTime;
|
||||
|
@@ -25,7 +25,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.holders.PunishmentHolder;
|
||||
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
|
||||
import org.l2jmobius.gameserver.model.punishment.PunishmentTask;
|
||||
@@ -72,7 +71,7 @@ public class PunishmentManager
|
||||
final String punishedBy = rset.getString("punishedBy");
|
||||
if ((type != null) && (affect != null))
|
||||
{
|
||||
if ((expirationTime > 0) && (Chronos.currentTimeMillis() > expirationTime)) // expired task.
|
||||
if ((expirationTime > 0) && (System.currentTimeMillis() > expirationTime)) // expired task.
|
||||
{
|
||||
expired++;
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
@@ -42,7 +41,7 @@ public class RankManager
|
||||
private static final Logger LOGGER = Logger.getLogger(RankManager.class.getName());
|
||||
|
||||
public static final Long TIME_LIMIT = 2592000000L; // 30 days in milliseconds
|
||||
public static final long CURRENT_TIME = Chronos.currentTimeMillis();
|
||||
public static final long CURRENT_TIME = System.currentTimeMillis();
|
||||
public static final int PLAYER_LIMIT = 500;
|
||||
|
||||
private static final String SELECT_CHARACTERS = "SELECT charId,char_name,level,race,base_class, clanid FROM characters WHERE (" + CURRENT_TIME + " - cast(lastAccess as signed) < " + TIME_LIMIT + ") AND accesslevel = 0 AND level > 84 ORDER BY exp DESC, onlinetime DESC LIMIT " + PLAYER_LIMIT;
|
||||
|
@@ -25,7 +25,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.SpawnTable;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
@@ -425,7 +424,7 @@ public class BlockChecker
|
||||
// Start up player parameters
|
||||
setUpPlayers();
|
||||
// Set the started time
|
||||
_startedTime = Chronos.currentTimeMillis() + 300000;
|
||||
_startedTime = System.currentTimeMillis() + 300000;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,7 +524,7 @@ public class BlockChecker
|
||||
_redPoints += _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());
|
||||
_holder.broadCastPacketToTeam(changePoints);
|
||||
}
|
||||
|
@@ -25,7 +25,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||
import org.l2jmobius.gameserver.enums.PartyMessageType;
|
||||
@@ -200,7 +199,7 @@ public class CursedWeapon implements INamable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (Chronos.currentTimeMillis() >= _endTime)
|
||||
if (System.currentTimeMillis() >= _endTime)
|
||||
{
|
||||
endOfLife();
|
||||
}
|
||||
@@ -332,7 +331,7 @@ public class CursedWeapon implements INamable
|
||||
public void reActivate()
|
||||
{
|
||||
_isActivated = true;
|
||||
if ((_endTime - Chronos.currentTimeMillis()) <= 0)
|
||||
if ((_endTime - System.currentTimeMillis()) <= 0)
|
||||
{
|
||||
endOfLife();
|
||||
}
|
||||
@@ -350,7 +349,7 @@ public class CursedWeapon implements INamable
|
||||
dropIt(attackable, player);
|
||||
|
||||
// Start the Life Task
|
||||
_endTime = Chronos.currentTimeMillis() + (_duration * 60000);
|
||||
_endTime = System.currentTimeMillis() + (_duration * 60000);
|
||||
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
|
||||
return true;
|
||||
}
|
||||
@@ -634,7 +633,7 @@ public class CursedWeapon implements INamable
|
||||
|
||||
public long getTimeLeft()
|
||||
{
|
||||
return _endTime - Chronos.currentTimeMillis();
|
||||
return _endTime - System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void goTo(Player player)
|
||||
|
@@ -20,7 +20,6 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||
import org.l2jmobius.gameserver.model.buylist.Product;
|
||||
import org.l2jmobius.gameserver.model.ensoul.EnsoulOption;
|
||||
@@ -152,14 +151,14 @@ public class ItemInfo
|
||||
_soulCrystalOptions = item.getSpecialAbilities();
|
||||
_soulCrystalSpecialOptions = item.getAdditionalSpecialAbilities();
|
||||
_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)
|
||||
{
|
||||
this(item);
|
||||
_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)
|
||||
|
@@ -21,7 +21,6 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||
import org.l2jmobius.gameserver.enums.MailType;
|
||||
@@ -105,7 +104,7 @@ public class Message
|
||||
_receiverId = receiverId;
|
||||
_subject = subject;
|
||||
_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;
|
||||
_unread = true;
|
||||
_deletedBySender = false;
|
||||
@@ -124,7 +123,7 @@ public class Message
|
||||
_receiverId = receiverId;
|
||||
_subject = subject;
|
||||
_content = content;
|
||||
_expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||
_expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||
_reqAdena = 0;
|
||||
_hasAttachments = false;
|
||||
_unread = true;
|
||||
@@ -144,7 +143,7 @@ public class Message
|
||||
_receiverId = receiverId;
|
||||
_subject = subject;
|
||||
_content = content;
|
||||
_expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||
_expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||
_hasAttachments = false;
|
||||
_unread = true;
|
||||
_deletedBySender = true;
|
||||
@@ -163,7 +162,7 @@ public class Message
|
||||
_receiverId = msg.getSenderId();
|
||||
_subject = "";
|
||||
_content = "";
|
||||
_expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||
_expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||
_unread = true;
|
||||
_deletedBySender = true;
|
||||
_deletedByReceiver = false;
|
||||
@@ -183,7 +182,7 @@ public class Message
|
||||
_receiverId = receiverId;
|
||||
_subject = "";
|
||||
_content = item.getName();
|
||||
_expiration = Chronos.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||
_expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||
_unread = true;
|
||||
_deletedBySender = true;
|
||||
_messageType = mailType;
|
||||
|
@@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.model;
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.PetitionState;
|
||||
import org.l2jmobius.gameserver.enums.PetitionType;
|
||||
import org.l2jmobius.gameserver.instancemanager.IdManager;
|
||||
@@ -37,7 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
*/
|
||||
public class Petition
|
||||
{
|
||||
private final long _submitTime = Chronos.currentTimeMillis();
|
||||
private final long _submitTime = System.currentTimeMillis();
|
||||
private final int _id;
|
||||
private final PetitionType _type;
|
||||
private PetitionState _state = PetitionState.PENDING;
|
||||
|
@@ -24,7 +24,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
@@ -260,7 +259,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
_scheduledCount++;
|
||||
|
||||
// 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;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
@@ -53,7 +52,7 @@ public class TimeStamp
|
||||
_id2 = skill.getLevel();
|
||||
_id3 = skill.getSubLevel();
|
||||
_reuse = reuse;
|
||||
_stamp = systime > 0 ? systime : reuse != 0 ? Chronos.currentTimeMillis() + reuse : 0;
|
||||
_stamp = systime > 0 ? systime : reuse != 0 ? System.currentTimeMillis() + reuse : 0;
|
||||
_group = -1;
|
||||
}
|
||||
|
||||
@@ -69,7 +68,7 @@ public class TimeStamp
|
||||
_id2 = item.getObjectId();
|
||||
_id3 = 0;
|
||||
_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();
|
||||
}
|
||||
|
||||
@@ -156,7 +155,7 @@ public class TimeStamp
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
final long remainingTime = Math.max(_stamp - Chronos.currentTimeMillis(), 0);
|
||||
final long remainingTime = Math.max(_stamp - System.currentTimeMillis(), 0);
|
||||
if (remainingTime == 0)
|
||||
{
|
||||
_stamp = 0;
|
||||
@@ -174,7 +173,7 @@ public class TimeStamp
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
|
||||
final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
|
||||
if (!hasNotPassed)
|
||||
{
|
||||
_stamp = 0;
|
||||
|
@@ -29,7 +29,6 @@ import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
@@ -97,7 +96,7 @@ public class World
|
||||
private static final AtomicInteger _memberInPartyNumber = new AtomicInteger();
|
||||
|
||||
private static final Set<Player> _pkPlayers = ConcurrentHashMap.newKeySet(30);
|
||||
private static final AtomicInteger _lastPkTime = new AtomicInteger((int) Chronos.currentTimeMillis() / 1000);
|
||||
private static final AtomicInteger _lastPkTime = new AtomicInteger((int) System.currentTimeMillis() / 1000);
|
||||
|
||||
private static final WorldRegion[][] _worldRegions = new WorldRegion[REGIONS_X + 1][REGIONS_Y + 1];
|
||||
|
||||
@@ -846,13 +845,13 @@ public class World
|
||||
}
|
||||
}
|
||||
_pkPlayers.add(player);
|
||||
_lastPkTime.set((int) Chronos.currentTimeMillis() / 1000);
|
||||
_lastPkTime.set((int) System.currentTimeMillis() / 1000);
|
||||
}
|
||||
|
||||
public void removePkPlayer(Player player)
|
||||
{
|
||||
_pkPlayers.remove(player);
|
||||
_lastPkTime.set((int) Chronos.currentTimeMillis() / 1000);
|
||||
_lastPkTime.set((int) System.currentTimeMillis() / 1000);
|
||||
}
|
||||
|
||||
public Set<Player> getPkPlayers()
|
||||
|
@@ -30,7 +30,6 @@ import java.util.logging.Level;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.AttackableAI;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -216,7 +215,7 @@ public class Attackable extends Npc
|
||||
if (_firstCommandChannelAttacked != null)
|
||||
{
|
||||
_commandChannelTimer = new CommandChannelTimer(this);
|
||||
_commandChannelLastAttack = Chronos.currentTimeMillis();
|
||||
_commandChannelLastAttack = System.currentTimeMillis();
|
||||
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
|
||||
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
|
||||
}
|
||||
@@ -225,7 +224,7 @@ public class Attackable extends Npc
|
||||
}
|
||||
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.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.EmptyQueue;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.AttackableAI;
|
||||
@@ -1475,7 +1474,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
if ((group > 0) && !_reuseTimeStampsItems.isEmpty())
|
||||
{
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
for (TimeStamp ts : _reuseTimeStampsItems.values())
|
||||
{
|
||||
if (ts.getSharedReuseGroup() == group)
|
||||
@@ -1605,7 +1604,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
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;
|
||||
}
|
||||
if (stamp < Chronos.currentTimeMillis())
|
||||
if (stamp < System.currentTimeMillis())
|
||||
{
|
||||
_disabledSkills.remove(hashCode);
|
||||
return false;
|
||||
|
@@ -24,7 +24,6 @@ import java.util.logging.Level;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
import org.l2jmobius.gameserver.data.ItemTable;
|
||||
@@ -206,7 +205,7 @@ public class Npc extends Creature
|
||||
public void onRandomAnimation(int animationId)
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
_lastSocialBroadcast = now;
|
||||
|
@@ -47,7 +47,6 @@ import java.util.stream.Collectors;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.LoginServerThread;
|
||||
@@ -2877,7 +2876,7 @@ public class Player extends Playable
|
||||
public void setOnlineTime(long time)
|
||||
{
|
||||
_onlineTime = time;
|
||||
_onlineBeginTime = Chronos.currentTimeMillis();
|
||||
_onlineBeginTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3928,22 +3927,22 @@ public class Player extends Playable
|
||||
|
||||
public boolean isSpawnProtected()
|
||||
{
|
||||
return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > Chronos.currentTimeMillis());
|
||||
return (_spawnProtectEndTime != 0) && (_spawnProtectEndTime > System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public boolean isTeleportProtected()
|
||||
{
|
||||
return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > Chronos.currentTimeMillis());
|
||||
return (_teleportProtectEndTime != 0) && (_teleportProtectEndTime > System.currentTimeMillis());
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
_teleportProtectEndTime = protect ? Chronos.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
|
||||
_teleportProtectEndTime = protect ? System.currentTimeMillis() + (Config.PLAYER_TELEPORT_PROTECTION * 1000) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5332,7 +5331,7 @@ public class Player extends Playable
|
||||
{
|
||||
return;
|
||||
}
|
||||
setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
|
||||
setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
|
||||
if (_pvpFlag == 0)
|
||||
{
|
||||
startPvPFlag();
|
||||
@@ -5365,11 +5364,11 @@ public class Player extends Playable
|
||||
{
|
||||
if (checkIfPvP(targetPlayer))
|
||||
{
|
||||
setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_PVP_TIME);
|
||||
setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME);
|
||||
}
|
||||
else
|
||||
{
|
||||
setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
|
||||
setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
|
||||
}
|
||||
if (_pvpFlag == 0)
|
||||
{
|
||||
@@ -6295,7 +6294,7 @@ public class Player extends Playable
|
||||
|
||||
public long getUptime()
|
||||
{
|
||||
return Chronos.currentTimeMillis() - _uptime;
|
||||
return System.currentTimeMillis() - _uptime;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6539,7 +6538,7 @@ public class Player extends Playable
|
||||
PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?"))
|
||||
{
|
||||
statement.setInt(1, isOnlineInt());
|
||||
statement.setLong(2, Chronos.currentTimeMillis());
|
||||
statement.setLong(2, System.currentTimeMillis());
|
||||
statement.setInt(3, getObjectId());
|
||||
statement.execute();
|
||||
}
|
||||
@@ -6667,12 +6666,12 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
|
||||
if (player.getClanJoinExpiryTime() < Chronos.currentTimeMillis())
|
||||
if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
|
||||
{
|
||||
player.setClanJoinExpiryTime(0);
|
||||
}
|
||||
player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time"));
|
||||
if (player.getClanCreateExpiryTime() < Chronos.currentTimeMillis())
|
||||
if (player.getClanCreateExpiryTime() < System.currentTimeMillis())
|
||||
{
|
||||
player.setClanCreateExpiryTime(0);
|
||||
}
|
||||
@@ -6732,7 +6731,7 @@ public class Player extends Playable
|
||||
player.getAppearance().setTitleColor(titleColor);
|
||||
}
|
||||
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
|
||||
player.setUptime(Chronos.currentTimeMillis());
|
||||
player.setUptime(System.currentTimeMillis());
|
||||
|
||||
currentHp = rset.getDouble("curHp");
|
||||
currentCp = rset.getDouble("curCp");
|
||||
@@ -7304,7 +7303,7 @@ public class Player extends Playable
|
||||
long totalOnlineTime = _onlineTime;
|
||||
if (_onlineBeginTime > 0)
|
||||
{
|
||||
totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
|
||||
totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
|
||||
}
|
||||
statement.setLong(34, _offlineShopStart > 0 ? _onlineTime : totalOnlineTime);
|
||||
statement.setInt(35, _nobleLevel);
|
||||
@@ -7391,7 +7390,7 @@ public class Player extends Playable
|
||||
|
||||
int buffIndex = 0;
|
||||
final List<Long> storedSkills = new ArrayList<>();
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
|
||||
// Store all effect data along with calulated remaining
|
||||
// reuse delays for matching skills. 'restore_type'= 0.
|
||||
@@ -7506,7 +7505,7 @@ public class Player extends Playable
|
||||
ps1.setInt(1, getObjectId());
|
||||
ps1.execute();
|
||||
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
for (TimeStamp ts : getItemReuseTimeStamps().values())
|
||||
{
|
||||
if ((ts != null) && (currentTime < ts.getStamp()))
|
||||
@@ -7827,7 +7826,7 @@ public class Player extends Playable
|
||||
statement.setInt(2, _classIndex);
|
||||
try (ResultSet rset = statement.executeQuery())
|
||||
{
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
while (rset.next())
|
||||
{
|
||||
final int remainingTime = rset.getInt("remaining_time");
|
||||
@@ -7889,7 +7888,7 @@ public class Player extends Playable
|
||||
long systime;
|
||||
boolean isInInventory;
|
||||
long remainingTime;
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
while (rset.next())
|
||||
{
|
||||
itemId = rset.getInt("itemId");
|
||||
@@ -7964,7 +7963,7 @@ public class Player extends Playable
|
||||
{
|
||||
int slot;
|
||||
int symbolId;
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
while (rset.next())
|
||||
{
|
||||
slot = rset.getInt("slot");
|
||||
@@ -8087,7 +8086,7 @@ public class Player extends Playable
|
||||
// Send Server->Client UserInfo packet to this Player
|
||||
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;
|
||||
if ((henna.getDuration() < 0) || (timeLeft > 0))
|
||||
{
|
||||
@@ -8178,7 +8177,7 @@ public class Player extends Playable
|
||||
// Task for henna duration
|
||||
if (henna.getDuration() > 0)
|
||||
{
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
final long durationInMillis = henna.getDuration() * 60000;
|
||||
getVariables().set("HennaDuration" + i, currentTime + durationInMillis);
|
||||
_hennaRemoveSchedules.put(i, ThreadPool.schedule(new HennaDurationTask(this, i), currentTime + durationInMillis));
|
||||
@@ -12671,7 +12670,7 @@ public class Player extends Playable
|
||||
|
||||
public int getBirthdays()
|
||||
{
|
||||
long time = (Chronos.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
|
||||
long time = (System.currentTimeMillis() - _createDate.getTimeInMillis()) / 1000;
|
||||
time /= TimeUnit.DAYS.toMillis(365);
|
||||
return (int) time;
|
||||
}
|
||||
@@ -12911,7 +12910,7 @@ public class Player extends Playable
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
|
||||
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -12963,7 +12962,7 @@ public class Player extends Playable
|
||||
*/
|
||||
public void setFalling()
|
||||
{
|
||||
_fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
|
||||
_fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -12984,7 +12983,7 @@ public class Player extends Playable
|
||||
*/
|
||||
public void updateLastItemAuctionRequest()
|
||||
{
|
||||
_lastItemAuctionInfoRequest = Chronos.currentTimeMillis();
|
||||
_lastItemAuctionInfoRequest = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -12993,7 +12992,7 @@ public class Player extends Playable
|
||||
*/
|
||||
public boolean isItemAuctionPolling()
|
||||
{
|
||||
return (Chronos.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
|
||||
return (System.currentTimeMillis() - _lastItemAuctionInfoRequest) < 2000;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -13352,7 +13351,7 @@ public class Player extends Playable
|
||||
|
||||
public void updateNotMoveUntil()
|
||||
{
|
||||
_notMoveUntil = Chronos.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
|
||||
_notMoveUntil = System.currentTimeMillis() + Config.PLAYER_MOVEMENT_BLOCK_TIME;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -14277,7 +14276,7 @@ public class Player extends Playable
|
||||
public boolean isInTraingCamp()
|
||||
{
|
||||
final TrainingHolder trainingHolder = getTraingCampInfo();
|
||||
return (trainingHolder != null) && (trainingHolder.getEndTime() > Chronos.currentTimeMillis());
|
||||
return (trainingHolder != null) && (trainingHolder.getEndTime() > System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public AttendanceInfoHolder getAttendanceInfo()
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor.instance;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.games.BlockChecker;
|
||||
@@ -143,7 +142,7 @@ public class Block extends Monster
|
||||
{
|
||||
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 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));
|
||||
|
@@ -21,7 +21,6 @@ import java.util.regex.Pattern;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.enums.InstanceType;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
@@ -282,13 +281,13 @@ public class VillageMaster extends Folk
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_DISSOLVE_A_CLAN_DURING_A_SIEGE_OR_WHILE_PROTECTING_A_CASTLE);
|
||||
return;
|
||||
}
|
||||
if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_ALREADY_REQUESTED_THE_DISSOLUTION_OF_YOUR_CLAN);
|
||||
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();
|
||||
|
||||
// The clan leader should take the XP penalty of a full death.
|
||||
|
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.model.actor.tasks.attackable;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
|
||||
/**
|
||||
@@ -41,7 +40,7 @@ public class CommandChannelTimer implements Runnable
|
||||
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.setFirstCommandChannelAttacked(null);
|
||||
|
@@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.model.actor.tasks.player;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
|
||||
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -94,12 +93,12 @@ public class IllegalPlayerActionTask implements Runnable
|
||||
}
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.item.ItemTemplate;
|
||||
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
|
||||
import org.l2jmobius.gameserver.taskmanager.BuyListTaskManager;
|
||||
@@ -121,7 +120,7 @@ public class Product
|
||||
return false;
|
||||
}
|
||||
|
||||
BuyListTaskManager.getInstance().add(this, Chronos.currentTimeMillis() + _restockDelay);
|
||||
BuyListTaskManager.getInstance().add(this, System.currentTimeMillis() + _restockDelay);
|
||||
|
||||
final boolean result = _count.addAndGet(-value) >= 0;
|
||||
save();
|
||||
@@ -135,7 +134,7 @@ public class Product
|
||||
|
||||
public void restartRestockTask(long nextRestockTime)
|
||||
{
|
||||
final long remainTime = nextRestockTime - Chronos.currentTimeMillis();
|
||||
final long remainTime = nextRestockTime - System.currentTimeMillis();
|
||||
if (remainTime > 0)
|
||||
{
|
||||
BuyListTaskManager.getInstance().update(this, remainTime);
|
||||
|
@@ -35,7 +35,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
|
||||
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
@@ -515,7 +514,7 @@ public class Clan implements IIdentifiable, INamable
|
||||
if (player.isClanLeader())
|
||||
{
|
||||
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
|
||||
@@ -554,7 +553,7 @@ public class Clan implements IIdentifiable, INamable
|
||||
}
|
||||
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
|
||||
@@ -1004,12 +1003,12 @@ public class Clan implements IIdentifiable, INamable
|
||||
setAllyId(clanData.getInt("ally_id"));
|
||||
setAllyName(clanData.getString("ally_name"));
|
||||
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
|
||||
if (_allyPenaltyExpiryTime < Chronos.currentTimeMillis())
|
||||
if (_allyPenaltyExpiryTime < System.currentTimeMillis())
|
||||
{
|
||||
setAllyPenaltyExpiryTime(0, 0);
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -2056,7 +2055,7 @@ public class Clan implements IIdentifiable, INamable
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
|
||||
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);
|
||||
return false;
|
||||
@@ -2068,7 +2067,7 @@ public class Clan implements IIdentifiable, INamable
|
||||
player.sendPacket(sm);
|
||||
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);
|
||||
sm.addString(target.getName());
|
||||
@@ -2110,7 +2109,7 @@ public class Clan implements IIdentifiable, INamable
|
||||
return false;
|
||||
}
|
||||
final Clan leaderClan = player.getClan();
|
||||
if ((leaderClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis()) && (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN))
|
||||
if ((leaderClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis()) && (leaderClan.getAllyPenaltyType() == PENALTY_TYPE_DISMISS_CLAN))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_MAY_NOT_ACCEPT_ANY_CLAN_WITHIN_A_DAY_AFTER_EXPELLING_ANOTHER_CLAN);
|
||||
return false;
|
||||
@@ -2146,7 +2145,7 @@ public class Clan implements IIdentifiable, INamable
|
||||
player.sendPacket(sm);
|
||||
return false;
|
||||
}
|
||||
if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
|
||||
{
|
||||
@@ -2240,12 +2239,12 @@ public class Clan implements IIdentifiable, INamable
|
||||
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
|
||||
return;
|
||||
}
|
||||
if ((_allyPenaltyExpiryTime > 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);
|
||||
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);
|
||||
return;
|
||||
@@ -2297,7 +2296,7 @@ public class Clan implements IIdentifiable, INamable
|
||||
|
||||
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()))
|
||||
{
|
||||
if (clan.getId() != getId())
|
||||
@@ -2323,7 +2322,7 @@ public class Clan implements IIdentifiable, INamable
|
||||
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
|
||||
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);
|
||||
return false;
|
||||
@@ -2708,7 +2707,7 @@ public class Clan implements IIdentifiable, INamable
|
||||
|
||||
public void addMasterySkill(int id)
|
||||
{
|
||||
getVariables().set(ClanVariables.CLAN_MASTERY_SKILL_TIME + id, Chronos.currentTimeMillis() + 1296000000);
|
||||
getVariables().set(ClanVariables.CLAN_MASTERY_SKILL_TIME + id, System.currentTimeMillis() + 1296000000);
|
||||
final ScheduledFuture<?> task = ThreadPool.schedule(() -> removeMasterySkill(id), 1296000000); // 1296000000 = 15 days
|
||||
masterySkillTasks.add(task);
|
||||
addNewSkill(SkillData.getInstance().getSkill(id, 1));
|
||||
@@ -2727,7 +2726,7 @@ public class Clan implements IIdentifiable, INamable
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return (int) (endTime - Chronos.currentTimeMillis());
|
||||
return (int) (endTime - System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void setDevelopmentPoints(int count)
|
||||
|
@@ -22,7 +22,6 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.enums.ClanWarState;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -55,9 +54,9 @@ public class ClanWar
|
||||
{
|
||||
_attackerClanId = attacker.getId();
|
||||
_attackedClanId = attacked.getId();
|
||||
_startTime = Chronos.currentTimeMillis();
|
||||
_startTime = System.currentTimeMillis();
|
||||
_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);
|
||||
attacked.addWar(attacker.getId(), this);
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(attacker, attacked));
|
||||
@@ -80,15 +79,15 @@ public class ClanWar
|
||||
_attackerKillCount.set(attackerKillCount);
|
||||
_attackedKillCount.set(attackedKillCount);
|
||||
_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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
@@ -178,8 +177,8 @@ public class ClanWar
|
||||
winnerClan.broadcastToOnlineMembers(sm);
|
||||
|
||||
_winnerClanId = winnerClan.getId();
|
||||
_endTime = Chronos.currentTimeMillis();
|
||||
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - Chronos.currentTimeMillis());
|
||||
_endTime = System.currentTimeMillis();
|
||||
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(cancelor.getId(), winnerClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_DEFEAT) - System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void clanWarTimeout()
|
||||
@@ -197,8 +196,8 @@ public class ClanWar
|
||||
attackerClan.broadcastToOnlineMembers(sm);
|
||||
|
||||
_state = ClanWarState.TIE;
|
||||
_endTime = Chronos.currentTimeMillis();
|
||||
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - Chronos.currentTimeMillis());
|
||||
_endTime = System.currentTimeMillis();
|
||||
ThreadPool.schedule(() -> ClanTable.getInstance().deleteClanWars(attackerClan.getId(), attackedClan.getId()), (_endTime + TIME_TO_DELETION_AFTER_CANCELLATION) - System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,6 @@ import java.io.Serializable;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
|
||||
/**
|
||||
@@ -86,7 +85,7 @@ public class TrainingHolder implements Serializable
|
||||
|
||||
public long getElapsedTime()
|
||||
{
|
||||
return TimeUnit.SECONDS.convert(Chronos.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
|
||||
return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
public long getRemainingTime()
|
||||
|
@@ -39,7 +39,6 @@ import java.util.stream.Stream;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||
import org.l2jmobius.gameserver.enums.InstanceReenterType;
|
||||
@@ -108,7 +107,7 @@ public class Instance implements IIdentifiable, INamable
|
||||
// Set basic instance info
|
||||
_id = id;
|
||||
_template = template;
|
||||
_startTime = Chronos.currentTimeMillis();
|
||||
_startTime = System.currentTimeMillis();
|
||||
_spawns = new ArrayList<>(template.getSpawns().size());
|
||||
|
||||
// Clone and add the spawn templates
|
||||
@@ -796,7 +795,7 @@ public class Instance implements IIdentifiable, INamable
|
||||
}
|
||||
|
||||
// Set new cleanup task
|
||||
_endTime = Chronos.currentTimeMillis() + millis;
|
||||
_endTime = System.currentTimeMillis() + millis;
|
||||
if (minutes < 1) // Destroy instance
|
||||
{
|
||||
destroy();
|
||||
@@ -900,7 +899,7 @@ public class Instance implements IIdentifiable, INamable
|
||||
*/
|
||||
public long getElapsedTime()
|
||||
{
|
||||
return Chronos.currentTimeMillis() - _startTime;
|
||||
return System.currentTimeMillis() - _startTime;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -909,7 +908,7 @@ public class Instance implements IIdentifiable, INamable
|
||||
*/
|
||||
public long getRemainingTime()
|
||||
{
|
||||
return (_endTime == -1) ? -1 : (_endTime - Chronos.currentTimeMillis());
|
||||
return (_endTime == -1) ? -1 : (_endTime - System.currentTimeMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.enums.GroupType;
|
||||
import org.l2jmobius.gameserver.enums.InstanceReenterType;
|
||||
@@ -563,7 +562,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
|
||||
{
|
||||
if (data.getTime() > 0)
|
||||
{
|
||||
time = Chronos.currentTimeMillis() + data.getTime();
|
||||
time = System.currentTimeMillis() + data.getTime();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -573,7 +572,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
|
||||
// If calendar time is lower than current, add one more day
|
||||
if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
|
||||
if (calendar.getTimeInMillis() <= System.currentTimeMillis())
|
||||
{
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
||||
}
|
||||
@@ -590,7 +589,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
|
||||
|
||||
// Set exact day. If modified date is before current, add one more week.
|
||||
calendar.set(Calendar.DAY_OF_WEEK, day);
|
||||
if (calendar.getTimeInMillis() <= Chronos.currentTimeMillis())
|
||||
if (calendar.getTimeInMillis() <= System.currentTimeMillis())
|
||||
{
|
||||
calendar.add(Calendar.WEEK_OF_MONTH, 1);
|
||||
}
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.instancezone.conditions;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@@ -40,6 +39,6 @@ public class ConditionReenter extends Condition
|
||||
protected boolean test(Player player, Npc npc)
|
||||
{
|
||||
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.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.data.xml.AgathionData;
|
||||
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
|
||||
@@ -206,7 +205,7 @@ public class Item extends WorldObject
|
||||
_type2 = 0;
|
||||
_dropTime = 0;
|
||||
_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();
|
||||
scheduleVisualLifeTime();
|
||||
}
|
||||
@@ -229,7 +228,7 @@ public class Item extends WorldObject
|
||||
super.setName(_itemTemplate.getName());
|
||||
_loc = ItemLocation.VOID;
|
||||
_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();
|
||||
scheduleVisualLifeTime();
|
||||
}
|
||||
@@ -1582,7 +1581,7 @@ public class Item extends WorldObject
|
||||
setSpawned(true);
|
||||
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
|
||||
|
||||
// Add the Item dropped in the world as a visible object
|
||||
@@ -1861,7 +1860,7 @@ public class Item extends WorldObject
|
||||
|
||||
public long getRemainingTime()
|
||||
{
|
||||
return _time - Chronos.currentTimeMillis();
|
||||
return _time - System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void endOfLife()
|
||||
@@ -2518,7 +2517,7 @@ public class Item extends WorldObject
|
||||
if (getVisualLifeTime() > 0)
|
||||
{
|
||||
final long endTime = getVisualLifeTime();
|
||||
if ((endTime - Chronos.currentTimeMillis()) > 0)
|
||||
if ((endTime - System.currentTimeMillis()) > 0)
|
||||
{
|
||||
ItemAppearanceTaskManager.getInstance().add(this, endTime);
|
||||
}
|
||||
|
@@ -28,7 +28,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.ItemInfo;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -182,12 +181,12 @@ public class ItemAuction
|
||||
|
||||
public long getStartingTimeRemaining()
|
||||
{
|
||||
return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
|
||||
return Math.max(_endingTime - System.currentTimeMillis(), 0);
|
||||
}
|
||||
|
||||
public long getFinishingTimeRemaining()
|
||||
{
|
||||
return Math.max(_endingTime - Chronos.currentTimeMillis(), 0);
|
||||
return Math.max(_endingTime - System.currentTimeMillis(), 0);
|
||||
}
|
||||
|
||||
public void storeMe()
|
||||
@@ -340,7 +339,7 @@ public class ItemAuction
|
||||
_highestBid = bid;
|
||||
}
|
||||
|
||||
if ((_endingTime - Chronos.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
|
||||
if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
|
||||
{
|
||||
switch (_auctionEndingExtendState)
|
||||
{
|
||||
@@ -427,7 +426,7 @@ public class ItemAuction
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
@@ -41,7 +41,6 @@ import org.w3c.dom.Node;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
import org.l2jmobius.gameserver.enums.ItemLocation;
|
||||
@@ -244,7 +243,7 @@ public class ItemAuctionInstance
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
|
||||
nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
@@ -253,10 +252,10 @@ public class ItemAuctionInstance
|
||||
{
|
||||
case CREATED:
|
||||
{
|
||||
if (auctions[0].getStartingTime() < (Chronos.currentTimeMillis() + START_TIME_SPACE))
|
||||
if (auctions[0].getStartingTime() < (System.currentTimeMillis() + START_TIME_SPACE))
|
||||
{
|
||||
currentAuction = auctions[0];
|
||||
nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
|
||||
nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -267,13 +266,13 @@ public class ItemAuctionInstance
|
||||
case STARTED:
|
||||
{
|
||||
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;
|
||||
}
|
||||
case FINISHED:
|
||||
{
|
||||
currentAuction = auctions[0];
|
||||
nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
|
||||
nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -288,7 +287,7 @@ public class ItemAuctionInstance
|
||||
{
|
||||
Arrays.sort(auctions, Comparator.comparingLong(ItemAuction::getStartingTime).reversed());
|
||||
// just to make sure we won't skip any auction because of little different times
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
for (ItemAuction auction : auctions)
|
||||
{
|
||||
if (auction.getAuctionState() == ItemAuctionState.STARTED)
|
||||
@@ -312,7 +311,7 @@ public class ItemAuctionInstance
|
||||
}
|
||||
if (nextAuction == null)
|
||||
{
|
||||
nextAuction = createAuction(Chronos.currentTimeMillis() + START_TIME_SPACE);
|
||||
nextAuction = createAuction(System.currentTimeMillis() + START_TIME_SPACE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -327,17 +326,17 @@ public class ItemAuctionInstance
|
||||
{
|
||||
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
|
||||
{
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -423,7 +422,7 @@ public class ItemAuctionInstance
|
||||
if (_auction.getScheduledAuctionEndingExtendState() == ItemAuctionExtendState.INITIAL)
|
||||
{
|
||||
_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;
|
||||
}
|
||||
break;
|
||||
@@ -433,7 +432,7 @@ public class ItemAuctionInstance
|
||||
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_3_MIN)
|
||||
{
|
||||
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_3_MIN);
|
||||
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
|
||||
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -443,7 +442,7 @@ public class ItemAuctionInstance
|
||||
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B)
|
||||
{
|
||||
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_B);
|
||||
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
|
||||
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -453,7 +452,7 @@ public class ItemAuctionInstance
|
||||
if (_auction.getScheduledAuctionEndingExtendState() != ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A)
|
||||
{
|
||||
_auction.setScheduledAuctionEndingExtendState(ItemAuctionExtendState.EXTEND_BY_CONFIG_PHASE_A);
|
||||
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - Chronos.currentTimeMillis(), 0)));
|
||||
setStateTask(ThreadPool.schedule(this, Math.max(_auction.getEndingTime() - System.currentTimeMillis(), 0)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -578,7 +577,7 @@ public class ItemAuctionInstance
|
||||
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);
|
||||
try (PreparedStatement ps = con.prepareStatement(DELETE_AUCTION_INFO_BY_AUCTION_ID))
|
||||
|
@@ -21,7 +21,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.PartyMessageType;
|
||||
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
|
||||
@@ -85,7 +84,7 @@ public abstract class AbstractOlympiadGame
|
||||
|
||||
protected boolean makeCompetitionStart()
|
||||
{
|
||||
_startTime = Chronos.currentTimeMillis();
|
||||
_startTime = System.currentTimeMillis();
|
||||
return !_aborted;
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
@@ -791,7 +790,7 @@ public class Hero
|
||||
|
||||
// Prepare new data
|
||||
final StatSet diaryEntry = new StatSet();
|
||||
final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
|
||||
final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
|
||||
diaryEntry.set("date", date);
|
||||
diaryEntry.set("action", template.getName() + " was defeated");
|
||||
|
||||
@@ -812,7 +811,7 @@ public class Hero
|
||||
|
||||
// Prepare new data
|
||||
final StatSet diaryEntry = new StatSet();
|
||||
final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(Chronos.currentTimeMillis()));
|
||||
final String date = (new SimpleDateFormat("yyyy-MM-dd HH")).format(new Date(System.currentTimeMillis()));
|
||||
diaryEntry.set("date", date);
|
||||
diaryEntry.set("action", castle.getName() + " Castle was successfuly taken");
|
||||
|
||||
@@ -826,7 +825,7 @@ public class Hero
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO heroes_diary (charId, time, action, param) values(?,?,?,?)"))
|
||||
{
|
||||
ps.setInt(1, charId);
|
||||
ps.setLong(2, Chronos.currentTimeMillis());
|
||||
ps.setLong(2, System.currentTimeMillis());
|
||||
ps.setInt(3, action);
|
||||
ps.setInt(4, param);
|
||||
ps.execute();
|
||||
|
@@ -27,7 +27,6 @@ import java.util.logging.Level;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
@@ -545,7 +544,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
|
||||
String winner = "draw";
|
||||
|
||||
// Calculate Fight time
|
||||
final long _fightTime = (Chronos.currentTimeMillis() - _startTime);
|
||||
final long _fightTime = (System.currentTimeMillis() - _startTime);
|
||||
|
||||
double playerOneHp = 0;
|
||||
if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
|
||||
|
@@ -27,7 +27,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
|
||||
import org.l2jmobius.gameserver.handler.PunishmentHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
|
||||
@@ -134,7 +133,7 @@ public class PunishmentTask implements Runnable
|
||||
*/
|
||||
public boolean isExpired()
|
||||
{
|
||||
return (_expirationTime > 0) && (Chronos.currentTimeMillis() > _expirationTime);
|
||||
return (_expirationTime > 0) && (System.currentTimeMillis() > _expirationTime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,7 +149,7 @@ public class PunishmentTask implements Runnable
|
||||
onStart();
|
||||
if (_expirationTime > 0) // Has expiration?
|
||||
{
|
||||
_task = ThreadPool.schedule(this, (_expirationTime - Chronos.currentTimeMillis()));
|
||||
_task = ThreadPool.schedule(this, (_expirationTime - System.currentTimeMillis()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +226,7 @@ public class PunishmentTask implements Runnable
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement st = con.prepareStatement(UPDATE_QUERY))
|
||||
{
|
||||
st.setLong(1, Chronos.currentTimeMillis());
|
||||
st.setLong(1, System.currentTimeMillis());
|
||||
st.setLong(2, _id);
|
||||
st.execute();
|
||||
}
|
||||
|
@@ -34,7 +34,6 @@ import org.w3c.dom.Node;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.IXmlReader;
|
||||
import org.l2jmobius.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
|
||||
@@ -102,7 +101,7 @@ public class LongTimeEvent extends Quest
|
||||
}
|
||||
else if (_eventPeriod.getStartDate().after(new Date()))
|
||||
{
|
||||
final long delay = _eventPeriod.getStartDate().getTime() - Chronos.currentTimeMillis();
|
||||
final long delay = _eventPeriod.getStartDate().getTime() - System.currentTimeMillis();
|
||||
ThreadPool.schedule(new ScheduleStart(), delay);
|
||||
LOGGER.info("Event " + _eventName + " will be started at " + _eventPeriod.getStartDate());
|
||||
}
|
||||
@@ -300,7 +299,7 @@ public class LongTimeEvent extends Quest
|
||||
_destroyItemsOnEnd.add(itemId);
|
||||
|
||||
// Add item deletion info to manager.
|
||||
if (endtime > Chronos.currentTimeMillis())
|
||||
if (endtime > System.currentTimeMillis())
|
||||
{
|
||||
ItemDeletionInfoManager.getInstance().addItemDate(itemId, (int) (endtime / 1000));
|
||||
}
|
||||
@@ -335,7 +334,7 @@ public class LongTimeEvent extends Quest
|
||||
EventDropManager.getInstance().addDrops(this, _dropList);
|
||||
|
||||
// Add spawns.
|
||||
final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - Chronos.currentTimeMillis();
|
||||
final Long millisToEventEnd = _eventPeriod.getEndDate().getTime() - System.currentTimeMillis();
|
||||
for (NpcSpawn spawn : _spawnList)
|
||||
{
|
||||
addSpawn(spawn.npcId, spawn.loc.getX(), spawn.loc.getY(), spawn.loc.getZ(), spawn.loc.getHeading(), false, millisToEventEnd, false);
|
||||
|
@@ -22,7 +22,6 @@ import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.QuestSound;
|
||||
import org.l2jmobius.gameserver.enums.QuestType;
|
||||
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||
@@ -846,7 +845,7 @@ public class QuestState
|
||||
public boolean isNowAvailable()
|
||||
{
|
||||
final String val = get(RESTART_VAR);
|
||||
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
|
||||
return (val != null) && (Long.parseLong(val) <= System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void setSimulated(boolean simulated)
|
||||
|
@@ -28,7 +28,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
||||
import org.l2jmobius.gameserver.enums.SocialClass;
|
||||
@@ -139,7 +138,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
|
||||
final int level = rs.getInt("level");
|
||||
final long expiration = rs.getLong("expiration");
|
||||
final ResidenceFunction func = new ResidenceFunction(id, level, expiration, this);
|
||||
if ((expiration <= Chronos.currentTimeMillis()) && !func.reactivate())
|
||||
if ((expiration <= System.currentTimeMillis()) && !func.reactivate())
|
||||
{
|
||||
removeFunction(func);
|
||||
continue;
|
||||
|
@@ -33,7 +33,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.enums.ClanHallGrade;
|
||||
import org.l2jmobius.gameserver.enums.ClanHallType;
|
||||
@@ -280,7 +279,7 @@ public class ClanHall extends AbstractResidence
|
||||
|
||||
final int failDays = getCostFailDay();
|
||||
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : _paidUntil;
|
||||
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - Chronos.currentTimeMillis());
|
||||
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -325,7 +324,7 @@ public class ClanHall extends AbstractResidence
|
||||
*/
|
||||
public long getNextPayment()
|
||||
{
|
||||
return (_checkPaymentTask != null) ? Chronos.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
|
||||
return (_checkPaymentTask != null) ? System.currentTimeMillis() + _checkPaymentTask.getDelay(TimeUnit.MILLISECONDS) : 0;
|
||||
}
|
||||
|
||||
public Location getOwnerLocation()
|
||||
@@ -397,7 +396,7 @@ public class ClanHall extends AbstractResidence
|
||||
{
|
||||
_owner.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, _lease, null, null);
|
||||
setPaidUntil(Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(7)).toEpochMilli());
|
||||
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - Chronos.currentTimeMillis());
|
||||
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - System.currentTimeMillis());
|
||||
updateDB();
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.xml.ClanHallData;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
@@ -84,7 +83,7 @@ public class ClanHallAuction
|
||||
|
||||
public void addBid(Clan clan, long bid)
|
||||
{
|
||||
addBid(clan, bid, Chronos.currentTimeMillis());
|
||||
addBid(clan, bid, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void addBid(Clan clan, long bid, long bidTime)
|
||||
|
@@ -20,7 +20,6 @@ import java.time.Instant;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.xml.ResidenceFunctionsData;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
@@ -64,9 +63,9 @@ public class ResidenceFunction
|
||||
private void init()
|
||||
{
|
||||
final ResidenceFunctionTemplate template = getTemplate();
|
||||
if ((template != null) && (_expiration > Chronos.currentTimeMillis()))
|
||||
if ((template != null) && (_expiration > System.currentTimeMillis()))
|
||||
{
|
||||
_task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - Chronos.currentTimeMillis());
|
||||
_task = ThreadPool.schedule(this::onFunctionExpiration, _expiration - System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +170,7 @@ public class ResidenceFunction
|
||||
|
||||
if (wh.destroyItem("FunctionFee", item, template.getCost().getCount(), null, this) != null)
|
||||
{
|
||||
_expiration = Chronos.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
|
||||
_expiration = System.currentTimeMillis() + (template.getDuration().getSeconds() * 1000);
|
||||
init();
|
||||
}
|
||||
return true;
|
||||
|
@@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.model.shuttle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
|
||||
/**
|
||||
@@ -30,7 +29,7 @@ public class ShuttleStop
|
||||
private final int _id;
|
||||
private boolean _isOpen = true;
|
||||
private final List<Location> _dimensions = new ArrayList<>(3);
|
||||
private long _lastDoorStatusChanges = Chronos.currentTimeMillis();
|
||||
private long _lastDoorStatusChanges = System.currentTimeMillis();
|
||||
|
||||
public ShuttleStop(int id)
|
||||
{
|
||||
@@ -65,7 +64,7 @@ public class ShuttleStop
|
||||
}
|
||||
|
||||
_isOpen = true;
|
||||
_lastDoorStatusChanges = Chronos.currentTimeMillis();
|
||||
_lastDoorStatusChanges = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void closeDoor()
|
||||
@@ -76,11 +75,11 @@ public class ShuttleStop
|
||||
}
|
||||
|
||||
_isOpen = false;
|
||||
_lastDoorStatusChanges = Chronos.currentTimeMillis();
|
||||
_lastDoorStatusChanges = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public boolean hasDoorChanged()
|
||||
{
|
||||
return (Chronos.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
|
||||
return (System.currentTimeMillis() - _lastDoorStatusChanges) <= 1000;
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.xml.CastleData;
|
||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||
@@ -164,7 +163,7 @@ public class Castle extends AbstractResidence
|
||||
{
|
||||
return;
|
||||
}
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if (_endDate > currentTime)
|
||||
{
|
||||
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
|
||||
@@ -199,7 +198,7 @@ public class Castle extends AbstractResidence
|
||||
fee = _tempFee;
|
||||
}
|
||||
|
||||
setEndTime(Chronos.currentTimeMillis() + _rate);
|
||||
setEndTime(System.currentTimeMillis() + _rate);
|
||||
dbSave();
|
||||
if (_cwh)
|
||||
{
|
||||
|
@@ -35,7 +35,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.SpawnTable;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||
@@ -162,7 +161,7 @@ public class Fort extends AbstractResidence
|
||||
{
|
||||
return;
|
||||
}
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if (_endDate > currentTime)
|
||||
{
|
||||
ThreadPool.schedule(new FunctionTask(cwh), _endDate - currentTime);
|
||||
@@ -192,7 +191,7 @@ public class Fort extends AbstractResidence
|
||||
if ((_fortOwner.getWarehouse().getAdena() >= _fee) || !_cwh)
|
||||
{
|
||||
final int fee = _endDate == -1 ? _tempFee : _fee;
|
||||
setEndTime(Chronos.currentTimeMillis() + _rate);
|
||||
setEndTime(System.currentTimeMillis() + _rate);
|
||||
dbSave();
|
||||
if (_cwh)
|
||||
{
|
||||
@@ -579,7 +578,7 @@ public class Fort extends AbstractResidence
|
||||
clan.setFortId(getResidenceId());
|
||||
setOwnerClan(clan);
|
||||
final int runCount = getOwnedTime() / (Config.FS_UPDATE_FRQ * 60);
|
||||
long initial = Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
|
||||
long initial = System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis();
|
||||
while (initial > (Config.FS_UPDATE_FRQ * 60000))
|
||||
{
|
||||
initial -= Config.FS_UPDATE_FRQ * 60000;
|
||||
@@ -785,7 +784,7 @@ public class Fort extends AbstractResidence
|
||||
if (clan != null)
|
||||
{
|
||||
clanId = clan.getId();
|
||||
_lastOwnedTime.setTimeInMillis(Chronos.currentTimeMillis());
|
||||
_lastOwnedTime.setTimeInMillis(System.currentTimeMillis());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -919,12 +918,12 @@ public class Fort extends AbstractResidence
|
||||
|
||||
public int getOwnedTime()
|
||||
{
|
||||
return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((Chronos.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
|
||||
return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) ((System.currentTimeMillis() - _lastOwnedTime.getTimeInMillis()) / 1000);
|
||||
}
|
||||
|
||||
public int getTimeTillRebelArmy()
|
||||
{
|
||||
return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - Chronos.currentTimeMillis()) / 1000);
|
||||
return _lastOwnedTime.getTimeInMillis() == 0 ? 0 : (int) (((_lastOwnedTime.getTimeInMillis() + (Config.FS_MAX_OWN_TIME * 3600000)) - System.currentTimeMillis()) / 1000);
|
||||
}
|
||||
|
||||
public long getTimeTillNextFortUpdate()
|
||||
|
@@ -34,7 +34,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.cache.RelationCache;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.xml.SiegeScheduleData;
|
||||
@@ -1446,9 +1445,9 @@ public class Siege implements Siegable
|
||||
}
|
||||
|
||||
final Calendar calendar = _castle.getSiegeDate();
|
||||
if (calendar.getTimeInMillis() < Chronos.currentTimeMillis())
|
||||
if (calendar.getTimeInMillis() < System.currentTimeMillis())
|
||||
{
|
||||
calendar.setTimeInMillis(Chronos.currentTimeMillis());
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
calendar.set(Calendar.DAY_OF_WEEK, holder.getDay());
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.zone.type;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.GameServer;
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -99,7 +98,7 @@ public class NoRestartZone extends ZoneType
|
||||
return;
|
||||
}
|
||||
|
||||
if (((Chronos.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
|
||||
if (((System.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
|
||||
{
|
||||
player.teleToLocation(TeleportWhereType.TOWN);
|
||||
}
|
||||
|
@@ -31,7 +31,6 @@ import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.network.ChannelInboundHandler;
|
||||
import org.l2jmobius.commons.network.ICrypt;
|
||||
import org.l2jmobius.commons.network.IIncomingPacket;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.LoginServerThread;
|
||||
import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
@@ -345,7 +344,7 @@ public class GameClient extends ChannelInboundHandler<GameClient>
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps2 = con.prepareStatement("UPDATE characters SET deletetime=? WHERE charId=?"))
|
||||
{
|
||||
ps2.setLong(1, Chronos.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
ps2.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
ps2.setInt(2, objectId);
|
||||
ps2.execute();
|
||||
}
|
||||
|
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
@@ -82,7 +81,7 @@ public class AllyDismiss implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000), Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
|
||||
leaderClan.updateClanInDB();
|
||||
|
||||
|
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
@@ -63,7 +62,7 @@ public class AllyLeave implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
clan.setAllyId(0);
|
||||
clan.setAllyName(null);
|
||||
clan.changeAllyCrest(0, true);
|
||||
|
@@ -22,7 +22,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.LoginServerThread;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
|
||||
@@ -553,7 +552,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_RECENTLY_BEEN_DISMISSED_FROM_A_CLAN_YOU_ARE_NOT_ALLOWED_TO_JOIN_ANOTHER_CLAN_FOR_24_HOURS);
|
||||
}
|
||||
|
@@ -20,7 +20,6 @@ import java.util.Arrays;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||
@@ -75,7 +74,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
|
||||
if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@@ -20,7 +20,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
|
||||
import org.l2jmobius.gameserver.enums.ItemSkillType;
|
||||
@@ -129,7 +128,7 @@ public class RequestEnchantItem implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// fast auto-enchant cheat check
|
||||
if ((request.getTimestamp() == 0) || ((Chronos.currentTimeMillis() - request.getTimestamp()) < 2000))
|
||||
if ((request.getTimestamp() == 0) || ((System.currentTimeMillis() - request.getTimestamp()) < 2000))
|
||||
{
|
||||
Util.handleIllegalPlayerAction(player, player + " use autoenchant program ", Config.DEFAULT_PUNISH);
|
||||
player.removeRequest(request.getClass());
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
|
||||
@@ -83,7 +82,7 @@ public class RequestExAddEnchantScrollItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
request.setTimestamp(Chronos.currentTimeMillis());
|
||||
request.setTimestamp(System.currentTimeMillis());
|
||||
player.sendPacket(new ExPutEnchantScrollItemResult(_scrollObjectId));
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
@@ -56,7 +55,7 @@ public class RequestExRemoveEnchantSupportItem implements IClientIncomingPacket
|
||||
request.setSupportItem(Player.ID_NONE);
|
||||
}
|
||||
|
||||
request.setTimestamp(Chronos.currentTimeMillis());
|
||||
request.setTimestamp(System.currentTimeMillis());
|
||||
player.sendPacket(ExRemoveEnchantSupportItemResult.STATIC_PACKET);
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.CrestTable;
|
||||
import org.l2jmobius.gameserver.enums.CrestType;
|
||||
import org.l2jmobius.gameserver.model.Crest;
|
||||
@@ -70,7 +69,7 @@ public class RequestExSetPledgeCrestLarge implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
|
||||
return;
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
|
||||
@@ -86,7 +85,7 @@ public class RequestExTryToPutEnchantSupportItem implements IClientIncomingPacke
|
||||
}
|
||||
|
||||
request.setSupportItem(support.getObjectId());
|
||||
request.setTimestamp(Chronos.currentTimeMillis());
|
||||
request.setTimestamp(System.currentTimeMillis());
|
||||
player.sendPacket(new ExPutEnchantSupportItemResult(_supportObjectId));
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.request.EnchantItemRequest;
|
||||
@@ -78,7 +77,7 @@ public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
|
||||
}
|
||||
return;
|
||||
}
|
||||
request.setTimestamp(Chronos.currentTimeMillis());
|
||||
request.setTimestamp(System.currentTimeMillis());
|
||||
player.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
@@ -70,7 +69,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
|
||||
{
|
||||
if (_isJoining == 1)
|
||||
{
|
||||
if (Chronos.currentTimeMillis() < clan.getDissolvingExpiryTime())
|
||||
if (System.currentTimeMillis() < clan.getDissolvingExpiryTime())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOUR_CLAN_MAY_NOT_REGISTER_TO_PARTICIPATE_IN_A_SIEGE_WHILE_UNDER_A_GRACE_PERIOD_OF_THE_CLAN_S_DISSOLUTION);
|
||||
return;
|
||||
|
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.instancemanager.BoatManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -62,7 +61,7 @@ public class RequestMoveToLocationInVehicle implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > Chronos.currentTimeMillis()))
|
||||
if ((Config.PLAYER_MOVEMENT_BLOCK_TIME > 0) && !player.isGM() && (player.getNotMoveUntil() > System.currentTimeMillis()))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_MOVE_WHILE_SPEAKING_TO_AN_NPC_ONE_MOMENT_PLEASE);
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||
@@ -82,8 +81,8 @@ public class RequestOustPledgeMember implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// this also updates the database
|
||||
clan.removeClanMember(member.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
clan.setCharPenaltyExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
clan.removeClanMember(member.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
clan.updateClanInDB();
|
||||
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_HAS_BEEN_EXPELLED);
|
||||
|
@@ -22,7 +22,6 @@ import java.sql.SQLException;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
import org.l2jmobius.gameserver.network.PacketLogger;
|
||||
@@ -70,7 +69,7 @@ public class RequestPetitionFeedback implements IClientIncomingPacket
|
||||
statement.setString(2, player.getLastPetitionGmName());
|
||||
statement.setInt(3, _rate);
|
||||
statement.setString(4, _message);
|
||||
statement.setLong(5, Chronos.currentTimeMillis());
|
||||
statement.setLong(5, System.currentTimeMillis());
|
||||
statement.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.ClanLevelData;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ClanEntryManager;
|
||||
@@ -66,12 +65,12 @@ public class RequestPledgeSignInForOpenJoiningMethod implements IClientIncomingP
|
||||
final Clan clan = pledgeRecruitInfo.getClan();
|
||||
if ((clan != null) && (player.getClan() == null))
|
||||
{
|
||||
if (clan.getCharPenaltyExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (clan.getCharPenaltyExpiryTime() > 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);
|
||||
return;
|
||||
}
|
||||
if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (player.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);
|
||||
sm.addString(player.getName());
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.CrestTable;
|
||||
import org.l2jmobius.gameserver.enums.CrestType;
|
||||
import org.l2jmobius.gameserver.model.Crest;
|
||||
@@ -75,7 +74,7 @@ public class RequestSetPledgeCrest implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOU_CANNOT_REGISTER_OR_DELETE_A_CLAN_CREST);
|
||||
return;
|
||||
|
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.enums.ClanWarState;
|
||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||
@@ -102,7 +101,7 @@ public class RequestStartPledgeWar implements IClientIncomingPacket
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
else if (clanDeclaredWar.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
|
||||
else if (clanDeclaredWar.getDissolvingExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
player.sendPacket(new SystemMessage(SystemMessageId.A_CLAN_WAR_CAN_NOT_BE_DECLARED_AGAINST_A_CLAN_THAT_IS_BEING_DISSOLVED));
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
@@ -63,7 +62,7 @@ public class RequestWithdrawalPledge implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
clan.removeClanMember(player.getObjectId(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
clan.removeClanMember(player.getObjectId(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
|
||||
sm.addString(player.getName());
|
||||
|
@@ -22,7 +22,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.ai.NextAction;
|
||||
@@ -268,7 +267,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
else if (player.isAttackingNow())
|
||||
{
|
||||
// Equip or unEquip.
|
||||
ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(Chronos.currentTimeMillis()));
|
||||
ThreadPool.schedule(() -> player.useEquippableItem(item, false), player.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets.appearance;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
|
||||
import org.l2jmobius.gameserver.enums.InventorySlot;
|
||||
import org.l2jmobius.gameserver.enums.ItemLocation;
|
||||
@@ -253,7 +252,7 @@ public class RequestShapeShiftingItem implements IClientIncomingPacket
|
||||
|
||||
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getLifeTime() > 0))
|
||||
{
|
||||
targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, Chronos.currentTimeMillis() + appearanceStone.getLifeTime());
|
||||
targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, System.currentTimeMillis() + appearanceStone.getLifeTime());
|
||||
targetItem.scheduleVisualLifeTime();
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets.homunculus;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
@@ -55,7 +54,7 @@ public class RequestExHomunculusCreateStart implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
player.reduceAdena("Homunculus creation", COST, player, true);
|
||||
player.getVariables().set(PlayerVariables.HOMUNCULUS_CREATION_TIME, Chronos.currentTimeMillis() + CREATION_TIME);
|
||||
player.getVariables().set(PlayerVariables.HOMUNCULUS_CREATION_TIME, System.currentTimeMillis() + CREATION_TIME);
|
||||
|
||||
client.sendPacket(new ExShowHomunculusBirthInfo(player));
|
||||
client.sendPacket(new ExHomunculusCreateStartResult(player));
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets.homunculus;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.HomunculusData;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -57,7 +56,7 @@ public class RequestExHomunculusSummon implements IClientIncomingPacket
|
||||
final int vpPoints = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_VP_POINTS, 0);
|
||||
final int homunculusCreateTime = (int) (player.getVariables().getLong(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0) / 1000);
|
||||
|
||||
if ((homunculusCreateTime > 0) && ((Chronos.currentTimeMillis() / 1000) >= homunculusCreateTime) && (hpPoints == 100) && (spPoints == 10) && (vpPoints == 5))
|
||||
if ((homunculusCreateTime > 0) && ((System.currentTimeMillis() / 1000) >= homunculusCreateTime) && (hpPoints == 100) && (spPoints == 10) && (vpPoints == 5))
|
||||
{
|
||||
int chance;
|
||||
int random;
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets.huntingzones;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||
@@ -110,13 +109,13 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final int instanceId = holder.getInstanceId();
|
||||
if ((instanceId > 0) && holder.isSoloInstance() && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > Chronos.currentTimeMillis()))
|
||||
if ((instanceId > 0) && holder.isSoloInstance() && (InstanceManager.getInstance().getInstanceTime(player, instanceId) > System.currentTimeMillis()))
|
||||
{
|
||||
player.sendMessage("This transcendent instance has not reset yet.");
|
||||
return;
|
||||
}
|
||||
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
long endTime = currentTime + player.getTimedHuntingZoneRemainingTime(_zoneId);
|
||||
final long lastEntryTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_ENTRY + _zoneId, 0);
|
||||
if ((lastEntryTime + holder.getResetDelay()) < currentTime)
|
||||
|
@@ -21,7 +21,6 @@ import java.sql.PreparedStatement;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||
import org.l2jmobius.gameserver.instancemanager.MentorManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
@@ -119,9 +118,9 @@ public class ConfirmMenteeAdd implements IClientIncomingPacket
|
||||
mentor.sendPacket(SystemMessageId.YOU_MUST_AWAKEN_IN_ORDER_TO_BECOME_A_MENTOR);
|
||||
return false;
|
||||
}
|
||||
else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > Chronos.currentTimeMillis())
|
||||
else if (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) > System.currentTimeMillis())
|
||||
{
|
||||
long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - Chronos.currentTimeMillis()) / 1000;
|
||||
long remainingTime = (MentorManager.getInstance().getMentorPenalty(mentor.getObjectId()) - System.currentTimeMillis()) / 1000;
|
||||
final int days = (int) (remainingTime / 86400);
|
||||
remainingTime = remainingTime % 86400;
|
||||
final int hours = (int) (remainingTime / 3600);
|
||||
|
@@ -20,7 +20,6 @@ import java.util.Calendar;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||
import org.l2jmobius.gameserver.enums.ExBrProductReplyType;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -131,7 +130,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket
|
||||
*/
|
||||
private static boolean validatePlayer(PrimeShopGroup item, int count, Player player)
|
||||
{
|
||||
final long currentTime = Chronos.currentTimeMillis() / 1000;
|
||||
final long currentTime = System.currentTimeMillis() / 1000;
|
||||
if (item == null)
|
||||
{
|
||||
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
|
||||
|
@@ -20,7 +20,6 @@ import java.util.Calendar;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.CharNameTable;
|
||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||
import org.l2jmobius.gameserver.enums.ExBrProductReplyType;
|
||||
@@ -141,7 +140,7 @@ public class RequestBRPresentBuyProduct implements IClientIncomingPacket
|
||||
*/
|
||||
private static boolean validatePlayer(PrimeShopGroup item, int count, Player player)
|
||||
{
|
||||
final long currentTime = Chronos.currentTimeMillis() / 1000;
|
||||
final long currentTime = System.currentTimeMillis() / 1000;
|
||||
if (item == null)
|
||||
{
|
||||
player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVALID_PRODUCT));
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets.training;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.TrainingHolder;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
@@ -53,7 +52,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
|
||||
|
||||
if (holder.isTraining())
|
||||
{
|
||||
holder.setEndTime(Chronos.currentTimeMillis());
|
||||
holder.setEndTime(System.currentTimeMillis());
|
||||
player.setTraingCampInfo(holder);
|
||||
player.enableAllSkills();
|
||||
player.setInvul(false);
|
||||
@@ -61,7 +60,7 @@ public class NotifyTrainingRoomEnd implements IClientIncomingPacket
|
||||
player.setImmobilized(false);
|
||||
player.teleToLocation(player.getLastLocation());
|
||||
player.sendPacket(ExTrainingZone_Leaving.STATIC_PACKET);
|
||||
holder.setEndTime(Chronos.currentTimeMillis());
|
||||
holder.setEndTime(System.currentTimeMillis());
|
||||
player.setTraingCampInfo(holder);
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.loginserverpackets.game;
|
||||
|
||||
import org.l2jmobius.commons.network.BaseSendablePacket;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
|
||||
/**
|
||||
* @author mrTJO
|
||||
@@ -29,7 +28,7 @@ public class TempBan extends BaseSendablePacket
|
||||
writeC(0x0A);
|
||||
writeS(accountName);
|
||||
writeS(ip);
|
||||
writeQ(Chronos.currentTimeMillis() + (time * 60000));
|
||||
writeQ(System.currentTimeMillis() + (time * 60000));
|
||||
// if (reason != null)
|
||||
// {
|
||||
// writeC(0x01);
|
||||
|
@@ -27,7 +27,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||
import org.l2jmobius.gameserver.model.CharSelectInfoPackage;
|
||||
@@ -230,7 +229,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
|
||||
packet.writeD(charInfoPackage.getFace());
|
||||
packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP
|
||||
packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP
|
||||
packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0);
|
||||
packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0);
|
||||
packet.writeD(charInfoPackage.getClassId());
|
||||
packet.writeD(i == _activeId ? 1 : 0);
|
||||
packet.writeC(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_RHAND) > 127 ? 127 : charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_RHAND));
|
||||
@@ -319,7 +318,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
|
||||
|
||||
// See if the char must be deleted
|
||||
final long deletetime = chardata.getLong("deletetime");
|
||||
if ((deletetime > 0) && (Chronos.currentTimeMillis() > deletetime))
|
||||
if ((deletetime > 0) && (System.currentTimeMillis() > deletetime))
|
||||
{
|
||||
final Clan clan = ClanTable.getInstance().getClan(chardata.getInt("clanid"));
|
||||
if (clan != null)
|
||||
|
@@ -21,7 +21,6 @@ import java.util.Map.Entry;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
@@ -53,7 +52,7 @@ public class ExInzoneWaiting implements IClientOutgoingPacket
|
||||
packet.writeD(_instanceTimes.size());
|
||||
for (Entry<Integer, Long> entry : _instanceTimes.entrySet())
|
||||
{
|
||||
final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
|
||||
final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
|
||||
packet.writeD(entry.getKey());
|
||||
packet.writeD((int) instanceTime);
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@ import java.util.Map.Entry;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.ClassId;
|
||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.MatchingRoomManager;
|
||||
@@ -74,7 +73,7 @@ public class ExListPartyMatchingWaitingRoom implements IClientOutgoingPacket
|
||||
packet.writeD(instanceTimes.size());
|
||||
for (Entry<Integer, Long> entry : instanceTimes.entrySet())
|
||||
{
|
||||
final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
|
||||
final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
|
||||
packet.writeD(entry.getKey());
|
||||
packet.writeD((int) instanceTime);
|
||||
}
|
||||
|
@@ -21,7 +21,6 @@ import java.util.Map.Entry;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.MatchingMemberType;
|
||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
|
||||
@@ -61,7 +60,7 @@ public class ExPartyRoomMember implements IClientOutgoingPacket
|
||||
packet.writeD(instanceTimes.size());
|
||||
for (Entry<Integer, Long> entry : instanceTimes.entrySet())
|
||||
{
|
||||
final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - Chronos.currentTimeMillis());
|
||||
final long instanceTime = TimeUnit.MILLISECONDS.toSeconds(entry.getValue() - System.currentTimeMillis());
|
||||
packet.writeD(entry.getKey());
|
||||
packet.writeD((int) instanceTime);
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.serverpackets;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.enums.MailType;
|
||||
import org.l2jmobius.gameserver.instancemanager.MailManager;
|
||||
import org.l2jmobius.gameserver.model.Message;
|
||||
@@ -45,7 +44,7 @@ public class ExShowReceivedPostList implements IClientOutgoingPacket
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_SHOW_RECEIVED_POST_LIST.writeId(packet);
|
||||
packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
|
||||
packet.writeD((int) (System.currentTimeMillis() / 1000));
|
||||
if ((_inbox != null) && !_inbox.isEmpty())
|
||||
{
|
||||
packet.writeD(_inbox.size());
|
||||
|
@@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.serverpackets;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.instancemanager.MailManager;
|
||||
import org.l2jmobius.gameserver.model.Message;
|
||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
@@ -40,7 +39,7 @@ public class ExShowSentPostList implements IClientOutgoingPacket
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
OutgoingPackets.EX_SHOW_SENT_POST_LIST.writeId(packet);
|
||||
packet.writeD((int) (Chronos.currentTimeMillis() / 1000));
|
||||
packet.writeD((int) (System.currentTimeMillis() / 1000));
|
||||
if ((_outbox != null) && !_outbox.isEmpty())
|
||||
{
|
||||
packet.writeD(_outbox.size());
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user